The Timers tab is used to define time-based rules (hereafter referred to as timers) to be carried out by the Base module at a specified time. For each rule, you can specify an exact date and time of execution, additional conditions, and a list of actions to be carried out every time the timer is triggered.
Thanks to timers, it’s possible to automate repetitive tasks, which means you no longer need to remember to do them.
The Timers tab has the same layout as the Events tab. You’ll find a list of rules – Structure; a form with the timer’s parameters – Details; and an interface for defining actions – Actions.
We’ll cover the Details window, since it differs from the one in the Events tab; the description of the other elements is identical to the one presented for the Events tab.
1. Details #
The Details section is used to define the attributes of timers and groups.
Groups have three attributes:
- Active – Uncheck to deactivate the group. Inactive elements are displayed in the structure tree with a struck-through label. This field is checked by default.
- Description – A short description of the group, displayed in the Structure.
- Condition: A condition added to a group of timers forms a logical AND with the conditions of the individual timers. So, if the group’s condition isn’t met, no timer assigned to the group will be triggered.
Each timer, on the other hand, has a set of nine attributes.
- Active – Uncheck to deactivate the timer. Inactive elements are displayed in the structure tree with a struck-through label. This field is checked by default.
- Description – A short description of the timer, displayed in the Structure.
- Month – A month in the range from 1 to 12. If this field is left blank and the Day field is filled in, the timer will be triggered every month of the year, on the selected day.
- Day – The day of the month, in the range from 1 to 31. If this field is left blank, the timer will be triggered every day.
- Hour – An hour in the range from 0 to 23. Don’t enter values with a leading zero here, e.g. 06, 02, etc.
- Minute – A minute in the range from 0 to 59. If the Minute field is filled in but the Hour field is left blank, the timer will be triggered every hour, at the selected minute. If, on the other hand, the Minute field is left blank and the Hour field is filled in, the timer will be executed every minute throughout the specified hour.
Don’t enter values with a leading zero here, e.g. 06, 02, etc. - Second – A second in the range from 0 to 59. If the Second field is filled in, but the Hour and Minute fields
are left blank, the timer will be triggered every minute, at the selected second.
Note! If several values are entered, they must differ by at least 2, e.g. 34, 36, 38, etc. If you want an event to be triggered every minute, on the exact minute, enter 0 in the Second field. Don’t enter values with a leading zero here, e.g. 06, 02, etc. - Day of the week – A day of the week in the range from 1 to 7, where 1 corresponds to Sunday, 2 to Monday, and so on. Leave this field blank if you want the timer to be triggered on every day of the week. Using this field, you can easily create, for example, separate rules for weekdays and weekends.
- Condition – An additional condition that must be met for the timer to be triggered. The same rules apply here as for Events.
More than one value can be entered in each of the fields above, using a comma as the separator (except for the Condition field) between successive values. If the fields are related to each other, combinations are created from the fields’ contents. Study the examples below:
- The Hour field contains 16,20, and the Minute field contains 15,45. In this case, the timer will be triggered at 16:15, 16:45, 20:15, and 20:45.
- The Day field contains 1,2,3,4,5,6,7, and the Day of the week field contains 2,3,4,5,6. In this case, the timer will be triggered on weekdays, in the first week of the month.
- The Day field contains 1, the Hour field contains 6, and the Minute field contains 0. The timer will then be executed on the first day of every month, at 6:00.
2. Astronomical Clock #
The Base module lets you run timers based on sunrise and sunset times (the astronomical clock). This way, you can create rules such as turning on the lights after dark, without involving any additional sensors.
For the astronomical clock to work, the data in the Location section of the Settings tab must be filled in.
To define a timer using the astronomical clock, use one of the following keywords:
- sunset – Enter this value in the Hour field to have the timer executed at the exact hour and minute of sunset.
- sunrise – Enter this value in the Hour field to have the timer executed at the exact hour and minute of sunrise.
It’s also possible to run timers offset in time relative to sunrise and sunset. To do this, enter the offset in the Minute field. The offset can be positive or negative. It’s also possible to use several offset values within the same timer definition. In that case, their values should be entered in the Minute field, separated by commas.
- The Hour field contains sunrise, and the Minute field contains 30 — the timer will be executed 30 minutes after sunrise.
- Similarly, if the Hour field contains sunrise, and the Minute field contains -30, the timer will be executed 30 minutes before sunrise.
- The same rules apply for the sunset expression.
- If several values, e.g. 15,30,45, are entered in the Minute field, the timer will be triggered three times, once for each offset.
3. Timers Triggered by Commands
#
Besides timers set up based on definitions in the Timers tab, it’s also possible to create timers using commands. This is a more dynamic way of creating timers, which can be the result of, for example, pressing a button, an event being triggered, or an action triggered by another timer.
The Base module has two types of commands for creating timers dynamically: a timer with a reference, and a timer without a reference.
3.1. TIMER (timer with a reference) #
The TIMER command is used to dynamically create a timer that will carry out a specific action after a specified time. This type of command requires giving the timer a name that is unique across the entire system – which is why it’s called a timer with a reference, since the name serves as a reference to the timer, letting it be canceled.
Every time the TIMER command is called with the same name, the previous instance of the timer is deleted and a new one is created, restarting the countdown from the beginning. It’s also possible to cancel a timer by calling it again with a time equal to 0.
An example use case for the TIMER command is implementing staircase lighting, automatically arming the alarm, etc.
The command’s syntax is as follows:
TIMER.nazwa.opóźnienie.komenda=dane, where
nazwa – The timer’s name (no Polish diacritical characters or spaces), which is unique among other TIMER-type commands.
opóźnienie – The time after which the action assigned to this timer will be executed. The delay can be expressed in hours, minutes, seconds, and milliseconds. The abbreviations, respectively: h, m, s, ms.
The delay can also be dynamically read from the current value of any identifier in the DOMIQ system. This makes it possible to use a single definition to trigger timers with different delays. The delay’s length changes based on the value of the specified variable. Command syntax: TIMER.<nazwa>.{nazwa_identyfikatora}<jednostka>.<komenda>=<wartość>;
komenda – The action that will be executed once the countdown ends.
wartość – The value the identifier the command is sent to should take. For events, this is the value with which the event will be broadcast.
Study the following examples:
- Turning off lighting after a specified time.
A classic example of this kind of scenario is controlling lighting triggered by a motion sensor, which is to be turned off automatically when no motion is detected. Turning on the lighting and calling theTIMERcommand is the result of an event being executed, so that will also be presented in this example. Let’s assume the motion sensor is connected to input No. 1 on the Satel INT-IORS module at address 1, controlled via the DOMIQ/Expander module. The lighting, meanwhile, is controlled by relay No. 3 on the same module.
Channel: E.EXP.input.1.1
Data: 1
Next, add two commands using the + Command option:
Command 1 – turning on the lighting
Name: C.EXP.output.1.3
Value: 1
Command 2 – starting a timer to turn off the light after 2 minutes.
Name: TIMER.czujka_korytarz.2m.C.EXP.output.1.3
Value: 0
Command No. 2 should be understood as follows: create a timer named czujka_korytarz, which will, after 2 minutes, call the command C.EXP.output.1.3 with the value 0. - Automatically arming the alarm.
This is an example of an event that, if no motion is detected by any of the sensors for a specified time, arms the zones on the Satel control panel. This kind of event can serve as a safeguard in case you forget to arm the alarm when leaving the house.
Channel: E.IDS.input.(%d+)
Data: 1 Command: Name:: TIMER.autoalarm.2h.C.ALARMON Value: 1 The event will catch every motion sensor trigger and, as a result, create a timer named autoalarm, which, after 2 hours have passed, will execute the command C.ALARMON with the value 1.
A separate event needs to be created for the C.ALARMON command, which will, in turn, execute the commands to arm the individual alarm zones.
Channel: C.ALARMON
Data: 1
Then add commands using the + Command option, in a number matching the number of zones to be armed. Below is an example of a single command:
Name: C.IDS.armed.1
Data: 1;pin:12345 - Let’s assume the light in a child’s room is to be turned on (30% brightness) for 30 minutes, after which it should turn off automatically. The light is controlled by dimmable output No. 2 in the LCN module at address 50. The entire procedure is to be initiated in the Remote app. To do this, a Button control will be used. Its definition is as follows:
Two commands need to be added in the Short tab.
Command 1:
Click + LCN
Module: 50
Output: 2
Value: 30
Command 2:
Click + Command:
Name: TIMER.pokoj_dzieciecy.30m.C.LCN.output.0.50.2
Value: 0 - Canceling a timer.
This example shows how to cancel a timer using a command. The command can be the result of an event being executed, another timer, a button press in the Remote app, a control on the visualization, etc. For the purposes of this example, let’s assume it’s the result of an event being executed. In that case, add the following command (+ Command):
Name: TIMER.alarm1.0
Value: 0
As a result of this command, the timer namedalarm1will be canceled. - A timer with a dynamically determined delay
For the purposes of this example, let’s assume it’s the result of an event being executed. In that case, add the following command (+ Command):
Name: TIMER.test.{VAR.test}s.C.LCN.output.0.10.1
Value: 100
This example should be read as follows: trigger a timer named test with a delay equal to the value of the variable VAR.test.VAR.test. Once the delay has elapsed, turn output No. 1 in the LCN module at address 10 on to 100%. Identifier names can be used inDELAYcommands in an analogous way
3.2. DELAY (timer without a reference) #
The DELAY command is also used to dynamically create a timer that will carry out a specific action after a specified time. However, unlike the TIMER command, it doesn’t let you cancel a running countdown. Every call of the DELAY command creates a new instance of the timer, which will, once the specified time has elapsed, carry out the assigned action.
DELAY.opóźnienie.komenda=dane, where
opóźnienie – The time after which the action assigned to this timer will be executed. The delay can be expressed in hours, minutes, seconds, and milliseconds. The abbreviations, respectively: h, m, s, ms.
The delay can also be dynamically read from the current value of any identifier in the DOMIQ system. This makes it possible to use a single definition to trigger timers with different delays.
The delay’s length changes based on the value of the specified variable. Command syntax: DELAY.{nazwa_identyfikatora}<jednostka>.<komenda>=<wartość>;
komenda – The action that will be executed once the countdown ends.
wartość – The value the identifier the command is sent to should take. For events, this is the value with which the event will be broadcast.
4. Advanced Topics
#
4.1. Identifier Binding for Timers #
Identifier binding is also available for timers. It lets you reference, within a timer’s definition, the current value of any identifier. When you use this notation, the Base module will automatically retrieve the current value of the specified identifier at the moment the given rule is triggered.
You can use identifier binding in the + Command window in exactly the same way as shown for events.
Using identifier binding in the fields of the Details form lets you create more interactive timers. An example of this could be rules whose trigger time depends on options selected by the user in the Remote app. Identifier binding can be used in all fields of the Details form except the Description field, and curly braces are not required here.
- Raising blinds at a time chosen by the user
Let’s assume a scenario where the building’s blinds are to be raised at a specific time, which the system’s user sets themselves in the Remote app.
To do this, create a Time control in the Remote tab. The settings should be resistant to module restarts, so in the Channel for hours and Channel for minutes fields, enter the names of identifiers that are MEM-type variables. In our example: MEM.roletyH and MEM.roletyM.
We can then use these identifiers in the timer’s definition:
Hour: MEM.roletyH
Minute: MEM.roletyM
In the Actions section, define the commands for controlling the blinds. - Triggering the timer on days of the week chosen by the user
This is an extension of example No. 1. Additionally, let’s assume the user wants to have control over which days of the week the rule should be executed on.
To do this, define a Selection control in the Remote tab, following the example presented in that control’s description. In the Channel field, enter the name of an identifier that is a MEM variable, since we also want the settings to be stored in non-volatile memory. In our example:
MEM.roletyDni
In the timer’s definition presented in example 1, additionally fill in the
Day of the week field, entering MEM.roletyDni. - Conditionally executing a garden watering timer.
Let’s assume a timer is to periodically start the garden watering system at 4:00 and at 20:00, every day of the week. However, it should also depend on a rain sensor and be manually deactivatable by the user from the Remote app. Let’s assume the rain sensor is available as the identifier:MODBUS.int.sensor.rain
Manual deactivation
In the Remote tab, add a Switch. For the settings to be resistant to device restarts, enter an identifier pointing to a MEM variable, e.g. MEM.autopodlewanie. Depending on its state, the switch will assign the variable the value on or off.
Then define the timer:
Hour: 4, 20
Minute: 0
Day of the week: Leave this field blank, so the timer runs every day.
Condition: MEM.autopodlewanie==’on’ and MODBUS.int.sensor.rain == 0
In the Actions section, define the commands that start the watering.
4.2. Arithmetic #
The Base module lets you perform arithmetic operations on identifier values. The following operations are available: addition, subtraction, multiplication, division, exponentiation (^), and modulo division (%). Arithmetic is available in the Condition field, and in the Value field in the + Command window.
- Automatically turning on the heating on the condition that the measured temperature is lower than the target value by a specified amount.
For the purposes of this example, let’s assume: the target temperature is stored in a MEM variable namedMEM.temp.salon. The measured temperature, meanwhile, is available in the identifierMODBUS.int.sensor.temp. The heating is to be turned on at a specific time, but only when the difference between the room’s temperature and the target is at a specific level (1.5°C or greater).
If the condition is met, the relay controlling the heating loop’s valve will be turned on. The relay is connected to a Satel INT-IORS block, controlled by the DOMIQ/Expander module. The block has address 1, and the relay is No. 3.
Hour: 5
Minute: 0 Condition: MODBUS.int.sensor.temp – 1,5 <= MEM.temp.salon Important! This is simultaneously an example of identifier binding and arithmetic operations in the Condition field.
In the Actions section -> + Command > Name: C.EXP.output.1.3
Value: 1 1
The use of arithmetic in the + Command window was presented earlier, in the description of events.
4.3. Implementation Example #
Finally, we’ll present a complete example of using a timer that’s managed from the Remote app.
Setting the timer’s hour and days from the DOMIQ/Remote app.
User interface (Remote tab):
- Add a Time-type element.
- Double-click it and fill in the properties:
- In the Description field, enter the control’s description.
- In the Channel for hours cell, enter MEM.godzina.
- In the Channel for minutes field, enter MEM.minuta.
- The names used here are arbitrary, and you can use different ones.
- Add a Selection-type element.
- Double-click it and fill in the properties:
- In the Description field, enter a description, e.g. “Days of the week.”
- In the Channel cell, enter the name of the variable that will store the days of the week on which the event is to be triggered, e.g. MEM.dni.
- Checking the Multiple selection checkbox gives the user the ability to select the options on which the event should be triggered.
- Once the At least one checkbox is checked, it will not be possible to deselect all the days of the week in the app’s menu. The user will have to select at least one option for when the timer should be triggered.
- Double-click it and fill in its properties:
Timer definition:
- Add a new timer and fill in its properties:
- In the Description cell, enter its description, depending on the timer’s purpose.
- Fill in the attributes in the Details section – here we reference the names of the MEM variables that were declared in the Remote interface.
- In the Hour field, enter: MEM.godzina
- In the Minute field, enter: MEM.minuta
- In the Day of the week field, enter: MEM.dni
- In the Actions section, define the actions to be carried out when the timer is triggered.
- Save the Timers tab to confirm the settings.