KoljaWindeler / kaco

custom integration for kaco solar inverter
12 stars 7 forks source link

Current Power no longer available with HA 2023.02 #10

Closed Kurisutian closed 1 year ago

Kurisutian commented 1 year ago

Version of the custom_component

0.1.0

Configuration

Configuration was done through the UI so I do not have any YAML file here. Kept all default values and checked all boxes that can be enabled in the UI.

Describe the bug

After upgrading my HA to version 2023.02 I do no longer see the current power being created. The sensor has become unavailable and I have no more option to view how much power is currently created.

Debug log


Logger: homeassistant.components.sensor
Source: util/unit_conversion.py:91
Integration: Sensor (documentation, issues)
First occurred: 09:17:53 (3 occurrences)
Last logged: 09:17:53

Error adding entities for domain sensor with platform kaco
Error while setting up kaco platform for sensor
kaco: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 814, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 566, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 607, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 641, in state
    converter.get_unit_ratio(
  File "/usr/src/homeassistant/homeassistant/util/unit_conversion.py", line 91, in get_unit_ratio
    return cls._UNIT_CONVERSION[from_unit] / cls._UNIT_CONVERSION[to_unit]
KeyError: None
copadewe commented 1 year ago

Same here, wondering why I did not have the sensor, makes sense yesterday was the update:

2023-02-03 11:44:26.223 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up kaco platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in _async_setup_platform await asyncio.gather(pending) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities await asyncio.gather(tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 814, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 566, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 607, in _async_write_ha_state state = self._stringify_state(available) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 641, in state converter.get_unit_ratio( File "/usr/src/homeassistant/homeassistant/util/unit_conversion.py", line 91, in get_unit_ratio return cls._UNIT_CONVERSION[from_unit] / cls._UNIT_CONVERSION[to_unit] KeyError: None 2023-02-03 11:44:26.238 ERROR (MainThread) [homeassistant.components.sensor] kaco: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 739, in async_device_update await task File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 428, in async_update await self.coordinator.async_request_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 189, in async_request_refresh await self._debounced_refresh.async_call() File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 82, in async_call await task File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 215, in async_refresh await self._async_refresh(log_failures=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 330, in _async_refresh self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 135, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 390, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 566, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 607, in _async_write_ha_state state = self._stringify_state(available) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 641, in state converter.get_unit_ratio( File "/usr/src/homeassistant/homeassistant/util/unit_conversion.py", line 91, in get_unit_ratio return cls._UNIT_CONVERSION[from_unit] / cls._UNIT_CONVERSION[to_unit] KeyError: None

rfpronk commented 1 year ago

Same here. Debugging the code to see why the unit conversion fails (that's where it errors) I'm suspecting this broke after home-assistant/core/pull/85694

copadewe commented 1 year ago

You´r great, I have no idea how to solve this :) Need to wait for an updated integration.