Schedule Services
The schedule services are used to create and manage rules that change one or more datapoint values based on a schedule. The schedule services define two objects:
Schedule Objects can be created, modified, and deleted within an edge server, affecting any number of target datapoints. All targets must be managed by the same edge server, but a schedule can control datapoints across different edge protocols. Every schedule object has one output value, which it relays to its list of target datapoints.
Calendar Objects can be created, modified, and deleted within an edge server. For example, a calendar can classify the current day as a holiday or as a school day. Schedule objects can reference calendars within the same edge server. Every calendar object has an output value that indicates whether the calendar condition, such as “holiday” or “school day” is met.
For detailed descriptions, see Schedule Object and Calendar Object.
For information about specifying dates, see Dates in Schedules and Calendars.
The IAP CMS Calendar widget may not see all the schedule event information when using MQTT to create, modify or delete an event. The schedule event name for an MQTT created event will be the MQTT event handle. Once you create the event, you can go into the Calendar widget to change the event name.
Note: Starting with SmartServer 3.3 when you see create an MQTT event, you will see the datapoints defined in the MQTT create request. Prior to SmartServer 3.3 the datapoint defined in the MQTT request didn't show up in the CMS Calendar Widget.
Schedule Algorithm
A scheduler is a service that evaluates calendar and schedule objects and, for each schedule object, decides on its current output value.
For every schedule object that is effective according to its effective property, and that is not suspended according to its suspend property, the scheduler evaluates the exception schedules in priority order.
Exceptions are ranked by priority (1 to 16). Exceptions with priority 1, the highest priority, are evaluated prior to those with priority 2, and so on. Exceptions without an explicit priority are treated as priority 16, the lowest priority.
The first exception with valid events that has at least one event matching the current time determines the output value. This completes the calculation of the schedule output.
When no active exception is found, the scheduler determines the output value from the Weekly Schedule, if an applicable weekly schedule is defined. When neither an active exception or weekly schedule does not determine the schedule output, the default value determines the schedule output.
For time-value pairs in weekly schedules and exception schedules, the scheduler selects the latest time before, or at, the current time.
The scheduler computes the output of each calendar object and schedule object when any of the following occur:
- the object is created, deleted or modified.
- a calendar output changes.
- a schedule resumes (suspend transitions from true to false).
- a schedule becomes effective or ineffective, or when the next scheduled date and time is reached.
- at midnight (according to the timespec selection).
- the local clock changes due to new clock settings, date settings, or timezone settings by an amount that can alter the results of that calculation.
- the scheduler service starts.
Precision and accuracy of the scheduler is specific to, and documented with, the scheduler’s implementation.
The scheduler resolves ambiguity by preferring more specific over less specific instructions, where possible. For example, a weekly schedule can contain instructions for Sunday using weekday identifier 7, for Saturday or Sunday using identifier 10, and for every day using identifier 8. Such a weekly schedule would play the events defined for Sunday (7) on a Sunday, those for Saturday or Sunday (10) on a Saturday, and those defined for any day (8) on all other days of the week.
The numeric weekday identifiers are defined in Single Date Object.