Witam
Mam problem z automatyką lokalną ‘Rule’ na Esp8266 z Tasmota 13.1.0
Moje rule
Backlog
Rule1
ON Switch2#state=1 do publish stat/%topic%/PIR2 ON endon on Switch2#state=0 do Publish stat/%topic%/PIR2 OFF endon; rule1 1; SwitchTopic 0; SwitchMode2 2; mem1=90; mem2=10; mem3=300; mem16=1; Restart 1
Rule2
ON System#Boot do backlog POWER1 ON; Channel1 50; POWER2 ON; Channel2 50; POWER3 ON; Channel3 50; var1=mem1; var2=mem2; var3=mem3; var15=0.5*var1; var16=mem16 ENDON
ON Switch2#state=1 DO Backlog POWER1 ON; Channel1 %var1%*%var16%; POWER2 ON; Channel2 %var1%*%var16%; POWER3 ON; Channel3 %var1%*%var16%; RuleTimer1 %var3%; RuleTimer2 %var3%+60; RuleTimer3 %var3%+180 ENDON ON Rules#Timer=1 DO Backlog Channel1 %var15%*%var16%; Channel2 %var15%*%var16%; Channel3 %var15%*%var16% ENDON ON Rules#Timer=2 DO Backlog Channel1 %var2%*%var16%; Channel2 %var2%*%var16%; Channel3 %var2%*%var16% ENDON ON Rules#Timer=3 DO Backlog Channel1 0; Channel2 0; Channel3 0 ENDON
backlog Rule2 1; Restart 1
Backlog rule3 on MQTT#connected do publish2 homeassistant/binary_sensor/%macaddr%_motion/config {"name":"PIR2","state_topic":"stat/%topic%/PIR2","device_class":"motion","force_update":true,"off_delay":5,"availability_topic":"tele/%topic%/LWT","payload_available":"Online","payload_not_available":"Offline","unique_id":"%macaddr%_motion2","device":{"connections":[["mac","%macaddr%"]]}} endon; Rule3 1; Restart 1
Automatyka działa prawidłowo bez wpisanych ustawień MQTT, jak również przy skonfigurowanym MQTT i połączonym do serwera.
Problem się pojawia gdy utraci MQTT połączenie z serwerem, automatyka przestaje działać, po restarcie esp też automatyka leży.
Po restarcie przy braku połączenia MQTT z serwerem (zmieniłem IP w konfiguracji)
00:00:00.001 HDW: ESP8266EX
00:00:00.050 CFG: Wczytano z pamięci flash w F5, Licz 223
00:00:00.055 QPC: Count 1
00:00:00.161 Projekt tasmota - 222 Wersja 13.1.0(TasmoCompiler-esp8266generic)-2_7_4_9(2023-08-24T06:56:23)
00:00:00.163 I2C: BH1750 found at 0x23
00:00:00.778 WIF: Łączenie z AP1 EL1_cont_light Channel 4 BSSId 00:1D:0F:F3:90:0D w trybie 11n jak 222...
00:00:02.752 WIF: Połączony
00:00:03.009 HTP: Aktywny serwer Web 222 z adresem IP 192.168.1.222
06:55:29.003 MQT: Próba połączenia...
06:55:29.220 MQT: Nie udało się nawiązać połączenia 192.168.1.201:1883, rc -2. Spróbuj ponownie 10 sec
06:55:32.184 QPC: Reset
06:56:28.157 RSL: STATE = {"Time":"2023-10-17T06:56:28","Uptime":"0T00:01:04","UptimeSec":64,"Vcc":2.293,"Heap":28,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":0,"POWER1":"ON","Channel1":90,"POWER2":"ON","Channel2":90,"POWER3":"ON","Channel3":90,"Color":"E5E5E5","Wifi":{"AP":1,"SSId":"EL1_cont_light","BSSId":"00:1D:0F:F3:90:0D","Channel":4,"Mode":"11n","RSSI":100,"Signal":-48,"LinkCount":1,"Downtime":"0T00:00:03"}}
06:56:28.193 RSL: SENSOR = {"Time":"2023-10-17T06:56:28","Switch2":"OFF","BH1750":{"Illuminance":427}}
06:56:32.007 MQT: Próba połączenia...
po symulacji ruchu
06:57:37.191 RUL: SWITCH2#STATE=1 performs "publish stat/tasmota_F76FBF/PIR2 ON"
06:57:37.194 RSL: PIR2 = ON
06:57:37.220 RUL: SWITCH2#STATE=1 performs "Backlog POWER1 ON; Channel1 *; POWER2 ON; Channel2 *; POWER3 ON; Channel3 *; RuleTimer1 ; RuleTimer2 +60; RuleTimer3 +180"
06:57:37.239 RSL: RESULT = {"POWER1":"ON"}
06:57:37.241 RSL: POWER1 = ON
06:57:37.441 RSL: RESULT = {"Channel1":90}
06:57:37.642 RSL: RESULT = {"POWER2":"ON"}
06:57:37.644 RSL: POWER2 = ON
06:57:37.847 RSL: RESULT = {"Channel2":90}
06:57:38.050 RSL: RESULT = {"POWER3":"ON"}
06:57:38.052 RSL: POWER3 = ON
06:57:38.146 RUL: SWITCH2#STATE=0 performs "Publish stat/tasmota_F76FBF/PIR2 OFF"
06:57:38.150 RSL: PIR2 = OFF
06:57:38.357 RSL: RESULT = {"Channel3":90}
06:57:38.562 RSL: RESULT = {"T1":0,"T2":0,"T3":0,"T4":0,"T5":0,"T6":0,"T7":0,"T8":0}
06:57:38.768 RSL: RESULT = {"T1":0,"T2":0,"T3":0,"T4":0,"T5":0,"T6":0,"T7":0,"T8":0}
06:57:38.977 RSL: RESULT = {"T1":0,"T2":0,"T3":0,"T4":0,"T5":0,"T6":0,"T7":0,"T8":0}
Proszę o pomoc w rozwiązaniu problemu.
Pozdrawiam