Schedule Object
glp/0/{SID}/fb/sev/{handle}/sts glp/0/{SID}/fb/sev/{handle}/cfg |
The IAP/MQ schedule object is addressed using the sev object type identifier. An object of this type is known as a schedule. Each schedule object contains the complete definition: events, repeating patterns, exceptions, and affected targets. Schedule objects make references to datapoint objects and make optional references to shared calendar objects, all within the same IAP/MQ segment.
The schedule object supports all valid IAP/MQ object handles. A descriptive handle such as “shopfront-lights” is recommended.
Schedule Actions
The schedule object supports two actions:
- create
- delete
The create action accepts a schedule configuration object with its arguments. The schedule configuration object can also be written directly with requests made in the IAP/MQ request channel. These requests can write the entire configuration object or parts of it. Items within the configuration object can be addressed directly in IAP/MQ, allowing you to change individual properties within a schedule object without writing the entire object.
The delete action requires no arguments.
The schedule outputs a status object (sts) in the IAP/MQ feedback channel.
Schedule Status Object
glp/0/{SID}/fb/sev/{handle}/sts |
The schedule status object is published in the IAP/MQ feedback channel at the sts endpoint, which reports the current state and value and the optional error property.
For example:
glp/0/Ty6532/fb/sev/shopfront-lights/sts |
Properties
The following table lists the Schedule Status Object properties:
Field Name | Type | Description |
state | string | Possible values are: normal, suspended, deleted Default: normal |
value | any valid value | The current value output by this schedule. Can be null or any other valid value, but the value must be acceptable to all targets. |
error | string | (Optional) error is not present by default. It can be omitted, set to null, or set to a string that reports the most recently encountered error. Schedule errors use the sev error category identifier, when one is provided. Diagnostics that include an identifier have the format: message [ category # number ] |
Schedule Configuration Object
glp/0/{SID}/fb/sev/{handle}/cfg glp/0/{SID}/rq/sev/{handle}/cfg |
The schedule configuration object is published in the IAP/MQ feedback channel at the cfg endpoint. It can also be written to the same endpoint in the IAP/MQ request channel, or directly addressed to items within the configuration object, allowing you to change individual properties within an object without writing the entire object.
For example:
glp/0/Ty6532/fb/sev/shopfront-lights/cfg |
Properties
The following table lists the Schedule Configuration Object properties:
Field Name | Type | Description |
desc | String | (Optional) Empty unless a description is provided. |
timespec | String | (Optional) Defines how all date and time references within this object are interpreted. Possible values:
Default: local |
prio | Integer | (Required) Defines the priority to be used with the value output by this schedule. Possible values are 1 to 16. |
default | String | (Optional) Defines the schedule’s output value, if no exception or weekly schedule applies. This default value will be output at the configured prio just like a scheduled value. The default can be null, which lets the schedule relinquish its priority level when no scheduled event, weekly or otherwise, is active. Default: null. |
suspend | Boolean | (Optional) Prevents the schedule's output value from changing while the schedule is suspended. Changing this property from True to False re-calculates the schedule. Default: False. |
effective | String | (Optional) Controls whether the schedule is enabled. effective defines an absolute date, a range of two dates, or a combination of week and day, including repeating options. The schedule object is enabled when the current date matches the specified effective date. The schedule object is ineffective otherwise. The scheduler ignores an ineffective schedule object. When an effective schedule becomes ineffective, the scheduler recalculates all effective schedules that might affect some or all of the same targets. The effective date cannot reference another item such as a calendar object. A schedule can be rendered ineffective with the effective property. For example, a schedule can be suspended by changing effective to a single day in the future. This has the same effect as suspending the schedule with suspend, which can be used to suspend a schedule without loss of its definitions in the effective property. Possible values are: null and date. (See Dates in Schedules and Calendars for a description.) Default: null (results in an always-enabled schedule) |
weekly | String | (Optional) Defines a weekly schedule (see Weekly Schedule for more information). A weekly schedule is only inspected when no exception takes precedence. At least one weekly schedule or exception schedule is required for a meaningful schedule. A schedule that has neither weekly nor exception schedules always outputs its default value. Possible values are: null and <weekly schedule>. |
exceptions | String | (Optional) Defines an exception schedule (see Exception Schedule for more information). Exception schedules take precedence over weekly schedules. At least one weekly schedule or exception schedule is required for a meaningful schedule. A schedule that has neither weekly nor exception schedules always outputs its default value. Possible values are: null and <exception schedule>. |
dp | String | (Required) Supplies a list of datapoint references. Each reference is an abbreviated topic that addresses a datapoint object within the request channel, using the tilde to represent the request channel address. For example, a datapoint with a full topic path of dp is required but the list can be empty. The schedule output changes according to the schedule, but no target is updated if the datapoint list is empty. Possible values are: null and <datapoint reference>. |
stagger | Integer | (Optional) Takes a number greater than zero, specifying a delay in seconds, that is enforced when updating a list of target datapoints after updating each individual target. Default: 0 (no enforced delay between updating the individual targets) |