Schedule page
-
Hello, I have to do a schedule page for my client and I want to give him rights to see the Advanced scheduler page so he can build his own schedulers as he want. But for example, if he want to make a schedule for room temperature in the page is not possible to select the point which will be modified by the schedule. It is possible to put the point somewhere in the page because I don't want to put the client to go in Event handlers page in mango and set up the point from there.
-
And also it is possible to have 3 temperature values in one schedule, I've seen that are only active and inactive but this is usually used for binary points.
-
Hi georgestefan,
Interesting question! Someone else may have a better answer, but that does sound like quite a puzzle.
The advanced scheduler raises events, and event handling can only really be configured on the event handlers page (quite a powerful page, I understand why you would not want a lower privilege user there). Hmm.
You could have a setup where the user encodes the point information somehow into an alphanumeric point, then the event triggers a set point event handler that either sets a value to trigger the script, or has the script in a scripted set point event handler, and then it needs to figure out what to do from the encoded information. It would be fragile if the user entered information wrong, potentially, or you can build this information in your UI.
For my script, I will assume my alphanumeric point's value is something like
{"p1":{"0": 62, "8": 68, "18": 65}}
//Untested var scheduleConfig = JSON.parse(alphanum.value); var now = new Date(); for( var contextPointVariableName in scheduleConfig ) { if(typeof this[contextPointVariableName] === 'undefined') //see if we have a point in context with that identifier continue; if(now.getHours() in scheduleConfig[contextPointVariableName]) //only providing hour level options here this[contextPointVariableName].set(scheduleConfig[contextPointVariableName][now.getHours()]); }
So this works if the variable name in the context of the script matches whatever key is used to define the schedule. This would enable a user to have many points they could control, but don't have to, without having to change anything about the event handler, and without being able to change the set of points they can act on.
To your other question about if it is possible to have three temperatures set. Yes, you can create three set point handlers on the event. Or, if you wanted to try that script, you would just have multiple context keys in the schedule's configuration with values at that hour.