klejejs / ha-thermia-heat-pump-integration

Thermia Heat Pump Integration for Home Assistant
GNU General Public License v3.0
31 stars 7 forks source link

Error loading sensor #14

Closed andeny closed 2 years ago

andeny commented 2 years ago

i updated my homeassistant to latest and got this error

Logger: homeassistant.components.sensor Source: helpers/entity.py:220 Integration: Sensor (documentation, issues) First occurred: 09:21:01 (4 occurrences) Last logged: 09:22:37

Error adding entities for domain sensor with platform thermia Error while setting up thermia platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in _async_add_entity entry = entity_registry.async_get_or_create( File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 401, in async_get_or_create entity_category=_convert_to_entity_category(entity_category), File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 103, in _convert_to_entity_category return convert_to_entity_category(value, raise_report=raise_report) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 220, in convert_to_entity_category return EntityCategory(value) File "/usr/local/lib/python3.9/enum.py", line 384, in call return cls.new(cls, value) File "/usr/local/lib/python3.9/enum.py", line 702, in new raise ve_exc ValueError: 'sensor' is not a valid EntityCategory

I think it is connected to a change in home assistant handling sensors and i also get this error:

Logger: homeassistant.helpers.frame Source: helpers/frame.py:74 First occurred: 09:21:01 (16 occurrences) Last logged: 09:22:37

Detected code that uses str (sensor) for entity category. This is deprecated and will stop working in Home Assistant 2022.4, it should be updated to use EntityCategory instead. Please report this issue.

can you help with this ? it does not load the temp sensors any moore, see attached picture thermia

@klejejs

klejejs commented 2 years ago

I have released a new version that fixes the problem. In case you have an issue of HA not starting, please delete thermia folder from config/custom_components directory and also please edit config/.storage/core.entity_registry file and delete all objects that include "device_class": "sensor" to make sure that the issue does not appear again. After doing this and restarting Home Assistant, you should be able to redownload the integration from HACS and everything will be working. No need to re-add heat pumps. Sorry for the inconvenience :(.

andeny commented 2 years ago

Thanks, great work. Now it shows up as before🙂

klejejs commented 2 years ago

Actually kudos to @danialclements, he fixed the issue.