StyraHem / ShellyForHASS

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

[BUG] ERROR (CoAP) [pyShelly] Error receive CoAP Traceback #514

Closed lebherz closed 3 years ago

lebherz commented 3 years ago

Environment

Describe the bug

Error in Log similar #354 Log of Homeassistant 2021.1.1: ` 2021-01-13 22:52:04 ERROR (Poll status) [pyShelly] Error update device status: 00AF76-2 SHSW-25, , Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 197, in update_status_information dev.raise_updated(force_update_devices) 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

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 197, in update_status_information dev.raise_updated(force_update_devices) 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 2021-01-13 22:52:06 ERROR (CoAP) [pyShelly] Error receive CoAP Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 182, in _loop self._root.update_block(device_id, device_type, File "/usr/local/lib/python3.8/site-packages/pyShelly/init.py", line 281, in update_block block.update_coap(data, ipaddr) File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 93, 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 2021-01-13 22:52:09 ERROR (CoAP) [pyShelly] Error receive CoAP Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 182, in _loop self._root.update_block(device_id, device_type, File "/usr/local/lib/python3.8/site-packages/pyShelly/init.py", line 281, in update_block block.update_coap(data, ipaddr) File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 93, 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 2021-01-13 22:52:10 ERROR (CoAP) [pyShelly] Error receive CoAP Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 182, in _loop self._root.update_block(device_id, device_type, File "/usr/local/lib/python3.8/site-packages/pyShelly/init.py", line 281, in update_block block.update_coap(data, ipaddr) File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 93, 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`

since today (2021-01-14) Log of Homeassistant 2021.1.2 ` 2021-01-14 23:14:54 ERROR (Poll status) [pyShelly] Error update device status: 68C63AFACA63 SHEM-3, , Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 197, in update_status_information dev.raise_updated(force_update_devices) 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

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 197, in update_status_information dev.raise_updated(force_update_devices) 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 2021-01-14 23:14:54 ERROR (Poll status) [pyShelly] Error update device status: 68C63AFACA63-1 SHEM-3, , Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 197, in update_status_information dev.raise_updated(force_update_devices) 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

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 197, in update_status_information dev.raise_updated(force_update_devices) 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 2021-01-14 23:14:54 ERROR (Poll status) [pyShelly] Error update device status: 68C63AFACA63-2 SHEM-3, , Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 197, in update_status_information dev.raise_updated(force_update_devices) 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

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 197, in update_status_information dev.raise_updated(force_update_devices) 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 2021-01-14 23:14:54 ERROR (Poll status) [pyShelly] Error update device status: 68C63AFACA63-3 SHEM-3, , Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 197, in update_status_information dev.raise_updated(force_update_devices) 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

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 197, in update_status_information dev.raise_updated(force_update_devices) 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 `

Steps to Reproduce

every seconds after reboot

Expected behavior

Screenshots

Traceback/Error logs

see above

Additional context

hakana commented 3 years ago

You probably have an earlier error that causes this error. Can you have a look.

lebherz commented 3 years ago

Hi @hakana!

the Error is gone in the last HA security updates.. now I only see somethink like this and should be something else:

2021-01-24 21:44:07 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/shelly/__init__.py", line 199, in start_up
pys.start()
File "/usr/local/lib/python3.8/site-packages/pyShelly/__init__.py", line 147, in start
self._coap.start()
File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 27, in start
self._init_socket()
File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 44, in _init_socket
socket.inet_aton(self._root.host_ip))
OSError: illegal IP address string passed to inet_aton
2021-01-24 21:44:07 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/shelly/__init__.py", line 199, in start_up
pys.start()
File "/usr/local/lib/python3.8/site-packages/pyShelly/__init__.py", line 151, in start
self._mqtt.start()
File "/usr/local/lib/python3.8/site-packages/pyShelly/mqtt.py", line 97, in start
self._init_socket()
File "/usr/local/lib/python3.8/site-packages/pyShelly/mqtt.py", line 103, in _init_socket
sock.bind((self._root.bind_ip, self._root.mqtt_port))
OSError: [Errno 98] Address in use

I will close this issue :)