mirror of https://github.com/arendst/Tasmota.git
No longer Experimental
parent
147cf26d08
commit
7df624fcbc
|
@ -1,6 +1,3 @@
|
||||||
> :warning: :warning: :warning: EXPERIMENTAL :warning: :warning: :warning:
|
|
||||||
**This feature is still under development**
|
|
||||||
|
|
||||||
By default, Both EXPRESSION and IF support is disabled. In order to enable IF support, please add these lines in `user_config_override.h`:
|
By default, Both EXPRESSION and IF support is disabled. In order to enable IF support, please add these lines in `user_config_override.h`:
|
||||||
- `#define USE_EXPRESSION` // Add support for expression evaluation in rules (+3k2 code, +64 bytes mem)
|
- `#define USE_EXPRESSION` // Add support for expression evaluation in rules (+3k2 code, +64 bytes mem)
|
||||||
- `#define SUPPORT_IF_STATEMENT` // Add support for IF statement in rules (+4k2 code, -332 bytes mem)
|
- `#define SUPPORT_IF_STATEMENT` // Add support for IF statement in rules (+4k2 code, -332 bytes mem)
|
||||||
|
@ -39,17 +36,17 @@ IF statement supports 3 formats:
|
||||||
- `IF (<condition>) <statement-list> [ELSEIF (<condition>) <statement-list> ] ELSE <statement-list> ENDIF`
|
- `IF (<condition>) <statement-list> [ELSEIF (<condition>) <statement-list> ] ELSE <statement-list> ENDIF`
|
||||||
|
|
||||||
`<condition>` is a logical expression, for example:
|
`<condition>` is a logical expression, for example:
|
||||||
- `VAR1 >= 10`
|
- `VAR1>=10`
|
||||||
- Multiple comparison expression with logical operator `AND` or `OR` between them. `AND` has higher priority than `OR`. For example:
|
- Multiple comparison expression with logical operator `AND` or `OR` between them. `AND` has higher priority than `OR`. For example:
|
||||||
`UPTIME > 100 AND MEM1 == 1 OR MEM2 == 1`
|
`UPTIME>100 AND MEM1==1 OR MEM2==1`
|
||||||
Parenthesis can be used to change the priority of logical expression. For example:
|
Parenthesis can be used to change the priority of logical expression. For example:
|
||||||
`UPTIME > 100 AND (MEM1 == 1 OR MEM2 == 1)`
|
`UPTIME>100 AND (MEM1==1 OR MEM2==1)`
|
||||||
|
|
||||||
`<statement-list>`
|
`<statement-list>`
|
||||||
- A Sonoff-Tasmota command (e.g.,`LedPower on`)
|
- A Sonoff-Tasmota command (e.g.,`LedPower on`)
|
||||||
- Another IF statement (`IF ... ENDIF`)
|
- Another IF statement (`IF ... ENDIF`)
|
||||||
- Multiple Sonoff-Tasmota commands or IF statements separated by `;`. For example:
|
- Multiple Sonoff-Tasmota commands or IF statements separated by `;`. For example:
|
||||||
`Power1 off; LedPower on; IF (Mem1 == 0) Var1 Var1+1; Mem1 1 ENDIF; Delay 10; Power1 on`
|
`Power1 off; LedPower on; IF (Mem1==0) Var1 Var1+1; Mem1 1 ENDIF; Delay 10; Power1 on`
|
||||||
`Backlog` is implied and is not required (saves rule set buffer space).
|
`Backlog` is implied and is not required (saves rule set buffer space).
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
Loading…
Reference in New Issue