Structure of TE-Time » History » Version 2

« Previous - Version 2/3 (diff) - Next » - Current version
Roman Köhler, 06/26/2013 04:28 PM


Structure of TE-Time

A definition of the TE-Time comes in two parts: a base time and a recurrence description.

Time Base

All parameters for the base time are children of "time". When evaluating a config-event, the "time" will be a object, when looking in the property-tree, it is a parent path:

Parameter: time/timeBase
Value: (String) Possible Values:
"daily" : all calculation based on midnight
"sunrise" : all calculation based on sunrise time from the solar-computer
"sunset" : all calculation based on sunset time from the solar-computer
"dawn" : all calculation based on civil dawn time from the solar-computer
"dusk" : all calculation based on civil dusk time from the solar-computer

Parameter: time/offset
Value: (Integer): Seconds used to calculate the time of day for scheduling based on the timeBase. This value can be negative, but his make only sense for timebases "sunrise", "sunset", "dusk", "dawn".
On timebase "daily" the base value is 0:00:00 and then added the seconds. A TE for 7:00:00 have a timebase "daily" and a offset of 7*60*60. The base value for "sunrise", "sunset", "dusk" and "dawn" will be determinated via the solarcomputer.

(optional) Parameter: time/limitAfter
Value: (Integer) seconds since Midnight, defines the minimum time of day, where the action should be executed. This value can be used for every time base, however it will be not evaluated on timebase "daily"
Both limitBefore and limitAfter can be used in one Entry

(optional) Parameter: time/limitBefore
Value: (Integer) seconds since Midnight, defines the maximum time of day, where the action should be executed. This value can be used for every time base, however it will be not evaluated on timebase "daily"
Both limitBefore and limitAfter can be used in one Entry

(optional) Parameter: time/random
Value: (Integer) seconds of a time span around the base time (modified with the limits), where the execution will be randomized. When the normal time should be 14:00:00 and a random value of 120 is given, the execution will be between 13:59:00 and 14:01:00.

(optional) Parameter: time/propertyReference
Value: (String) This parameter is evil. This string is a property path. Basicly, if this parameter is set, no recurrence rule are taken into account, but it will go the that path and take all found values as a unix-timestamp which defines a array of dates, on which the TE should executed. This values can be only one value, because a normal property path defines only a singular value. When evaluating this parameter, it will be split into paths and it will recursivly step down each part. If one part is a "*", it is interpreted as joker sign and it will step down each childnode.

Example:
/scripts/ps/holidays/*/startDate
-> go to /scripts
-> there go to ps
-> there go to holidays
-> there go down each child
-> there go to to startDate

Recurrence

Currently only two kind of recurrence is supported: "absolute" and "weekly"

Parameter: time/recurrenceBase (Property Tree) recurrence/recurrenceBase (Config Event)
Value: (String) Possible Values:
"absolute" : no really recurrence, a array of static Dates are provided
"weekly" : a array with weekdays are provided

Parameter: time/date/<index> (Property Tree) recurrence/timeArray[] (Config Event)
Value: (Array) a Array of unix-timestamps for a fixed day. only the date path are taken, the time of day is defined in the time-part. only used when recurrenceBase is "absolute"
(Attention: actually only one date is supported until #2658)

Parameter: time/recurrence/<index> (Property Tree) recurrence/timeArray[] (Config Event)
Value: (Array) a Array of Strings, each for a weekday: "MO", "TU, "WE", "TH", "FR", "SA", "SU". Only used when recurrenceBase is "weekly"