silvrr:
I would check your settings in tasmota as to why they are turning on/off with broker disconnects. They should keep their states.
Also look into the retain settings. I have a number of tasmota devices that don’t flinch when the system comes down.
I’ve tried for ages to get this sorted. Still the same, as soon as HA reboots the switches power off
followed this and still the same
09:27:34 MQT: Attempting connection...
09:27:39 MQT: Connect failed to 192.168.0.102:1883, rc -2. Retry in 10 sec
09:27:50 MQT: Attempting connection...
09:27:55 MQT: Connect failed to 192.168.0.102:1883, rc -2. Retry in 10 sec
09:28:06 MQT: Attempting connection...
09:28:11 MQT: Connect failed to 192.168.0.102:1883, rc -2. Retry in 10 sec
09:28:22 MQT: Attempting connection...
09:28:27 MQT: Connect failed to 192.168.0.102:1883, rc -2. Retry in 10 sec
09:28:37 MQT: Attempting connection...
09:28:42 MQT: Connect failed to 192.168.0.102:1883, rc -2. Retry in 10 sec
09:28:53 MQT: Attempting connection...
09:28:58 MQT: Connect failed to 192.168.0.102:1883, rc -2. Retry in 10 sec
09:29:09 MQT: Attempting connection...
09:29:14 MQT: Connect failed to 192.168.0.102:1883, rc -2. Retry in 10 sec
09:29:25 MQT: Attempting connection...
09:29:30 MQT: Connect failed to 192.168.0.102:1883, rc -2. Retry in 10 sec
09:29:33 RSL: tele/homeassistant/STATE = {"Time":"2020-02-06T09:29:33","Epoch":1580977773,"Uptime":"0T00:07:03","UptimeSec":423,"Heap":21,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":35,"POWER":"ON","Wifi":{"AP":1,"SSId":"RenHome","BSSId":"B6:B9:8A:4C:8A:00","Channel":6,"RSSI":34,"LinkCount":1,"Downtime":"0T00:00:08"}}
09:29:33 RSL: tele/homeassistant/SENSOR = {"Time":"2020-02-06T09:29:33","Epoch":1580977773,"ENERGY":{"TotalStartTime":"2019-07-21T20:07:39","Total":43.090,"Yesterday":0.000,"Today":0.334,"Period":2,"Power":14,"ApparentPower":30,"ReactivePower":27,"Factor":0.47,"Voltage":245,"Current":0.123}}
09:29:41 MQT: Attempting connection...
09:29:46 MQT: Connect failed to 192.168.0.102:1883, rc -2. Retry in 10 sec
09:29:56 MQT: Attempting connection...
09:29:56 MQT: Connected
09:29:56 MQT: tele/homeassistant/LWT = Online (retained)
09:29:56 MQT: cmnd/homeassistant/POWER =
09:29:56 MQT: tele/homeassistant/INFO1 = {"Module":"BlitzWolf SHP","Version":"6.6.0.2(ce13c0c-sonoff)","FallbackTopic":"cmnd/DVES_272999_fb/","GroupTopic":"sonoffs"}
09:29:56 MQT: tele/homeassistant/INFO2 = {"WebServerMode":"Admin","Hostname":"homeassistant-2457","IPAddress":"192.168.0.7"}
09:29:56 MQT: tele/homeassistant/INFO3 = {"RestartReason":"Power on"}
09:29:56 MQT: stat/homeassistant/RESULT = {"POWER":"ON"}
09:29:56 MQT: stat/homeassistant/POWER = ON
09:29:57 MQT: stat/homeassistant/RESULT = {"POWER":"OFF"}
09:29:57 MQT: stat/homeassistant/POWER = OFF