mirror of https://github.com/arendst/Tasmota.git
Updated Rules IF ELSE ELSEIF and AND OR Support (markdown)
parent
a9eeece9fe
commit
25a962d1a3
|
@ -37,11 +37,22 @@ IF statement supports 3 formats:
|
|||
|
||||
`<condition>` is a logical expression, for example:
|
||||
- `VAR1>=10`
|
||||
- Multiple comparison expression with logical operator `AND` or `OR` between them. `AND` has higher priority than `OR`. For example:
|
||||
- Multiple comparison expressions with logical operator `AND` or `OR` between them. `AND` has higher priority than `OR`. For example:
|
||||
`UPTIME>100 AND MEM1==1 OR MEM2==1`
|
||||
Parenthesis can be used to change the priority of logical expression. For example:
|
||||
`UPTIME>100 AND (MEM1==1 OR MEM2==1)`
|
||||
- Following variables can be used in `<condition>`: `VARx` `MEMx` `TIME` `UPTIME` `UTCTIME` `LOCALTIME` `SUNRISE` `SUNSET`
|
||||
- The following variables can be used in `<condition>`:
|
||||
|
||||
Symbol|Description
|
||||
-|-
|
||||
VAR\<x>|variable (\<x> = `1..MAX_RULE_VARS`, e.g., `VAR2`)
|
||||
MEM\<x>|persistent variable (\<x> = `1..MAX_RULE_MEMS`, e.g., `MEM3`)
|
||||
TIME|minutes past midnight
|
||||
UPTIME|uptime minutes
|
||||
UTCTIME|UTC time, UNIX timestamp, seconds since 01/01/1970
|
||||
LOCALTIME|local time, UNIX timestamp
|
||||
SUNRISE|current sunrise time (minutes past midnight)
|
||||
SUNSET|current sunset time (minutes past midnight)
|
||||
|
||||
`<statement-list>`
|
||||
- A Sonoff-Tasmota command (e.g.,`LedPower on`)
|
||||
|
|
Loading…
Reference in New Issue