Tasmota/MQTT disovery issues

Hi guys!

Having problems with one of my four Gosund SP111 smartplugs. Three of them are working perfectly running tasmota 8.1.0.2 and using HASS MQTT autodiscovery (setoption19 1). The last plug was reset during a power outage (have since changed setoption65 to 1 to avoid that in the future). I reconfigured it and tried adding it to HASS again, but it just “flickers” as an “unknown device” under MQTT devices, and then the entities are just unavailable. I thought I could upgrade the firmware and se if that solved thinsg so I went to 8.5. Same issue. After that I went to teh newly released 9.1 in order to try the native Tasmota integration. No luck there either. Here is what I see in the HA log when trying to use the native Tasmota integration with setoption19 0:

Logger: homeassistant.util.logging
Source: util/logging.py:108
First occurred: 3:11:58 PM (1 occurrences)
Last logged: 3:11:58 PM

Exception in discovery_message_received when handling msg on 'tasmota/discovery/C82B964F8801/config': '{"ip":"10.0.0.94","dn":"Dishwasher","fn":["Dishwasher",null,null,null,null,null,null,null],"hn":"dishwasher_4F8801-2049","mac":"C82B964F8801","md":"SP111 v1.1","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"9.1.0","t":"dishwasher_4F8801","ft":"%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[1,0,0,0,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,null,null,null,null,null,null],"btn":[0,0,0,0],"so":{"4":0,"11":0,"13":0,"17":1,"20":0,"30":0,"68":0,"73":0,"82":0,"114":0},"lk":1,"lt_st":0,"ver":1}' Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/hatasmota/discovery.py", line 158, in discovery_message_received payload = TasmotaDiscoveryMsg(json.loads(payload)) File "/usr/local/lib/python3.8/site-packages/hatasmota/discovery.py", line 117, in __init__ config = TASMOTA_DISCOVERY_SCHEMA(config) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: extra keys not allowed @ data['if']

Could anybody shed some light as to why it doesn’t want to play nice any longer?

Cheers,
Tim

try

setoption19 0
setoption19 1

I am facing exactly the same issue. devices were working with the MQTT discovery, but switching to Tasmota discovery getting the same error.

> 2020-11-06 19:07:04 ERROR (MainThread) [homeassistant.util.logging] Exception in discovery_message_received when handling msg on 'tasmota/discovery/807D3A333FC3/config': '{"ip":"192.168.223.190","dn":"Master Bedroom Heater","fn":["Master Bedroom Heater",null,null,null,null,null,null,null],"hn":"Master Bedroom Heater","mac":"807D3A333FC3","md":"Sonoff Pow R2","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["Off","On","TOGGLE","HOLD"],"sw":"9.1.0","t":"masterbedroomheater","ft":"%topic%/%prefix%/","tp":["cmnd","stat","tele"],"rl":[1,0,0,0,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,null,null,null,null,null,null],"btn":[0,0,0,0],"so":{"4":0,"11":0,"13":0,"17":1,"20":0,"30":0,"68":0,"73":0,"82":0,"114":0},"lk":1,"lt_st":0,"ver":1}'

Hi,

Thanks for the suggestion. However, I have tried that multiple time (flipping setoption19 to 0 and 1 back and forth), with each firmware update. Setting setoption19 to 1 for MQTT autodiscovery doesn’t work and that was the basic reason for me trying out the native Tasmota way present in the 9.x version of tasmota + 0.117 of HA.

I get a different error message in the logs with setoption19 1:

Logger: homeassistant.util.logging
Source: util/logging.py:108
First occurred: 3:11:58 PM (24 occurrences)
Last logged: 5:26:59 PM

* Exception in availability_message_received when handling msg on 'tele/dishwasher_4F8801/LWT': 'Online' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 34, in wrapper _log_message(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 24, in _log_message messages = debug_info["entities"][entity_id]["subscriptions"][ KeyError: 'sensor.dishwasher_energy_voltage'
* Exception in availability_message_received when handling msg on 'tele/dishwasher_4F8801/LWT': 'Online' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 34, in wrapper _log_message(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 24, in _log_message messages = debug_info["entities"][entity_id]["subscriptions"][ KeyError: 'sensor.dishwasher_energy_current'
* Exception in availability_message_received when handling msg on 'tele/dishwasher_4F8801/LWT': 'Online' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 34, in wrapper _log_message(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 24, in _log_message messages = debug_info["entities"][entity_id]["subscriptions"][ KeyError: 'sensor.dishwasher_status'
* Exception in availability_message_received when handling msg on 'tele/dishwasher_4F8801/LWT': 'Online' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 34, in wrapper _log_message(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 24, in _log_message messages = debug_info["entities"][entity_id]["subscriptions"][ KeyError: 'tele/dishwasher_4F8801/LWT'
* Exception in availability_message_received when handling msg on 'tele/dishwasher_4F8801/LWT': 'Online' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 34, in wrapper _log_message(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 24, in _log_message messages = debug_info["entities"][entity_id]["subscriptions"][ KeyError: 'switch.dishwasher'

and the following warning:

Logger: homeassistant.helpers.service
Source: helpers/service.py:447
First occurred: 5:27:34 PM (1 occurrences)
Last logged: 5:27:34 PM

Unable to find referenced entities switch.dishwasher

Cheers,
Tim

I tried also using Tasmota (beta) integration with Home Assistant 0.117.4 and Tasmota 9.1.0

I do have set the setoption19 to 0

21:12:20 CMD: setoption19 0
21:12:20 MQT: sonoff_washer/stat/RESULT = {"SetOption19":"OFF"}
21:12:21 LOG: Home Assistant MQTT Discovery disabled.

I got this error on the log:

Logger: homeassistant.util.logging
Source: util/logging.py:108
First occurred: 10:13:03 PM (1 occurrences)
Last logged: 10:13:03 PM
Exception in discovery_message_received when handling msg on 'tasmota/discovery/ECFABC4F644A/config': '{"ip":"192.168.0.205","dn":"Tasmota","fn":["Tasmota",null,null,null,null,null,null,null],"hn":"sonoff_washer","mac":"ECFABC4F644A","md":"Sonoff Pow R2","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"9.1.0","t":"sonoff_washer","ft":"%topic%/%prefix%/","tp":["cmnd","stat","tele"],"rl":[1,0,0,0,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,null,null,null,null,null,null],"btn":[0,0,0,0],"so":{"4":0,"11":0,"13":0,"17":1,"20":0,"30":0,"68":0,"73":0,"82":0,"114":0},"lk":1,"lt_st":0,"ver":1}' Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/hatasmota/discovery.py", line 158, in discovery_message_received payload = TasmotaDiscoveryMsg(json.loads(payload)) File "/usr/local/lib/python3.8/site-packages/hatasmota/discovery.py", line 117, in __init__ config = TASMOTA_DISCOVERY_SCHEMA(config) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: extra keys not allowed @ data['if'] 

For me the device is now working with Tasmota native discovery after upgrading to HASS 0.117.5.