Skip to content

Time Description Language

Matt Cochrane edited this page Apr 29, 2017 · 5 revisions

Timer Description Language or TDL is a simple language for describing schedules that can be run by an Open Source Timer.

Starting with a simple example

Below is a very simple example to get you used to the syntax of Timer Description Language.

A: enable channel 1 for 30 minute every 2 hours

Rule Output:

enable channel 1 for 30 minutes every 2 hours

Notice that this simple rule is made up of a number of parts

[rule name]: [action] [condition]

There are different recipes that can be followed in TDL but each of them follows this basic syntax of rule name, action, condition.

Rule Names

Rule names can contain only underscores, capital and lower case letters and numbers and must start with a letter.

  1. If the rule starts with a capital letter eg. MyRule then it will be enabled on startup.
  2. If the rule starts with a lower case letter eg. myRule then it will be disabled on startup.

Actions

Here is two example actions:

enable channel 1
disable rule myRule

Each action follows the format

[enable/disable] [target]

The first word must be either enable or disable. This word determines what the target will do when the rule is 'on'. For example, if we have the rule:

A: enable channel 1 for 30 minutes every 2 hours

The channel turns on for 30 minutes every 2 hours. For the remainder of the two hours the channel will be off. The chart below shows this.

enable channel 1 for 30 minutes every 2 hours

On the other hand if the rule were:

A_bar: disable channel 1 for 30 minutes every 2 hours

The channel turns off for 30 minutes every 2 hours. For the remainder of the two hours, the channel will then be on. Here's the chart.

enable channel 1 for 30 minutes every 2 hours

Conditions

Clone this wiki locally