StyraHem / ShellyForHASS

Shelly smart home platform for Home Assistant
MIT License
623 stars 112 forks source link

[BUG] Error in logs after upgrade core-2021.2.0 #520

Open welcoMattic opened 3 years ago

welcoMattic commented 3 years ago

Environment

Describe the bug

Some Shelly entities are still unavailable (device temperature, over temperature for example), even after a reload of the integration or a OS reboot, they are still unavailable

Steps to Reproduce

Update to core-2021.2.0

Expected behavior

Screenshots

Traceback/Error logs

2021-02-04 11:23:36 ERROR (CoAP) [pyShelly] Error receive CoAP
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 184, in _loop
    self._root.update_block(device_id, device_type,
  File "/usr/local/lib/python3.8/site-packages/pyShelly/__init__.py", line 262, in update_block
    block.update_coap(data, ipaddr)
  File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 92, in update_coap
    dev.raise_updated()
  File "/usr/local/lib/python3.8/site-packages/pyShelly/base.py", line 36, in raise_updated
    callback(self)
  File "/config/custom_components/shelly/device.py", line 59, in _updated
    self._update_ha_state()
  File "/config/custom_components/shelly/device.py", line 51, in _update_ha_state
    self.schedule_update_ha_state(True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 422, in schedule_update_ha_state
    assert self.hass is not None
AssertionError

Additional context

sir106 commented 3 years ago

have the same Issue (core 2021.2.3) // (supervisor 2021.02.11)

Logger: pyShelly Source: helpers/entity.py:422 First occurred: 0:04:23 (40 occurrences) Last logged: 0:06:09

Error receive CoAP Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 186, in _loop self._root.update_block(device_id, device_type, File "/usr/local/lib/python3.8/site-packages/pyShelly/init.py", line 305, in update_block block.update_coap(data, ipaddr) File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 100, in update_coap dev.update_coap(payload) File "/usr/local/lib/python3.8/site-packages/pyShelly/switch.py", line 79, in update_coap self.__update(state, event_cnt, last_event, SRC_COAP) File "/usr/local/lib/python3.8/site-packages/pyShelly/switch.py", line 61, in __update self._update(src, state, {'last_event' : self.last_event, File "/usr/local/lib/python3.8/site-packages/pyShelly/device.py", line 107, in _update self.raise_updated() File "/usr/local/lib/python3.8/site-packages/pyShelly/base.py", line 45, in raise_updated callback(self) File "/config/custom_components/shelly/device.py", line 58, in _updated self._update_ha_state() File "/config/custom_components/shelly/device.py", line 51, in _update_ha_state self.schedule_update_ha_state(True) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 422, in schedule_update_ha_state assert self.hass is not None AssertionError

hakana commented 3 years ago

Can you see some errors before this from pyShelly? Normaly this error depends on some other errors before.

mike1627 commented 3 years ago

I'm having some similar issues, only after I upgraded to 0.2.2.beta.2. Just recently updated to Home Assistant OS 5.12 running Home Assistant 2021.2.3/supervisor-2021.02.11. After I installed beta 2 my Home Assistant crashes shortly (1-2 mins) after boot, log file looks similar to the above errors. I was able to get my Home Assistant functional again by uninstalling ShellyForHASS, then reinstalling ShellyForHASS rolled back to beta 1.

waroen commented 3 years ago

I'm seeing these errors, running 0.2.2.beta1, and then the CoAP error.

2021-03-05 00:30:49 ERROR (Poll status) [root] Uncaught thread exception Traceback (most recent call last): File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/local/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 187, in update_status_information self.raise_updated() File "/usr/local/lib/python3.8/site-packages/pyShelly/base.py", line 36, in raise_updated callback(self) File "/config/custom_components/shelly/block.py", line 68, in _updated self._update_ha_state() File "/config/custom_components/shelly/block.py", line 60, in _update_ha_state self.schedule_update_ha_state(True) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 421, in schedule_update_ha_state assert self.hass is not None AssertionError

hakana commented 3 years ago

This error is because of an earlier error in the log. I need the earlier error log to be able to see why.

ckarrie commented 3 years ago

I resolved this by deactivating duplicate Shelly integrations in Lovelance UI.