krbaker / hass-sunpower

Home Assistant SunPower Integration using the local installer ethernet interface.
Apache License 2.0
53 stars 22 forks source link

ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved #19

Closed garyak closed 2 months ago

garyak commented 2 years ago

Recurrring instances of this error in the logs following integration installation.

2021-12-10 08:28:45 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 134, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 486, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 519, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 492, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 273, in state
    value = self.native_value
  File "/config/custom_components/sunpower/sensor.py", line 213, in native_value
    return self.coordinator.data[METER_DEVICE_TYPE][self.base_unique_id][self._field]
KeyError: 'Power Meter'

Power meter not yet providing data: power

HA 2021.11.5, HAOS 6.6, Supervisor 2021.10.8

krbaker commented 2 months ago

the parsing robustness should have fixed this sort of error, feel free to reopen if this is seen again.