asantaga/wiserHomeAssistantPlatform

Error doing job: Task exception was never retrieved

Cocoon169 opened this issue · 15 comments

Hello,
I have integrated the Wiser system into Home Assistant for about a year. Since then there have never been any problems. But I've been having constant problems for about 2 weeks. Actually the system doesn't really work anymore. I also tried to restore the system via backup, unfortunately without success. Even a complete reinstallation of Home Assistant didn't help.
I don't know what to do anymore.

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant
Source: custom_components/wiser/sensor.py:1198
Integration: Drayton Wiser Integration for Home Assistant (documentation, issues)
First occurred: 15:21:03 (7 occurrences)
Last logged: 15:24:27

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 412, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
update_callback()
File "/config/custom_components/wiser/sensor.py", line 1198, in _handle_coordinator_update
self._data.wiserhub.devices.get_by_id(self._device_id).delivered_power
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:599
Integration: Klima (documentation, issues)
First occurred: 15:20:31 (1 occurrences)
Last logged: 15:20:31

wiser: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 599, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1259, in async_device_update
await self.async_update()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 530, in async_update
await self.coordinator.async_request_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 263, in async_request_refresh
await self._debounced_refresh.async_call()
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 93, in async_call
await task
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 289, in async_refresh
await self._async_refresh(log_failures=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 412, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
update_callback()
File "/config/custom_components/wiser/sensor.py", line 1198, in _handle_coordinator_update
self._data.wiserhub.devices.get_by_id(self._device_id).delivered_power
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

Have you unplugged a smartplug or something? I need to fix this bug but maybe you can get it up and running by removing it in the app and restarting HA.

The actual issue is that you have a smartplug that is not sending a delivered power value and the integration is not handling that.

Hello, I pulled out the smart plug and removed it from the app. It helped. But I also have 2 flush-mounted Wiser sockets. These have always worked without any problems. As soon as I turn this off. I get the same error messages again.

Home Assistant Core

Error doing job: Task exception was never retrieved
21:51:22 – (FEHLER) Drayton Wiser Integration for Home Assistant (benutzerdefinierte Integration) - Die Nachricht ist zum ersten Mal am 21:49:51 aufgetreten und erscheint 4 mal
wiser: Error on device update!
21:49:21 – (FEHLER) Klima
Validation of translation placeholders for localized (de) string component.wiser.config.step.zeroconf_confirm.title failed
21:49:20 – (FEHLER) helpers/translation.py - Die Nachricht ist zum ersten Mal am 21:49:20 aufgetreten und erscheint 2 mal

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant
Source: custom_components/wiser/sensor.py:1198
Integration: Drayton Wiser Integration for Home Assistant (documentation, issues)
First occurred: 21:49:51 (4 occurrences)
Last logged: 21:51:22

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 412, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
update_callback()
File "/config/custom_components/wiser/sensor.py", line 1198, in _handle_coordinator_update
self._data.wiserhub.devices.get_by_id(self._device_id).delivered_power
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:599
Integration: Klima (documentation, issues)
First occurred: 21:49:21 (1 occurrences)
Last logged: 21:49:21

wiser: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 599, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1259, in async_device_update
await self.async_update()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 530, in async_update
await self.coordinator.async_request_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 263, in async_request_refresh
await self._debounced_refresh.async_call()
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 93, in async_call
await task
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 289, in async_refresh
await self._async_refresh(log_failures=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 412, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
update_callback()
File "/config/custom_components/wiser/sensor.py", line 1198, in _handle_coordinator_update
self._data.wiserhub.devices.get_by_id(self._device_id).delivered_power
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

Logger: homeassistant.helpers.translation
Source: helpers/translation.py:288
First occurred: 21:49:20 (2 occurrences)
Last logged: 21:49:20

Validation of translation placeholders for localized (de) string component.wiser.config.step.zeroconf_confirm.title failed
Validation of translation placeholders for localized (de) string component.wiser.config.step.zeroconf_confirm.description failed

Ok, likley today there will be an update to try and fix these. The real pain is that a quick update I did the other day broke the diagnostics (it's all about testing! :-)). If this next release does not fix the issue, can you send me a diagnostic download (will be fixed in next release). I am not sure we fully support Wiser plug sockets and maybe they are somewhat different than plugs.

Ok, v3.4.4 released. Can you please test and let me know if resolved.

Hello, now nothing works at all. Cannot connect to the hub at all

Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
First occurred: 07:23:44 (1 occurrences)
Last logged: 07:23:44

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 91, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 72, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 185, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 358, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 404, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 501, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wiser/config_flow.py", line 180, in async_step_zeroconf_confirm
validated = await validate_input(self.hass, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/wiser/config_flow.py", line 68, in validate_input
wiserhub = WiserAPI(
^^^^^^^^^
TypeError: WiserAPI.init() got an unexpected keyword argument 'session'

Oh. I'll fix today. Im the meantime you can downgrade back to 3.4.3.

I've already tried. The error remains.

ok, I have just released v3.4.5. Can you update to that and setup should work. I think your original issue should also be fixed but would really welcome a diagnostics file for future testing and to see why this issue happened in the first place.

Hello,
everything works again!!! :-) Well done!!

Great. Glad we got sorted. Let me know if you have any more issues.