Added the intermittent timer example 26

John 2019-05-12 19:42:07 +12:00
parent 2123640a02
commit 3388fe857a
1 changed files with 24 additions and 2 deletions

@ -27,7 +27,7 @@
25. [Arithmetic Commands to be used with VARs](#25-arithmetic-commands-to-be-used-with-vars)
- [Sending the value of a sensor to MQTT only when a delta is reached](#sending-the-value-of-a-sensor-to-mqtt-only-when-a-delta-is-reached)
- [Adjust the value of a sensor and send it by MQTT](#adjust-the-value-of-a-sensor-and-send-it-by-mqtt)
26. [Timer-triggered Low frequency blink (intermittent timer)](#Timer-triggered-low-frequency-blink)
------------------------------------------------------------------------------
#### 1. Use long press action on a switch
@ -992,3 +992,25 @@ on event#sendtemp do publish stat/sonoff/temp %var1% endon
[Back To Top](#top)
------------------------------------------------------------------------------
Timer-triggered Low Frequency Blink
This example uses a rule timer to call itself to allow the power to be switched on and off within a set time period. The rule timer is triggered by Global timers - one to set it going, the other to turn it off.
To set the whole period of operation, set the ON timer1 through the web interface to trigger a rule. Set the OFF timer2 through the web interface to trigger a rule.
Write the following rules:
rule1 on Clock#Timer=1 do backlog power 1; ruletimer#1 10 endon
This rule is triggered by global timer 1 and switched the device on then sets the timeout at 10 seconds
rule2 on RuleTimer=1 do backlog power 2; rules#timer=1 10 endon
This rule is called on the ruletimer timeout and toggles the power then resets the timer for another 10 seconds
rule3 on Clock#Timer=2 do backlog power 0; ruletimer#1 0 endon
At the end of the desired period of operation, the clocktimer times out and runs rule3 which turns power off and sets the ruletimer to zero so it does not run. The device remains off.
These rules were used to run a heater intermittently to keep a room warm in the absence of a thermostat.
------------------------------------------------------------------------------