Updated Rules (markdown)

Michael Ingraham 2019-06-16 08:22:28 -04:00
parent 74bf0b4c5a
commit ffed5904d9
1 changed files with 11 additions and 11 deletions

@ -43,7 +43,7 @@ Rules inside a rule set can be concatenated and have to be in one line:
Spaces after `on`, around `do` and before `endon` or `break` are mandatory. A rule is **not** case sensitive. Spaces after `on`, around `do` and before `endon` or `break` are mandatory. A rule is **not** case sensitive.
Example of a define rule set command: Example of defining rule set:
``` ```
Rule1 on <trigger1> do <command> break on <trigger2> do <command> endon Rule1 on <trigger1> do <command> break on <trigger2> do <command> endon
``` ```
@ -137,7 +137,7 @@ To accomplish a rule with one trigger but several commands, you need to use `Bac
### Rule Variables ### Rule Variables
There are 10 available variables in Tasmota, `Var1` through `Var5` and `Mem1` through `Mem5`. All `Var` will be empty strings when the program starts. The value of all `Mem` persists after a reboot. There are 10 available variables (double precision reals) in Tasmota, `Var1` through `Var5` and `Mem1` through `Mem5`. All `Var` will be empty strings when the program starts. The value of all `Mem` persists after a reboot.
They provide a means to store the trigger `%value%` to be used in any rule. They provide a means to store the trigger `%value%` to be used in any rule.
@ -176,21 +176,21 @@ Sets Mem2 to the current time (minutes elapsed since midnight)
After a Wi-Fi reconnect event publish to stat/topic/BLACKOUT a payload containing timestamps of when the Wi-Fi disconnected in *From:* and when the Wi-Fi connected in *To:*. After a Wi-Fi reconnect event publish to stat/topic/BLACKOUT a payload containing timestamps of when the Wi-Fi disconnected in *From:* and when the Wi-Fi connected in *To:*.
**Concatenating a rule on existing rule** **Appending a rule onto an existing rule set**
Use of wildcard `+` Use the `+` character to append a new rule to the rule set. For example:
Existing Rule1: `on Rules#Timer=1 do Mem2 %time% endon` &nbsp;&nbsp;&nbsp;&nbsp;Existing Rule1: `on Rules#Timer=1 do Mem2 %time% endon`
To Concatenate: `on button1#state do POWER TOGGLE endon`, &nbsp;&nbsp;&nbsp;&nbsp;Rule to append: `on button1#state do POWER TOGGLE endon`
`Rule1 + on button1#state do POWER TOGGLE endon` &nbsp;&nbsp;&nbsp;&nbsp;Command: `Rule1 + on button1#state do POWER TOGGLE endon`
Resulting Rule1: `on Rules#Timer=1 do Mem2 %time% endon on button1#state do POWER TOGGLE endon` &nbsp;&nbsp;&nbsp;&nbsp;Resulting Rule1: `on Rules#Timer=1 do Mem2 %time% endon on button1#state do POWER TOGGLE endon`
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;
**For examples of various rules see the [Rule Cookbook](Rule-Cookbook).**
**For examples of various rules use [Rule Cookbook](Rule-Cookbook).**
[Back To Top](#top) [Back To Top](#top)