psimsa / oig_cloud

OIG Cloud Integration for hass
https://github.com/psimsa/oig_cloud
MIT License
15 stars 2 forks source link

5 entities became unavailable, already tried restarting and updating the addon #72

Closed Silenceikillyou closed 4 weeks ago

Silenceikillyou commented 1 month ago

affected entities: Battery Power -- sensor.oig_2106232048_batt_batt_comp_p Boiler - Current Energy (CBB) -- sensor.oig_2106232048_boiler_current_cbb_w Boiler - Current Energy (Computed) -- sensor.oig_2106232048_boiler_current_w Boiler - Today Energy -- sensor.oig_2106232048_boiler_day_w CBB - Consumption Energy (Computed) -- sensor.oig_2106232048_cbb_consumption_w

Accompanying error logs:

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:595 integration: Sensor (documentation, issues) First occurred: September 27, 2024 at 2:18:06 AM (1 occurrences) Last logged: September 27, 2024 at 2:18:06 AM

Error adding entity sensor.oig_2106232048_batt_batt_comp_p for domain sensor with platform oig_cloud
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 595, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 909, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1365, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/oig_cloud/oig_cloud_sensor.py", line 32, in async_added_to_hass
    self._handle_coordinator_update()
  File "/config/custom_components/oig_cloud/oig_cloud_sensor.py", line 26, 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 "/config/custom_components/oig_cloud/oig_cloud_computed_sensor.py", line 48, in state
    return float(pv_data["batt"]["bat_i"] * pv_data["batt"]["bat_v"] * -1)
                 ~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'bat_i'

Logger: homeassistant Source: custom_components/oig_cloud/oig_cloud_computed_sensor.py:48 integration: OIG Cloud (Čez Battery Box) (documentation, issues) First occurred: September 27, 2024 at 2:19:06 AM (5031 occurrences) Last logged: 2:31:48 PM

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/oig_cloud/oig_cloud_sensor.py", line 26, 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 "/config/custom_components/oig_cloud/oig_cloud_computed_sensor.py", line 48, in state
    return float(pv_data["batt"]["bat_i"] * pv_data["batt"]["bat_v"] * -1)
                 ~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'bat_i'
psimsa commented 1 month ago

Partially resolved in next release. Some values were removed by OIG though.

Silenceikillyou commented 1 month ago

thanks for the good work