mirror of https://github.com/arendst/Tasmota.git
Updated Rules (markdown)
parent
132103905a
commit
2f653b1ac8
11
Rules.md
11
Rules.md
|
@ -248,4 +248,13 @@ mqtt: ``cmnd/[topic]/event anyname=number``
|
|||
|
||||
Everything together:
|
||||
|
||||
``rule on event#togglevar1 do event toggling1=%var1% endon on event#toggling1<1 do event setvar1=1 endon on event#toggling1>0 do event setvar1=0 endon on event#setvar1 do var1 %value% endon on event#getvar1 do var1 endon on event#message do publish stat/sonoff/log %value% endon``
|
||||
``rule on event#togglevar1 do event toggling1=%var1% endon on event#toggling1<1 do event setvar1=1 endon on event#toggling1>0 do event setvar1=0 endon on event#setvar1 do var1 %value% endon on event#getvar1 do var1 endon on event#message do publish stat/sonoff/log %value% endon``
|
||||
|
||||
|
||||
**NOTE**
|
||||
|
||||
Note that the following won't work:
|
||||
|
||||
``rule on event#setvar1 do backlog var1 %value%; power1 %var1% endon``
|
||||
|
||||
Well at least not as you probably would expect. The var1 value used by the power1 command will be the value present before the backlog command is executed. This is so, because the rule will replace %var1% BEFORE the backlog commands are put in the backlog-log.
|
Loading…
Reference in New Issue