# Timed Rules

**Rule Timers** are used to trigger rule logic based on a fixed schedule and therefore allow the time-based evaluation of logic.

{% hint style="info" %}
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.
{% endhint %}

To add a timer to a rule, click the *Add timer* button at the bottom of the rule detail view.&#x20;

<figure><img src="https://2165942204-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMKXTFIN5ZlLOjBlfC4%2Fuploads%2FEPz1sF96mxDBxDFFGPq3%2Fscreely-1685032992008.png?alt=media&#x26;token=cbcee4a9-dbef-4433-b5fa-f587fbb60edc" alt=""><figcaption></figcaption></figure>

The timer configuration modal provides a configuration wizard for the modes **interval**, **fixed** and **advanced**.

#### Interval Mode

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 Mode

Fixed timers will run every day at the selected time, starting from the day after the selected start date.

#### Advanced Mode

The advanced mode provides an input field for directly specifying a quartz cron-expression in UTC. Refer to this [cron expression generator](https://www.freeformatter.com/cron-expression-generator-quartz.html) for creating a customized rule schedule.

### Output Templating

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.&#x20;

See the [Payload Templating](https://docs.akenza.io/akenza.io/reference/message-templating#data-source-properties) page for more details and all available properties.
