Sonoff / Tasmota started regularly showing "Unavailable" on Home Assistant

If you go to dev-tools and set the filter to status you will see the status sensor for each device. You can add that sensor to an entities card in Lovelace and if you tap on it you will see all the status info in a nice format.

If you tap the sensor in dev-tools you will also see the info like this (not as nice format though)

1 Like

Btw if that is typical it explains your problem. 42% sucks

1 Like

Thanks. So the wifi signal is not good at that spot. The bulb is installed at outside of the front door light fixture. The other bulb at another side of the front door is showing (60%, -70 dBm). These two bulbs are about 4-5 feet apart. I guess the light fixture has some impact on the wifi signal.

Yeah my worst is around 56% and it shows with multiple WLAN and MQTT connections. I would think yours would as well. That particular device for me is in a steel case (my house alarm). The garage one is also a pretty poor signal.

I added a couple of repeaters in my house so all my wifi is pretty solid now.

1 Like

I think I have been having a similar problem.

Issue: Tasmota Light/Fan switch appears as Unavailable in Home Assistant quite often (about 5 minutes per hour)

Setup:

  • Treatlife DS03 Light Fan Switch Flashed with the Tasmota 9.2.0 (following these directions).
  • Wired such that it has power and ground, but light wire and fan wire are caped off (i.e. it controls the light and fan only via WiFi/MQTT
  • Home Assistant discovers the switch via the Tasmota (beta) integration.
  • I have a fan/Light in the Office attached to Home Assistant using a sonoff ifan03 using this as my guide
  • Finally I have them linked via Node Red (I am sure tihs is WAY overcomplicated for the node Red - but I am still new to all this
[{"id":"c060ae7c.770da","type":"tab","label":"Office Light / Fan","disabled":false,"info":""},{"id":"4a314923.8967d8","type":"server-state-changed","z":"c060ae7c.770da","name":"Office Light Switch Changes","server":"c7fbef29.e4f7d","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.officelightfanswitch_light","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"x":240,"y":120,"wires":[["35351e43.483702","f368e8e2.4899f8"]]},{"id":"778367ea.c08a78","type":"server-state-changed","z":"c060ae7c.770da","name":"Office Fan Switch Changes","server":"c7fbef29.e4f7d","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"fan.office_fan_switch","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"x":230,"y":400,"wires":[["d29b25f5.4cfa88"]]},{"id":"251b65f9.61140a","type":"server-state-changed","z":"c060ae7c.770da","name":"Office Light Fan Controller Changes","server":"c7fbef29.e4f7d","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.office_light_fan_controller","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"x":260,"y":180,"wires":[["b95a25e2.87f968"]]},{"id":"b76ea93.1e73d58","type":"function","z":"c060ae7c.770da","name":"","func":"msg.payload.service=`turn_${msg.trigger}`;\nmsg.payload.entity=\"light.office_light_fan_controller\";\nmsg.payload.data={\"entity_id\":\"light.office_light_fan_controller\"}\nif (msg.trigger == \"on\") {\n \tmsg.payload.data.brightness=255;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1060,"y":120,"wires":[["434f82d2.cc336c"]]},{"id":"1f7d48c6.260117","type":"template","z":"c060ae7c.770da","name":"Payload Template","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n    \"service\": \"\",\n    \"entity\": \"\",\n    \"data\":{\n        \"entity_id\":\"\"\n    }\n}","output":"json","x":890,"y":120,"wires":[["b76ea93.1e73d58"]]},{"id":"35351e43.483702","type":"change","z":"c060ae7c.770da","name":"","rules":[{"t":"set","p":"trigger","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":120,"wires":[["1b117b81.6ddf64"]]},{"id":"434f82d2.cc336c","type":"api-call-service","z":"c060ae7c.770da","name":"Update Office Controller","server":"c7fbef29.e4f7d","version":1,"debugenabled":false,"service_domain":"light","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1250,"y":120,"wires":[["6e832d02.c434b4","6d5cd269.6e17ec"]]},{"id":"f416fa5.c971108","type":"function","z":"c060ae7c.770da","name":"","func":"msg.payload.service=`turn_${msg.trigger}`;\nmsg.payload.entity=\"light.officelightfanswitch_light\";\nmsg.payload.data={\"entity_id\":\"light.officelightfanswitch_light\"}\nif (msg.trigger == \"on\") {\n \tmsg.payload.data.brightness=255;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1060,"y":180,"wires":[["44df2576.38912c"]]},{"id":"473bc7a3.004a28","type":"template","z":"c060ae7c.770da","name":"Payload Template","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n    \"service\": \"\",\n    \"entity\": \"\",\n    \"data\":{\n        \"entity_id\":\"\"\n    }\n}","output":"json","x":890,"y":180,"wires":[["f416fa5.c971108"]]},{"id":"b95a25e2.87f968","type":"change","z":"c060ae7c.770da","name":"","rules":[{"t":"set","p":"trigger","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":180,"wires":[["8e558851.1bc1d8"]]},{"id":"44df2576.38912c","type":"api-call-service","z":"c060ae7c.770da","name":"Update Office Switch","server":"c7fbef29.e4f7d","version":1,"debugenabled":false,"service_domain":"light","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1240,"y":180,"wires":[["1388a3ab.4230cc"]]},{"id":"fb3dac4d.46477","type":"function","z":"c060ae7c.770da","name":"","func":"msg.payload.service=`turn_${msg.trigger}`;\nmsg.payload.entity=\"fan.office_light_fan_controller\";\nmsg.payload.data.entity_id=\"fan.office_light_fan_controller\";\nif (msg.trigger == \"on\") {\n \tmsg.payload.data.speed=`${msg.speed}`;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":400,"wires":[["9d95f1a5.beb03"]]},{"id":"d29b25f5.4cfa88","type":"change","z":"c060ae7c.770da","name":"","rules":[{"t":"set","p":"trigger","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"speed","pt":"msg","to":"data.new_state.attributes.speed","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":400,"wires":[["97ff6261.4c6b4"]]},{"id":"9d95f1a5.beb03","type":"api-call-service","z":"c060ae7c.770da","name":"Update Office Controller","server":"c7fbef29.e4f7d","version":1,"debugenabled":false,"service_domain":"fan","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1450,"y":400,"wires":[[]]},{"id":"499b9d2b.0159b4","type":"template","z":"c060ae7c.770da","name":"Payload Template","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n    \"service\": \"\",\n    \"entity\": \"\",\n    \"data\":{\n        \"entity_id\": \"\"\n    }\n}","output":"json","x":1090,"y":400,"wires":[["fb3dac4d.46477"]]},{"id":"d9a6968c.e97e38","type":"server-state-changed","z":"c060ae7c.770da","name":"Office Light Fan Controller Changes","server":"c7fbef29.e4f7d","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"fan.office_light_fan_controller","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"x":260,"y":460,"wires":[["463be1e6.91f7c"]]},{"id":"463be1e6.91f7c","type":"change","z":"c060ae7c.770da","name":"","rules":[{"t":"set","p":"trigger","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"speed","pt":"msg","to":"data.new_state.attributes.speed","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":460,"wires":[["fe4c1dba.f711e"]]},{"id":"6a040859.2a9398","type":"function","z":"c060ae7c.770da","name":"","func":"msg.payload.service=`turn_${msg.trigger}`;\nmsg.payload.entity=\"fan.office_fan_switch\";\nmsg.payload.data.entity_id=\"fan.office_fan_switch\";\nif (msg.trigger == \"on\") {\n \tmsg.payload.data.speed=`${msg.speed}`;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":460,"wires":[["1e89c450.916dbc"]]},{"id":"1e89c450.916dbc","type":"api-call-service","z":"c060ae7c.770da","name":"Update Office Switch","server":"c7fbef29.e4f7d","version":1,"debugenabled":false,"service_domain":"fan","service":"","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1440,"y":460,"wires":[[]]},{"id":"de862b54.3933d8","type":"template","z":"c060ae7c.770da","name":"Payload Template","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n    \"service\": \"\",\n    \"entity\": \"\",\n    \"data\":{\n        \"entity_id\": \"\"\n    }\n}","output":"json","x":1090,"y":460,"wires":[["6a040859.2a9398"]]},{"id":"1b117b81.6ddf64","type":"api-current-state","z":"c060ae7c.770da","name":"Light states !=","server":"c7fbef29.e4f7d","version":1,"outputs":2,"halt_if":"payload","halt_if_type":"msg","halt_if_compare":"is_not","override_topic":false,"entity_id":"light.office_light_fan_controller","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":700,"y":120,"wires":[["1f7d48c6.260117"],[]]},{"id":"8e558851.1bc1d8","type":"api-current-state","z":"c060ae7c.770da","name":"Light states !=","server":"c7fbef29.e4f7d","version":1,"outputs":2,"halt_if":"payload","halt_if_type":"msg","halt_if_compare":"is_not","override_topic":false,"entity_id":"light.officelightfanswitch_light","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":700,"y":180,"wires":[["473bc7a3.004a28"],[]]},{"id":"97ff6261.4c6b4","type":"api-current-state","z":"c060ae7c.770da","name":"Fan Controller State","server":"c7fbef29.e4f7d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"fan.office_light_fan_controller","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":720,"y":400,"wires":[["8d0e094c.8a8608"]]},{"id":"fe4c1dba.f711e","type":"api-current-state","z":"c060ae7c.770da","name":"Fan Switch State","server":"c7fbef29.e4f7d","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"fan.office_fan_switch","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":710,"y":460,"wires":[["b53c236b.550d4"]]},{"id":"8d0e094c.8a8608","type":"function","z":"c060ae7c.770da","name":"","func":"if((msg.trigger != msg.data.state) || (msg.speed != msg.data.attributes.speed)){\n  return msg;  \n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":920,"y":400,"wires":[["499b9d2b.0159b4"]]},{"id":"b53c236b.550d4","type":"function","z":"c060ae7c.770da","name":"","func":"if((msg.trigger != msg.data.state) || (msg.speed != msg.data.attributes.speed)){\n  return msg;  \n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":920,"y":460,"wires":[["de862b54.3933d8"]]},{"id":"8467a7d5.9e8938","type":"comment","z":"c060ae7c.770da","name":"Office Light Sync","info":"","x":200,"y":80,"wires":[]},{"id":"d3dbfda5.7c5bd","type":"comment","z":"c060ae7c.770da","name":"Office Fan Sync","info":"","x":200,"y":360,"wires":[]},{"id":"1388a3ab.4230cc","type":"change","z":"c060ae7c.770da","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"trigger","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1460,"y":180,"wires":[["1b117b81.6ddf64"]]},{"id":"6e832d02.c434b4","type":"change","z":"c060ae7c.770da","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"trigger","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1460,"y":120,"wires":[["8e558851.1bc1d8"]]},{"id":"f368e8e2.4899f8","type":"debug","z":"c060ae7c.770da","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":490,"y":80,"wires":[]},{"id":"6d5cd269.6e17ec","type":"debug","z":"c060ae7c.770da","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1430,"y":80,"wires":[]},{"id":"c7fbef29.e4f7d","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

When I look at the tasmota console, I noticed that the switch appeared to reset around the same time it went unavailable in Home Assistant (First time noticing this)

Console Output:

00:00:00 CFG: Loaded from flash at F6, Count 206
00:00:00 QPC: Count 1
00:00:00 SNS: Hardware Serial
00:00:00 Project tasmota Tasmota Version 9.2.0(tasmota)-2_7_4_9(2020-12-17T10:05:31)
00:00:00 WIF: Connecting to AP1 <SSID> Channel 11 BSSId D4:5D:64:EC:9D:C0 in mode 11n as OfficeLightFanSwitch...
00:00:02 WIF: Connected
00:00:02 HTP: Web server active on OfficeLightFanSwitch with IP address 192.168.1.###
17:37:27 MQT: Attempting connection...
17:37:28 MQT: Connected
17:37:28 MQT: tele/tasmota_office-ds03/LWT = Online (retained)
17:37:28 MQT: cmnd/tasmota_office-ds03/POWER = 
17:37:28 MQT: tele/tasmota_office-ds03/INFO1 = {"Module":"Tuya MCU","Version":"9.2.0(tasmota)","FallbackTopic":"cmnd/DVES_7F64AC_fb/","GroupTopic":"cmnd/tasmotas/"}
17:37:28 MQT: tele/tasmota_office-ds03/INFO2 = {"WebServerMode":"Admin","Hostname":"OfficeLightFanSwitch","IPAddress":"192.168.1.###"}
17:37:28 MQT: tele/tasmota_office-ds03/INFO3 = {"RestartReason":{"Exception":29,"Reason":"Exception","EPC":["4000df64","00000000","00000000"],"EXCVADDR":"00000000","DEPC":"00000000","CallChain":["40102ad9","40101494","40260de7","40105943","40260d7c","40260d23","4025fe80","4025fea9","4025d914","4024e961","40259c7d","4024ecd9","4025e60b","40000f3d","4025e07e","402677cf","4026708f","40245084","40000f49","40000f49","40000e19","40105a61","40105a67","4010000d","40265f78","40265f29","4010595b","4010323f","40100a40","40103420","4010595b"]}}
17:37:28 MQT: stat/tasmota_office-ds03/RESULT = {"POWER1":"OFF"}
17:37:28 MQT: stat/tasmota_office-ds03/POWER1 = OFF
17:37:28 MQT: stat/tasmota_office-ds03/RESULT = {"POWER2":"OFF"}
17:37:28 MQT: stat/tasmota_office-ds03/POWER2 = OFF
17:37:28 TYA: MCU Product ID: {"p":"ipyqwvhvzzjezv35","v":"3.3.14","m":0}
17:37:28 RUL: TUYARECEIVED#DATA=55AA03070005030400010016 performs "publish2 stat/tasmota_office-ds03/speed 3,0"
17:37:28 MQT: stat/tasmota_office-ds03/speed = 3,0 (retained)
17:37:29 MQT: tele/tasmota_office-ds03/STATE = {"Time":"2020-12-28T17:37:29","Uptime":"0T00:00:07","UptimeSec":7,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":55,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":100,"Signal":-43,"LinkCount":1,"Downtime":"0T00:00:04"}}
17:37:29 MQT: stat/tasmota_office-ds03/RESULT = {"Time":"2020-12-28T17:37:29","Uptime":"0T00:00:07","UptimeSec":7,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":55,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":100,"Signal":-43,"LinkCount":1,"Downtime":"0T00:00:04"}}
17:37:29 MQT: stat/tasmota_office-ds03/STATUS = {"Status":{"Module":54,"DeviceName":"Tasmota","FriendlyName":["Tasmota","Tasmota2"],"Topic":"tasmota_office-ds03","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0}}
17:37:29 MQT: stat/tasmota_office-ds03/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Exception","Uptime":"0T00:00:07","StartupUTC":"2020-12-28T16:37:22","Sleep":50,"CfgHolder":4617,"BootCount":30,"BCResetTime":"2020-12-18T02:29:38","SaveCount":206,"SaveAddress":"F6000"}}
17:37:29 MQT: stat/tasmota_office-ds03/STATUS11 = {"StatusSTS":{"Time":"2020-12-28T17:37:29","Uptime":"0T00:00:07","UptimeSec":7,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":56,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":100,"Signal":-47,"LinkCount":1,"Downtime":"0T00:00:04"}}}
17:37:30 QPC: Reset
17:37:32 MQT: tele/tasmota_office-ds03/STATE = {"Time":"2020-12-28T17:37:32","Uptime":"0T00:00:10","UptimeSec":10,"Heap":26,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":100,"Signal":-43,"LinkCount":1,"Downtime":"0T00:00:04"}}
17:42:32 MQT: tele/tasmota_office-ds03/STATE = {"Time":"2020-12-28T17:42:32","Uptime":"0T00:05:10","UptimeSec":310,"Heap":23,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":100,"Signal":-42,"LinkCount":1,"Downtime":"0T00:00:04"}}
17:47:32 MQT: tele/tasmota_office-ds03/STATE = {"Time":"2020-12-28T17:47:32","Uptime":"0T00:10:10","UptimeSec":610,"Heap":24,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":100,"Signal":-42,"LinkCount":1,"Downtime":"0T00:00:04"}}
17:52:32 MQT: tele/tasmota_office-ds03/STATE = {"Time":"2020-12-28T17:52:32","Uptime":"0T00:15:10","UptimeSec":910,"Heap":23,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":34,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":100,"Signal":-41,"LinkCount":1,"Downtime":"0T00:00:04"}}

Update: Just had another unavailable state for the tasmota switch in home assistant. I think it has to do with the switch itself

Switch Console Log:

20:22:32 MQT: tele/tasmota_office-ds03/STATE = {"Time":"2020-12-28T20:22:32","Uptime":"0T02:45:10","UptimeSec":9910,"Heap":14,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":2,"POWER1":"OFF","POWER2":"ON","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":92,"Signal":-54,"LinkCount":2,"Downtime":"0T00:00:49"}}
20:27:32 MQT: tele/tasmota_office-ds03/STATE = {"Time":"2020-12-28T20:27:32","Uptime":"0T02:50:10","UptimeSec":10210,"Heap":13,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":2,"POWER1":"OFF","POWER2":"ON","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":90,"Signal":-55,"LinkCount":2,"Downtime":"0T00:00:49"}}
20:28:12 MQT: Attempting connection...
20:28:13 MQT: Connect failed to 192.168.1.16:1883, rc -2. Retry in 10 sec
20:28:23 MQT: Attempting connection...
20:28:24 MQT: Connect failed to 192.168.1.16:1883, rc -2. Retry in 20 sec
20:28:44 MQT: Attempting connection...
20:28:45 MQT: Connected
20:28:45 MQT: tele/tasmota_office-ds03/LWT = Online (retained)
20:28:45 MQT: cmnd/tasmota_office-ds03/POWER = 
20:28:46 MQT: tele/tasmota_office-ds03/STATE = {"Time":"2020-12-28T20:28:46","Uptime":"0T02:51:24","UptimeSec":10284,"Heap":13,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":3,"POWER1":"OFF","POWER2":"ON","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":98,"Signal":-51,"LinkCount":2,"Downtime":"0T00:00:49"}}
20:28:46 MQT: stat/tasmota_office-ds03/RESULT = {"Time":"2020-12-28T20:28:46","Uptime":"0T02:51:24","UptimeSec":10284,"Heap":13,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":3,"POWER1":"OFF","POWER2":"ON","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":98,"Signal":-51,"LinkCount":2,"Downtime":"0T00:00:49"}}
20:28:48 MQT: stat/tasmota_office-ds03/STATUS = {"Status":{"Module":54,"DeviceName":"Tasmota","FriendlyName":["Tasmota","Tasmota2"],"Topic":"tasmota_office-ds03","ButtonTopic":"0","Power":2,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0}}
20:28:48 MQT: stat/tasmota_office-ds03/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Exception","Uptime":"0T02:51:26","StartupUTC":"2020-12-28T16:37:22","Sleep":50,"CfgHolder":4617,"BootCount":31,"BCResetTime":"2020-12-18T02:29:38","SaveCount":210,"SaveAddress":"FA000"}}
20:28:48 MQT: stat/tasmota_office-ds03/STATUS11 = {"StatusSTS":{"Time":"2020-12-28T20:28:48","Uptime":"0T02:51:26","UptimeSec":10286,"Heap":10,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":3,"POWER1":"OFF","POWER2":"ON","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":98,"Signal":-51,"LinkCount":2,"Downtime":"0T00:00:49"}}}

and Home Assistant Log

2020-12-28 14:28:13 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on tele/tasmota_office-ds03/LWT: b'Offline'
2020-12-28 14:28:13 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to stat/tasmota_office-ds03/STATUS11, mid: 2217
2020-12-28 14:28:13 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to stat/tasmota_office-ds03/STATUS1, mid: 2218
2020-12-28 14:28:14 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on cmnd/tasmota_office-ds03/STATE: '', mid: 2219
2020-12-28 14:28:14 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on cmnd/tasmota_office-ds03/STATUS: 'None', mid: 2220
2020-12-28 14:28:14 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on cmnd/tasmota_office-ds03/STATUS: '11', mid: 2221
2020-12-28 14:28:14 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on cmnd/tasmota_office-ds03/STATUS: '1', mid: 2222
2020-12-28 14:28:45 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on tele/tasmota_office-ds03/LWT: b'Online'
2020-12-28 14:28:46 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on cmnd/tasmota_office-ds03/STATE: '', mid: 2223
2020-12-28 14:28:46 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on cmnd/tasmota_office-ds03/STATUS: 'None', mid: 2224
2020-12-28 14:28:46 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on cmnd/tasmota_office-ds03/STATUS: '1', mid: 2225
2020-12-28 14:28:46 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on cmnd/tasmota_office-ds03/STATUS: '11', mid: 2226
2020-12-28 14:28:47 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on tele/tasmota_office-ds03/STATE: b'{"Time":"2020-12-28T20:28:46","Uptime":"0T02:51:24","UptimeSec":10284,"Heap":13,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":3,"POWER1":"OFF","POWER2":"ON","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":98,"Signal":-51,"LinkCount":2,"Downtime":"0T00:00:49"}}'
2020-12-28 14:28:48 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on stat/tasmota_office-ds03/RESULT: b'{"Time":"2020-12-28T20:28:46","Uptime":"0T02:51:24","UptimeSec":10284,"Heap":13,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":3,"POWER1":"OFF","POWER2":"ON","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":98,"Signal":-51,"LinkCount":2,"Downtime":"0T00:00:49"}}'
2020-12-28 14:28:49 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on stat/tasmota_office-ds03/STATUS1: b'{"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Exception","Uptime":"0T02:51:26","StartupUTC":"2020-12-28T16:37:22","Sleep":50,"CfgHolder":4617,"BootCount":31,"BCResetTime":"2020-12-18T02:29:38","SaveCount":210,"SaveAddress":"FA000"}}'
2020-12-28 14:28:49 DEBUG (MainThread) [homeassistant.components.mqtt] Unsubscribing from stat/tasmota_office-ds03/STATUS1, mid: 2227
2020-12-28 14:28:49 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on stat/tasmota_office-ds03/STATUS11: b'{"StatusSTS":{"Time":"2020-12-28T20:28:48","Uptime":"0T02:51:26","UptimeSec":10286,"Heap":10,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":3,"POWER1":"OFF","POWER2":"ON","Dimmer":100,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"<SSID>","BSSId":"D4:5D:64:EC:9D:C0","Channel":11,"RSSI":98,"Signal":-51,"LinkCount":2,"Downtime":"0T00:00:49"}}}'

Any help on what might be causing this?

I am seeing

Client DVES_7F64AC has exceeded timeout, disconnecting.

and sometimes

Socket error on client DVES_7F64AC, disconnecting.

in my MQTT broker log.

I’m having this exact same issue and same messages. It’s driving me nuts. I even completely nuked my network and set it back up thinking something got mis-configured, but it still occurs. It happens to my WP3s, WP6s, S31s as well as my Sonoff RF and Zigbee bridges (all on 9.2). They will go unavailable/available and then suddenly, they all go offline requiring me to restart HA. I can’t seem to pin down what the issue is. My next step may be completely resetting all (13) of the devices to see if that does anything.

Also, not sure if it has anything to do with anything, but I notice in my Unifi controller, the devices will show up for a bit then disappear; occasionally they will appear without an IP even though they are assigned an fixed IP…again, not sure that is relevant.

Was able to figure out and fix my outlets randomly dropping off/restarting. It seemed to happen every 7ish hours and all my tasmota devices would go unavailable and checking the logs, it appeared they were restarting. I did some searching and came across this post: https://www.reddit.com/r/homeautomation/comments/9j8wye/sonoff_basic_and_s31_occasionally_droppping_off/e6pl4vk?utm_source=share&utm_medium=web2x&context=3

Apparently, if you have TasmoAdmin running all the time that can cause some issues which causes the devices to reboot. I disabled TasmoAdmin, and boom, rock solid reliability. Hopefully this helps someone else.

I’m having the same issue with my Tasmota devices, they go unavailable about every 30 mins or so and come back after a few seconds.

I’ve got a few Sonoff T1 switches and they have this issue but my Sonoff SVs that I’ve got connected to the garage door motor and the front gate motor are fine. The T1s I just updated to 9.2.0 hoping it’ll fix the issue but no go. The SV units are on older firmware, I think 6.3.0 and 6.5.0 respectively.

I’ve tried a Reset 6 and also the latest development build and neither seem to help with the issue of my T1 switches becoming unavailable and rebooting regularly.

having the same issue as described here but still no luck

Having the exact same problem
Lots of tasmota devices (sonoff basic) on unifi network.
They just become non-responsive and greyed out for no reason what so ever
All on tasmota 9.5 firmware

Rebooting the access point does the trick but it’s he ap is working fine as all other devices connected work fine

1 Like

similar here not sure if there is a fix.

Having this problem too.
Using tasmota 8.5.0 and 8.1.0
Have to restart the AP (Asus router with merlin).

Hi peeps.

I have the same issue with Home Assistant OS core-2022.2.9 and Tasmota 11.0.0

Any fix for this issue?

same problem here. Tasmota devices (sonoff powR3) become unavailable …
εικόνα

and here is the logs from mqtt add-on

2023-12-19 21:27:19: New connection from 192.168.70.182:65401 on port 1883.
2023-12-19 21:27:19: New client connected from 192.168.70.182:65401 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:33:49: New connection from 192.168.70.182:53413 on port 1883.
2023-12-19 21:33:49: Client DVES_B78530 already connected, closing old connection.
2023-12-19 21:33:49: New client connected from 192.168.70.182:53413 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:37:00: New connection from 192.168.70.182:63403 on port 1883.
2023-12-19 21:37:00: Client DVES_B78530 already connected, closing old connection.
2023-12-19 21:37:00: New client connected from 192.168.70.182:63403 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:38:01: New connection from 192.168.70.182:63566 on port 1883.
2023-12-19 21:38:01: Client DVES_B78530 already connected, closing old connection.
2023-12-19 21:38:01: New client connected from 192.168.70.182:63566 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:39:04: Client DVES_B78530 disconnected due to malformed packet.
2023-12-19 21:39:05: New connection from 192.168.70.182:56186 on port 1883.
2023-12-19 21:39:05: New client connected from 192.168.70.182:56186 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:40:08: New connection from 192.168.70.182:60398 on port 1883.
2023-12-19 21:40:08: Client DVES_B78530 already connected, closing old connection.
2023-12-19 21:40:08: New client connected from 192.168.70.182:60398 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:41:13: New connection from 192.168.70.182:58224 on port 1883.
2023-12-19 21:41:13: Client DVES_B78530 already connected, closing old connection.
2023-12-19 21:41:13: New client connected from 192.168.70.182:58224 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:42:44: New connection from 192.168.70.182:51390 on port 1883.
2023-12-19 21:42:44: Client DVES_B78530 already connected, closing old connection.
2023-12-19 21:42:44: New client connected from 192.168.70.182:51390 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:44:10: Client DVES_B78530 disconnected due to protocol error.
2023-12-19 21:44:11: New connection from 192.168.70.182:60723 on port 1883.
2023-12-19 21:44:11: New client connected from 192.168.70.182:60723 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:47:41: Client DVES_B78530 disconnected due to malformed packet.
2023-12-19 21:47:41: New connection from 192.168.70.182:63312 on port 1883.
2023-12-19 21:47:41: New client connected from 192.168.70.182:63312 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:50:00: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 21:50:00: New connection from 192.168.70.182:64971 on port 1883.
2023-12-19 21:50:00: New client connected from 192.168.70.182:64971 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:51:02: New connection from 192.168.70.182:63114 on port 1883.
2023-12-19 21:51:02: Client DVES_B78530 already connected, closing old connection.
2023-12-19 21:51:02: New client connected from 192.168.70.182:63114 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:53:06: New connection from 192.168.70.182:63593 on port 1883.
2023-12-19 21:53:06: Client DVES_B78530 already connected, closing old connection.
2023-12-19 21:53:06: New client connected from 192.168.70.182:63593 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 21:53:09: Saving in-memory database to /data//mosquitto.db.
2023-12-19 21:58:12: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 21:58:12: New connection from 192.168.70.182:59684 on port 1883.
2023-12-19 21:58:12: New client connected from 192.168.70.182:59684 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:01:27: New connection from 192.168.70.182:61589 on port 1883.
2023-12-19 22:01:27: Client DVES_B78530 already connected, closing old connection.
2023-12-19 22:01:27: New client connected from 192.168.70.182:61589 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:02:30: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 22:02:31: New connection from 192.168.70.182:57903 on port 1883.
2023-12-19 22:02:31: New client connected from 192.168.70.182:57903 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:06:13: New connection from 192.168.70.182:61273 on port 1883.
2023-12-19 22:06:13: Client DVES_B78530 already connected, closing old connection.
2023-12-19 22:06:13: New client connected from 192.168.70.182:61273 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:07:41: New connection from 192.168.70.182:58754 on port 1883.
2023-12-19 22:07:41: Client DVES_B78530 already connected, closing old connection.
2023-12-19 22:07:41: New client connected from 192.168.70.182:58754 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:09:48: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 22:09:48: New connection from 192.168.70.182:53336 on port 1883.
2023-12-19 22:09:48: New client connected from 192.168.70.182:53336 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:10:58: New connection from 192.168.70.182:49845 on port 1883.
2023-12-19 22:10:58: Client DVES_B78530 already connected, closing old connection.
2023-12-19 22:10:58: New client connected from 192.168.70.182:49845 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:12:00: New connection from 192.168.70.182:53157 on port 1883.
2023-12-19 22:12:00: Client DVES_B78530 already connected, closing old connection.
2023-12-19 22:12:00: New client connected from 192.168.70.182:53157 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:15:06: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 22:15:07: New connection from 192.168.70.182:57083 on port 1883.
2023-12-19 22:15:07: New client connected from 192.168.70.182:57083 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:17:30: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 22:17:31: New connection from 192.168.70.182:54530 on port 1883.
2023-12-19 22:17:31: New client connected from 192.168.70.182:54530 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:19:18: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 22:19:18: New connection from 192.168.70.182:49717 on port 1883.
2023-12-19 22:19:18: New client connected from 192.168.70.182:49717 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:20:49: New connection from 192.168.70.182:58257 on port 1883.
2023-12-19 22:20:49: Client DVES_B78530 already connected, closing old connection.
2023-12-19 22:20:49: New client connected from 192.168.70.182:58257 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:21:50: New connection from 192.168.70.182:53391 on port 1883.
2023-12-19 22:21:50: Client DVES_B78530 already connected, closing old connection.
2023-12-19 22:21:50: New client connected from 192.168.70.182:53391 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:23:10: Saving in-memory database to /data//mosquitto.db.
2023-12-19 22:24:22: New connection from 192.168.70.182:62018 on port 1883.
2023-12-19 22:24:22: Client DVES_B78530 already connected, closing old connection.
2023-12-19 22:24:22: New client connected from 192.168.70.182:62018 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:25:12: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 22:25:12: New connection from 192.168.70.182:56448 on port 1883.
2023-12-19 22:25:12: New client connected from 192.168.70.182:56448 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:27:18: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 22:27:18: New connection from 192.168.70.182:50950 on port 1883.
2023-12-19 22:27:18: New client connected from 192.168.70.182:50950 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:29:36: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 22:29:36: New connection from 192.168.70.182:60138 on port 1883.
2023-12-19 22:29:36: New client connected from 192.168.70.182:60138 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:30:38: New connection from 192.168.70.182:58153 on port 1883.
2023-12-19 22:30:38: Client DVES_B78530 already connected, closing old connection.
2023-12-19 22:30:38: New client connected from 192.168.70.182:58153 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:31:24: Client DVES_B78530 has exceeded timeout, disconnecting.
2023-12-19 22:31:24: New connection from 192.168.70.182:51013 on port 1883.
2023-12-19 22:31:24: New client connected from 192.168.70.182:51013 as DVES_B78530 (p2, c1, k30, u'washer').
2023-12-19 22:34:58: New connection from 192.168.70.182:63684 on port 1883.
2023-12-19 22:34:58: Client DVES_B78530 already connected, closing old connection.
2023-12-19 22:34:58: New client connected from 192.168.70.182:63684 as DVES_B78530 (p2, c1, k30, u'washer').

I had multiple Sonoff devices becoming unavailable. I am using an Unifi Access Point. The solution was to deactivate “Channel Optimization” in Unifi Console.


Since this feature is off, Tasmota is constantly connected without any issues.