From 40e9b37957c800b6426ad010c00cf6e99c351452 Mon Sep 17 00:00:00 2001 From: Michael Ingraham <34340210+meingraham@users.noreply.github.com> Date: Sun, 16 Jun 2019 08:23:54 -0400 Subject: [PATCH] Updated Rules (markdown) --- Rules.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Rules.md b/Rules.md index 7b9410fe..b635a76c 100644 --- a/Rules.md +++ b/Rules.md @@ -135,6 +135,19 @@ To accomplish a rule with one trigger but several commands, you need to use `Bac ```on [trigger] do backlog [command1]; [command2]; [command3] endon``` + +**Appending a rule onto an existing rule set** + +Use the `+` character to append a new rule to the rule set. For example: + +    Existing Rule1: `on Rules#Timer=1 do Mem2 %time% endon` + +    Rule to append: `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` + ### Rule Variables 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. @@ -175,21 +188,8 @@ 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:*. - -**Appending a rule onto an existing rule set** - -Use the `+` character to append a new rule to the rule set. For example: - -    Existing Rule1: `on Rules#Timer=1 do Mem2 %time% endon` - -    Rule to append: `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` - -     -     +  +  **For examples of various rules see the [Rule Cookbook](Rule-Cookbook).**