Hello Bieniu,
I don’t know if this problem lies with this script but after updating HA to 0.117.0 I have a problem with the status of 1 shelly. This is an existing shelly bulp that has worked perfectly.
I have deleted the shelly from MQTT devices and re-announce it but that won’t fix it. When i execute the announce script the latest state wil be updated in HA but I still can’t turn on the light. The following error wil be shown in the error log when i’m trying to switch it to on. Shelly bulp also works fine through its own interface. If I turn the lamp on or off there, I don’t see the status in HA either.
Logger: homeassistant.util.logging
Source: util/logging.py:108
First occurred: 2:05:36 PM (72 occurrences)
Last logged: 2:41:46 PM
Exception in state_received when handling msg on 'shellies/Shelly-woonkamerTV/light/0/status': '{"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"brightness":46,"white":0,"temp":2702}' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper msg_callback(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/light/schema_template.py", line 258, in state_received self._templates[ AttributeError: 'NoneType' object has no attribute 'async_render_with_possible_json_value'
Exception in state_received when handling msg on 'shellies/Shelly-woonkamerTV/light/0/status': '{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"brightness":46,"white":0,"temp":2702}' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper msg_callback(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/light/schema_template.py", line 258, in state_received self._templates[ AttributeError: 'NoneType' object has no attribute 'async_render_with_possible_json_value'
Debug log
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper
msg_callback(msg)
File "/usr/src/homeassistant/homeassistant/components/mqtt/light/schema_template.py", line 258, in state_received
self._templates[
AttributeError: 'NoneType' object has no attribute 'async_render_with_possible_json_value'
2020-10-29 14:48:59 ERROR (MainThread) [homeassistant.util.logging] Exception in state_received when handling msg on 'shellies/Shelly-woonkamerTV/light/0/status': '{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"brightness":46,"white":0,"temp":2702}'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper
msg_callback(msg)
File "/usr/src/homeassistant/homeassistant/components/mqtt/light/schema_template.py", line 258, in state_received
self._templates[
AttributeError: 'NoneType' object has no attribute 'async_render_with_possible_json_value'
2020-10-29 14:49:14 ERROR (MainThread) [homeassistant.util.logging] Exception in state_received when handling msg on 'shellies/Shelly-woonkamerTV/light/0/status': '{"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"brightness":2,"white":0,"temp":2702}'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper
msg_callback(msg)
File "/usr/src/homeassistant/homeassistant/components/mqtt/light/schema_template.py", line 258, in state_received
self._templates[
AttributeError: 'NoneType' object has no attribute 'async_render_with_possible_json_value'
2020-10-29 14:49:14 ERROR (MainThread) [homeassistant.util.logging] Exception in state_received when handling msg on 'shellies/Shelly-woonkamerTV/light/0/status': '{"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"brightness":46,"white":0,"temp":2702}'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 35, in wrapper
msg_callback(msg)
File "/usr/src/homeassistant/homeassistant/components/mqtt/light/schema_template.py", line 258, in state_received
self._templates[
AttributeError: 'NoneType' object has no attribute 'async_render_with_possible_json_value'
And the announce logging of this specific device:
2020-10-29 14:48:01 INFO (MainThread) [homeassistant.components.automation.shellies_discovery] Shellies Discovery: Running automation actions
2020-10-29 14:48:01 INFO (MainThread) [homeassistant.components.automation.shellies_discovery] Shellies Discovery: Executing step call service
2020-10-29 14:48:02 INFO (SyncWorker_30) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'Shelly-woonkamerTV', 'mac': 'BCDDC2663EEA', 'fw_ver': '20200827-065050/v1.8.3@4a8bc427', 'model': 'SHBDUO-1'}
2020-10-29 14:48:02 DEBUG (SyncWorker_30) [homeassistant.components.python_script.shellies_discovery.py] id: Shelly-woonkamerTV, mac: bcddc2663eea, fw_ver: 20200827-065050/v1.8.3@4a8bc427, model: SHBDUO-1
2020-10-29 14:48:02 DEBUG (SyncWorker_30) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/Shelly-woonkamerTV-rssi/config {"name": "Shelly DUO woonkamerTV RSSI", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shelly-woonkamertv-rssi", "qos": 0, "dev": {"ids": ["bcddc2663eea"], "name": "Shelly DUO woonkamerTV", "mdl": "Shelly DUO", "sw": "20200827-065050/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/Shelly-woonkamerTV/", "unit_of_meas": "dB", "dev_cla": "signal_strength", "val_tpl": "{{value_json['wifi_sta'].rssi}}", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-29 14:48:02 DEBUG (SyncWorker_30) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/Shelly-woonkamerTV-ssid/config {"name": "Shelly DUO woonkamerTV SSID", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shelly-woonkamertv-ssid", "qos": 0, "dev": {"ids": ["bcddc2663eea"], "name": "Shelly DUO woonkamerTV", "mdl": "Shelly DUO", "sw": "20200827-065050/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/Shelly-woonkamerTV/", "val_tpl": "{{value_json['wifi_sta'].ssid}}", "icon": "mdi:wifi", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-29 14:48:02 DEBUG (SyncWorker_30) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/Shelly-woonkamerTV-uptime/config {"name": "Shelly DUO woonkamerTV Uptime", "stat_t": "~info", "frc_upd": "False", "uniq_id": "shelly-woonkamertv-uptime", "qos": 0, "dev": {"ids": ["bcddc2663eea"], "name": "Shelly DUO woonkamerTV", "mdl": "Shelly DUO", "sw": "20200827-065050/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/Shelly-woonkamerTV/", "dev_cla": "timestamp", "val_tpl": "{{(as_timestamp(now())-value_json.uptime)|timestamp_local}}", "icon": "mdi:timer-outline", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false"}
2020-10-29 14:48:02 DEBUG (SyncWorker_30) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/binary_sensor/Shelly-woonkamerTV-firmware-update/config {"name": "Shelly DUO woonkamerTV Firmware Update", "stat_t": "~info", "uniq_id": "shelly-woonkamertv-firmware-update", "qos": 0, "dev": {"ids": ["bcddc2663eea"], "name": "Shelly DUO woonkamerTV", "mdl": "Shelly DUO", "sw": "20200827-065050/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/Shelly-woonkamerTV/", "val_tpl": "{%if value_json['update'].has_update==true%}ON{%else%}OFF{%endif%}", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "json_attr_t": "~info", "json_attr_tpl": "{{value_json['update']|tojson}}"}
2020-10-29 14:48:02 DEBUG (SyncWorker_30) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/light/Shelly-woonkamerTV-0/config {"schema":"template","name":"Shelly DUO woonkamerTV Light 0","cmd_t":"~light/0/set","stat_t":"~light/0/status","avty_t":"~online","pl_avail":"true","pl_not_avail":"false","cmd_on_tpl":"{\"turn\":\"on\"{%if brightness is defined%},\"brightness\":{{brightness|float|multiply(0.3922)|round}}{%endif%}{%if color_temp is defined%},\"temp\":{{(1000000/(color_temp|int))|round(0,\"floor\")}}{%endif%}}","cmd_off_tpl":"{\"turn\":\"off\"}","stat_tpl":"{%if value_json.ison%}on{%else%}off{%endif%}","bri_tpl":"{{value_json.brightness|float|multiply(2.55)|round}}","clr_temp_tpl":"{{((1000000/(value_json.temp|int,2700)|max)|round(0,\"floor\"))}}","max_mireds":370,"min_mireds":153,"uniq_id":"shelly-woonkamertv-light-0","qos":"0","dev": {"ids": ["bcddc2663eea"],"name":"Shelly DUO woonkamerTV","mdl":"Shelly DUO","sw":"20200827-065050/v1.8.3@4a8bc427","mf":"Allterco Robotics"},"~":"shellies/Shelly-woonkamerTV/"}
2020-10-29 14:48:02 DEBUG (SyncWorker_30) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/Shelly-woonkamerTV-white-energy-0/config {"name": "Shelly DUO woonkamerTV Energy 0", "stat_t": "~light/0/energy", "unit_of_meas": "kWh", "val_tpl": "{{(value|float/60/1000)|round(2)}}", "dev_cla": "energy", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "frc_upd": "False", "uniq_id": "shelly-woonkamertv-white-energy-0", "qos": 0, "dev": {"ids": ["bcddc2663eea"], "name": "Shelly DUO woonkamerTV", "mdl": "Shelly DUO", "sw": "20200827-065050/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/Shelly-woonkamerTV/"}
2020-10-29 14:48:02 DEBUG (SyncWorker_30) [homeassistant.components.python_script.shellies_discovery.py] Sending to MQTT broker: homeassistant/sensor/Shelly-woonkamerTV-white-power-0/config {"name": "Shelly DUO woonkamerTV Power 0", "stat_t": "~light/0/power", "unit_of_meas": "W", "val_tpl": "{{value|float|round(1)}}", "dev_cla": "power", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "frc_upd": "False", "uniq_id": "shelly-woonkamertv-white-power-0", "qos": 0, "dev": {"ids": ["bcddc2663eea"], "name": "Shelly DUO woonkamerTV", "mdl": "Shelly DUO", "sw": "20200827-065050/v1.8.3@4a8bc427", "mf": "Allterco Robotics"}, "~": "shellies/Shelly-woonkamerTV/"}