cryptk / haomnilogic-local

A Home Assistant integration for Hayward OmniLogic/OmniHub pool controllers using the local UDP api
Apache License 2.0
19 stars 4 forks source link

Error doing job: Task exception was never retrieved (None) #123

Open twillux opened 2 weeks ago

twillux commented 2 weeks ago

I've been receiving thousands of errors in the HA log, and have noted that the water temperature sensor is continually stale requiring a restart of the Omnilogic Local integration to get a fresh reading.

Error below with diagnostics; any ideas on what may be the issue?

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/omnilogic_local/sensor.py:193
integration: OmniLogic Local (documentation, issues)
First occurred: 7:40:18 AM (30 occurrences)
Last logged: 7:46:11 AM

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/config/custom_components/omnilogic_local/entity.py", line 47, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 542, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/omnilogic_local/sensor.py", line 228, in native_value
    temp = self.sensed_data.telemetry.water_temp
           ^^^^^^^^^^^^^^^^
  File "/config/custom_components/omnilogic_local/sensor.py", line 187, in sensed_data
    return cast(T, self.coordinator.data[self.sensed_system_id])
                                         ^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/omnilogic_local/sensor.py", line 193, in sensed_system_id
    raise NotImplementedError
NotImplementedError

config_entry-omnilogic_local-e444094b4cd81f54f2adb25fdc924c1c.json

cryptk commented 1 week ago

From looking at your config, this is likely caused because you have a water temp sensor named "Chiller Temp" which isn't assigned to a BodyOfWater. This isn't something that I knew could be done (how would you sense the temperature of water if you aren't assigned to any water).

Can you give me a description of what this water temp sensor does so that I can think about how to best support it?

twillux commented 1 week ago

Great catch, this looks to have been the issue; very much appreciate your’ looking into this. I deleted the Chiller Temp sensor, reloaded the device and the repeating errors have cleared. Will continue to monitor.

The Omnilogic and OmniPL have three temperature inputs; two are typically always used for ambient and water temp, and the third is most typically used for a Solar system temperature. I installed a Glacier Chiller a few years ago with a return temp sensor and had hoped to use that third input to monitor and do some automations within HA; the API however has never returned that temp, so I abandoned it and created my own temperature input using an ESP32. I still had the configuration in the Omni there with the temp sensor assigned to the Backyard only, as you can’t assign it to the Heater/Chiller config within the Omni.

If I remember correctly, the API config request will pull in the third sensor definition if enabled when the MSP config is read, but the API won’t return a live reading. There was a request submitted to Hayward maybe a year ago but it’s still functionality that’s never been added to my knowledge.

Thanks again and feel free to mark this as resolved; I’d think my use case would be pretty uncommon and probably not worth modification to the integration.