Updated Rules IF ELSE ELSEIF and AND OR Support (markdown)

Michael Ingraham 2019-10-14 09:27:49 -04:00
parent a9eeece9fe
commit 25a962d1a3
1 changed files with 13 additions and 2 deletions

@ -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`)