BenPru / luxtronik

Luxtronik integration for Home Assistant
MIT License
74 stars 28 forks source link

Wrong state class for flow_rate sensors #134

Closed rhammen closed 11 months ago

rhammen commented 1 year ago

After updating to Preview 2023.09.19:

2023-09-20 00:10:57.817 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.luxtronik2 entity: sensor.luxtronik2_heat_amount_flow_rate 2023-09-20 00:10:57.818 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.luxtronik2_heat_amount_flow_rate (<class 'custom_components.luxtronik2.sensor.LuxtronikSensorEntity'>) is using state class 'measurement' which is impossible considering device class ('water') it is using; expected None or one of 'total', 'total_increasing'; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

2023-09-20 00:10:57.825 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.luxtronik2 entity: sensor.luxtronik2_heat_source_flow_rate 2023-09-20 00:10:57.826 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.luxtronik2_heat_source_flow_rate (<class 'custom_components.luxtronik2.sensor.LuxtronikSensorEntity'>) is using state class 'measurement' which is impossible considering device class ('water') it is using; expected None or one of 'total', 'total_increasing'; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

rhammen commented 1 year ago

The flow-rate sensors have also problems with their unit:

2023-09-20 00:10:58.308 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.luxtronik2_heat_amount_flow_rate (<class 'custom_components.luxtronik2.sensor.LuxtronikSensorEntity'>) is using native unit of measurement 'l/h' which is not a valid unit for the device class ('water') it is using; expected one of ['ft³', 'CCF', 'L', 'm³', 'gal']; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author. 2023-09-20 00:10:58.312 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.luxtronik2_heat_source_flow_rate (<class 'custom_components.luxtronik2.sensor.LuxtronikSensorEntity'>) is using native unit of measurement 'l/h' which is not a valid unit for the device class ('water') it is using; expected one of ['ft³', 'CCF', 'L', 'm³', 'gal']; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

Kars-de-Jong commented 1 year ago

SensorDeviceClass.WATER is not correct. It is meant for water consumption meters. There is no predefined device class for flow at the moment. Just leave it out, it is not mandatory.

BenPru commented 1 year ago

Is this fixed?

rhammen commented 11 months ago

With the update, I did not see these errors any more.