Timed Rules
Trigger rule logic on a fixed interval
Last updated
Trigger rule logic on a fixed interval
Last updated
Rule Timers are used to trigger rule logic based on a fixed schedule and therefore allow the time-based evaluation of logic.
Timed Rules only support devices as data source. If a rule with a tag as data source is triggered by a timer, the rule execution will be aborted.
To add a timer to a rule, click the Add timer button at the bottom of the rule detail view.
The timer configuration modal provides a configuration wizard for the modes interval, fixed and advanced.
The interval mode provides minute-, hour- and day-interval settings for rule timers and will trigger the rule in the defined interval.
The minute intervals are adjusted by the hour, meaning a 10 minute interval will trigger every 10 minutes of the hour (i.e. XX:10, XX:20, and so on). The next execution will always be the next upcoming interval.
The hour intervals are adjusted by the day, meaning a 6 hour interval will trigger the rule at 06:00, 12:00, 18:00 and 24:00. The next execution will always be the next upcoming interval.
The day interval trigger the rule every day at 00:00 UTC.
Fixed timers will run every day at the selected time, starting from the day after the selected start date.
The advanced mode provides an input field for directly specifying a quartz cron-expression in UTC. Refer to this cron expression generator for creating a customized rule schedule.
Since rules are triggered by a timer and not a device, certain properties are not available for output templating, mainly the {{data.*}}
and all other properties related to the current sample.
They contain the data and other info related to the uplink. Since, when using a timer, there is no indication which device triggered the rule and therefore all of these properties are not available.
If data from the sample should be necessary for output templating in a timed rule, the {{dataSources.X.*}}
property can be used instead. Data sources are always resolved with their latest value. If a device has no data (yet) in the akenza database, the data source will not be resolved.
See the Payload Templating page for more details and all available properties.