From 3e0a82d309c2ea12915617e04ef86d20be1e38cd Mon Sep 17 00:00:00 2001 From: Michael Ingraham <34340210+meingraham@users.noreply.github.com> Date: Tue, 8 Oct 2019 14:54:29 -0400 Subject: [PATCH] Updated Rules (markdown) --- Rules.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Rules.md b/Rules.md index 1ec8b33e..60740b44 100644 --- a/Rules.md +++ b/Rules.md @@ -10,16 +10,15 @@ Tasmota provides a Rule feature heavily inspired by the _ESPEasy_ implementation ## Introduction Rules perform actions based on triggers (e.g., switch state change, temperature threshold, events like system boot, a defined timer elapsing, custom defined events, etc.) They are stored in flash and therefore will survive a reboot. ->Most pre-compiled binaries ([builds](Builds)) have the Rules feature enabled. The exception being `sonoff-minimal.bin` and `sonoff-classic.bin`. *If you are compiling your own firmware, in order to use rules, include `#define USE_RULES` in `user_config_override.h`.* +> Most pre-compiled binaries ([builds](Builds)) have the Rules feature enabled. The exception being `sonoff-minimal.bin` and `sonoff-classic.bin`. *If you are compiling your own firmware, in order to use rules, include `#define USE_RULES` in `user_config_override.h`.* ## Rule Syntax - **Nested rules are not supported.** -["IF/ELSE/ELSEIF" and "AND/OR" support](https://github.com/arendst/Sonoff-Tasmota/wiki/Rules---IF-ELSE-ELSEIF-and-AND-OR-Support) **6.6.0.11** - -Every rule needs to follow this syntax: +- Optional ["IF/ELSE/ELSEIF" and "AND/OR"](Rules---IF-ELSE-ELSEIF-and-AND-OR-Support) support **6.6.0.11** +- Optional [use of expressions](Expressions-in-Rules) support **6.4.1.14** +Rule definition statement: `ON DO [ENDON | BREAK]` - **`ON`** - marks the beginning of a rule definition - **``** - what condition needs to occur for the rule to execute @@ -39,7 +38,6 @@ Rules inside a rule set `Rule` are concatenated and entered as a single state Spaces after `ON`, around `DO`, and before `ENDON` or `BREAK` are mandatory. A rule is **not** case sensitive. ### Rule Trigger - A rule trigger can consist of: - `[TriggerName]#[ValueName]` - `[TriggerName]#[ValueName][comparison][value]` @@ -122,7 +120,6 @@ Trigger | When it occurs | [Back To Top](#top) ### Rule Command - A rule command can be any command listed in the [Commands list](Commands). The command's `` can be replaced with `%value%` which will use the value of the trigger. `ON Switch1#State DO Power %value% ENDON` @@ -143,9 +140,9 @@ Use the `+` character to append a new rule to the rule set. For example: ### Rule Variables -There are ten available variables (double precision reals) in Tasmota, `Var1..Var5` and `Mem1..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. +There are ten available variables (double precision reals) in Tasmota, `Var1..Var5` and `Mem1..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. -The value of a `Var` and `Mem` can be: +The value of a `Var` and `Mem` can be: - any number - any text - %var1% to %var5%