Add once example

Theo Arends 2018-04-26 17:56:47 +02:00
parent 9a211a08fe
commit bfe719077d
1 changed files with 4 additions and 4 deletions

@ -117,18 +117,18 @@ Hardware
Software Software
- Sonoff-Tasmota v5.12.0l or up with define USE_RULES enabled - Sonoff-Tasmota v5.12.0l or up with define USE_RULES enabled
- Configure timer3 for rule execution when activated: ``timer3 {"Arm":1,"Mode":0,"Time":"16:00","Days":"1111111","Repeat":1,"Output":1,"Action":3}`` - Configure timer5 for rule execution when activated: ``timer5 {"Arm":1,"Mode":0,"Time":"16:00","Days":"1111111","Repeat":1,"Action":3}``
Rule Rule
- ``on clock#timer=3 do backlog power2 on;power1 off;power3 2 endon`` - ``on clock#timer=5 do backlog power2 on;power1 off;power3 2 endon``
Result Result
- When the timer expires the rule kicks in and set Power1 to OFF, Power2 to ON and Toggles Power3 - When the timer expires the rule kicks in and set Power1 to OFF, Power2 to ON and Toggles Power3
If you want to have blink functionality define a rule like ``on clock#timer=3 do power 3 endon`` If you want to have blink functionality define a rule like ``on clock#timer=5 do power 3 endon``
#### 4. Usage of one-shot (once) #### 4. Usage of one-shot (once)
The once option (``rule 4/5/6``) provides the possibility to trigger on a slow change while the change is still within the bounds of the test. The rule command once option provides the possibility to trigger only once on a slow change while the change is still within the bounds of the test.
Rule Rule
- ``on ENERGY#Current>0.100 do publish tool/tablesaw/power 1 endon on ENERGY#Current<0.100 do publish tool/tablesaw/power 0 endon`` - ``on ENERGY#Current>0.100 do publish tool/tablesaw/power 1 endon on ENERGY#Current<0.100 do publish tool/tablesaw/power 0 endon``