Core: MQTT Lights (Tasmota Bulbs) not updating state

Created on 8 Sep 2020  路  9Comments  路  Source: home-assistant/core

The problem


Tasmota MQTT Light Bulbs no longer update state.

Environment

  • Home Assistant Core release with the issue: 0.115.0b0
  • Last working Home Assistant Core release (if known): 0.114.4
  • Operating environment (OS/Container/Supervised/Core): Container
  • Integration causing this issue: mqtt
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/mqtt/

Problem-relevant configuration.yaml

Configured via AutoDiscovery and UI.

Traceback/Error logs

Nothing Relevant

Additional information

When turning the light on via Home Assistant, the bulb turns on, as expected. However, the state of the bulb in Home Assistant is not updated to reflect this. Additionally, changing the bulb directly generates a new MQTT state, however, the bulb state in Home Assistant doesn't update.

Discovery Message

{"name":"bulb010","stat_t":"bulb010/tele/STATE","avty_t":"bulb010/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","cmd_t":"bulb010/cmnd/POWER","val_tpl":"{{value_json.POWER}}","pl_off":"OFF","pl_on":"ON","uniq_id":"59C8DF_LI_1","dev":{"ids":["59C8DF"]},"bri_cmd_t":"bulb010/cmnd/Dimmer","bri_stat_t":"bulb010/tele/STATE","bri_scl":100,"on_cmd_type":"brightness","bri_val_tpl":"{{value_json.Dimmer}}","rgb_cmd_t":"bulb010/cmnd/Color2","rgb_stat_t":"bulb010/tele/STATE","rgb_val_tpl":"{{value_json.Color.split(',')[0:3]|join(',')}}","fx_cmd_t":"bulb010/cmnd/Scheme","fx_stat_t":"bulb010/tele/STATE","fx_val_tpl":"{{value_json.Scheme}}","fx_list":["0","1","2","3","4"],"whit_val_cmd_t":"bulb010/cmnd/White","whit_val_stat_t":"bulb010/tele/STATE","whit_val_scl":100,"whit_val_tpl":"{{value_json.White}}"}

State Message sent to bulb010/tele/STATE

{"Time":"2020-09-08T16:08:31","Uptime":"0T00:00:41","UptimeSec":41,"Heap":25,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":91,"MqttCount":1,"POWER":"ON","Dimmer":100,"Color":"6,129,255,0","HSBColor":"210,98,100","White":0,"Channel":[2,51,100,0],"Scheme":0,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"XXX","BSSId":"XXX","Channel":1,"RSSI":92,"Signal":-54,"LinkCount":1,"Downtime":"0T00:00:03"}}

Notice, POWER: ON in the MQTT Payload and value_json.POWER and pl_on: ON in the discovery Payload.

mqtt

All 9 comments

Hey there @home-assistant/core, @emontnemery, mind taking a look at this issue as its been labeled with an integration (mqtt) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

I have confirmed this is only happening with my lights. Outlets/switches with Tasmota update fine. Rolling back to 114 restores state status for these lights back to normal.

This is the prime suspect: #39325

@cogneato can you also share discovery message + resulting state update from Tasmota?

As an added data point, I use zigbee2mqtt as well. Those lights update in Home Assistant without issue. So it isn't all MQTT Lights.

Not sure if you still want this, but here's a debug log of an attempt to turn on the same bulb referenced in the issue:

2020-09-08 11:57:10 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=light, service=turn_on, service_data=entity_id=light.bulb010>
2020-09-08 11:57:10 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=mqtt, service=publish, service_data=topic=bulb010/cmnd/Dimmer, qos=0, retain=False, payload=100>
2020-09-08 11:57:10 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on bulb010/cmnd/Dimmer: '100', mid: 1078
2020-09-08 11:57:10 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on bulb010/tele/STATE: b'{"Time":"2020-09-08T17:57:10","Uptime":"0T01:49:20","UptimeSec":6560,"Heap":25,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Dimmer":100,"Color":"6,129,255,0","HSBColor":"210,98,100","White":0,"Channel":[2,51,100,0],"Scheme":0,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"BubbaIot_2G","BSSId":"E2:63:DA:AA:0B:4B","Channel":1,"RSSI":86,"Signal":-57,"LinkCount":1,"Downtime":"0T00:00:03"}}'

@emontnemery

Discovery

{"name":"desk","stat_t":"desk/tele/STATE","avty_t":"desk/tele/LWT","pl_avail":"Online","pl_not_avail":"Offline","cmd_t":"desk/cmnd/POWER","val_tpl":"{{value_json.POWER}}","pl_off":"OFF","pl_on":"ON","uniq_id":"A0424B_LI_1","dev":{"ids":["A0424B"]},"bri_cmd_t":"desk/cmnd/Dimmer","bri_stat_t":"desk/tele/STATE","bri_scl":100,"on_cmd_type":"brightness","bri_val_tpl":"{{value_json.Dimmer}}","rgb_cmd_t":"desk/cmnd/Color2","rgb_stat_t":"desk/tele/STATE","rgb_val_tpl":"{{value_json.Color.split(',')[0:3]|join(',')}}","fx_cmd_t":"desk/cmnd/Scheme","fx_stat_t":"desk/tele/STATE","fx_val_tpl":"{{value_json.Scheme}}","fx_list":["0","1","2","3","4"],"clr_temp_cmd_t":"desk/cmnd/CT","clr_temp_stat_t":"desk/tele/STATE","clr_temp_val_tpl":"{{value_json.CT}}","whit_val_cmd_t":"desk/cmnd/White","whit_val_stat_t":"desk/tele/STATE","whit_val_scl":100,"whit_val_tpl":"{{value_json.White}}"}

State

{"Time":"2020-09-08T18:07:56","Uptime":"0T00:15:13","UptimeSec":913,"Heap":25,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":1,"POWER":"ON","Dimmer":100,"Color":"0,0,0,59,196","HSBColor":"338,0,0","White":100,"CT":420,"Channel":[0,0,0,23,77],"Scheme":0,"Fade":"OFF","Speed":3,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"xxx","BSSId":"xxx","Channel":6,"RSSI":100,"Signal":-42,"LinkCount":1,"Downtime":"0T00:00:03"}}

HA log
```
2020-09-08 11:07:56 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on desk/tele/STATE: b'{"Time":"2020-09-08T18:07:56","Uptime":"0T00:15:13","UptimeSec":913,"Heap":25,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":1,"POWER":"ON","Dimmer":100,"Color":"0,0,0,59,196","HSBColor":"338,0,0","White":100,"CT":420,"Channel":[0,0,0,23,77],"Scheme":0,"Fade":"OFF","Speed":3,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"xxx","BSSId":"xxx","Channel":6,"RSSI":100,"Signal":-42,"LinkCount":1,"Downtime":"0T00:00:03"}}'

I just set up another bulb from scratch as it had been disconnected for a while and can share the same:

18:52:12 MQT: homeassistant/light/D3EBFD_LI_1/config = {"name":"Lampy","stat_t":"tele/lampy/STATE","avty_t":"tele/lampy/LWT","pl_avail":"Online","pl_not_avail":"Offline","cmd_t":"cmnd/lampy/POWER","val_tpl":"{{value_json.POWER}}","pl_off":"OFF","pl_on":"ON","uniq_id":"D3EBFD_LI_1","dev":{"ids":["D3EBFD"]},"bri_cmd_t":"cmnd/lampy/Dimmer","bri_stat_t":"tele/lampy/STATE","bri_scl":100,"on_cmd_type":"brightness","bri_val_tpl":"{{value_json.Dimmer}}","rgb_cmd_t":"cmnd/lampy/Color2","rgb_stat_t":"tele/lampy/STATE","rgb_val_tpl":"{{value_json.Color.split(',')[0:3]|join(',')}}","fx_cmd_t":"cmnd/lampy/Scheme","fx_stat_t":"tele/lampy/STATE","fx_val_tpl":"{{value_json.Scheme}}","fx_list":["0","1 ... (retained)
18:52:12 MQT: homeassistant/sensor/D3EBFD_status/config = {"name":"Lampy status","stat_t":"tele/lampy/HASS_STATE","avty_t":"tele/lampy/LWT","pl_avail":"Online","pl_not_avail":"Offline","json_attr_t":"tele/lampy/HASS_STATE","unit_of_meas":"%","val_tpl":"{{value_json['RSSI']}}","ic":"mdi:information-outline","uniq_id":"D3EBFD_status","dev":{"ids":["D3EBFD"],"name":"Lampy","mdl":"OM60/RGBW","sw":"8.5.0(tasmota)","mf":"Tasmota"}} (retained)
18:53:05 MQT: tele/lampy/STATE = {"Time":"2020-09-08T18:53:05","Uptime":"0T00:01:52","UptimeSec":112,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":99,"MqttCount":1,"POWER":"OFF","Dimmer":83,"Color":"212,21,161,0,0","HSBColor":"316,90,83","White":0,"CT":153,"Channel":[83,8,63,0,0],"Scheme":0,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"wovenomena","BSSId":"82:2A:A8:94:A0:DF","Channel":6,"RSSI":76,"Signal":-62,"LinkCount":1,"Downtime":"0T00:00:09"}}
18:53:05 MQT: stat/lampy/RESULT = {"POWER":"OFF"}
18:53:05 MQT: stat/lampy/POWER = OFF

Thank you both!
Would you mind giving the patch in #39820 a try?

The patch worked for me. I left comments on the PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aweb-01 picture aweb-01  路  3Comments

i-am-shodan picture i-am-shodan  路  3Comments

piitaya picture piitaya  路  3Comments

neonandu picture neonandu  路  3Comments

sogeniusio picture sogeniusio  路  3Comments