Команды Tasmota and Rules

/tasmota/include/tasmota.h

MAX_FRIENDLYNAMES = 8 


SetOption24 Set pressure units : 0 = hPa (default) 1 = mmHg
SetOption146 1 = enable display of ESP32 internal temperature

https://tasmota.github.io/docs/


Rule1
ON system#boot DO backlog var1 0;power0 off ENDON
ON power2#state=1 DO if (var1!=1) ruletimer1 0;var1 1 endif ENDON
ON event#MCPINT_D0=1 DO if (var1==1) var1 2;ruletimer1 10 endif ENDON
ON rules#timer=1 DO Backlog var1 0;power2 off ENDON

Если включить Power2 то включается режим ожидания MCPINT_D0, как только D0=1 то через 10 секунд Power2 выключиться.


Rule1
ON button1#state DO Backlog Power1 %value%; RuleTimer1 600 ENDON
ON Rules#Timer=1 DO Power1 off ENDON

RuleTimer1 600 ENDON
Additionally RuleTimer1 will begin to countdown 10 minutes

ON Rules#Timer=1 DO Power1 off ENDON
After the RuleTimer1 expires the light will be turned off (if you forgot to turn it off)

Выключит Power1 через 10 минут.


When SetOption114 1 all switches are detached from their respective relays and will send MQTT messages instead in the form of {“Switch”:{“Action”:””}}.

SwitchMode 1
Set switch to follow mode (0 = OFF, 1 = ON)

RULE
ON SWITCH1#STATE=1 DO POWER2 OFF ENDON
ON SWITCH1#STATE=0 DO POWER1 ON ENDON


Управление насосом в колодце.

BACKLOG SETOPTION114 1;SWITCHMODE 1

RULE
ON SYSTEM#BOOT DO POWER0 OFF ENDON
ON POWER1#STATE=1 DO POWER2 ON ENDON
ON POWER1#STATE=0 DO POWER2 OFF ENDON
ON POWER2#STATE=1 DO POWER1 ON ENDON
ON POWER2#STATE=0 DO POWER1 OFF ENDON
ON MQTT#DISCONNECTED DO POWER0 OFF ENDON
ON SWITCH1#STATE=1 DO POWER2 OFF ENDON
ON SWITCH1#STATE=0 DO POWER1 ON ENDON