mirror of https://github.com/arendst/Tasmota.git
Updated Rules (markdown)
parent
74bf0b4c5a
commit
ffed5904d9
22
Rules.md
22
Rules.md
|
@ -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.
|
||||
|
||||
Example of a define rule set command:
|
||||
Example of defining rule set:
|
||||
```
|
||||
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
|
||||
|
||||
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.
|
||||
|
||||
|
@ -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:*.
|
||||
|
||||
|
||||
**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`
|
||||
Existing Rule1: `on Rules#Timer=1 do Mem2 %time% endon`
|
||||
|
||||
To Concatenate: `on button1#state do POWER TOGGLE endon`,
|
||||
Rule to append: `on button1#state do POWER TOGGLE endon`
|
||||
|
||||
`Rule1 + on button1#state do POWER TOGGLE endon`
|
||||
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`
|
||||
Resulting Rule1: `on Rules#Timer=1 do Mem2 %time% endon on button1#state do POWER TOGGLE endon`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
**For examples of various rules use [Rule Cookbook](Rule-Cookbook).**
|
||||
**For examples of various rules see the [Rule Cookbook](Rule-Cookbook).**
|
||||
|
||||
[Back To Top](#top)
|
Loading…
Reference in New Issue