ankohanse / hass-dab-pumps

Home Assistant Custom Integration for DAB Pumps via the DAB Live or DConnect service
MIT License
13 stars 2 forks source link

Sensors with device class 'water' and 'energy' are using state class 'measurement' which is impossible #6

Closed benjaminmurray closed 10 months ago

benjaminmurray commented 10 months ago

Describe the bug last_period_flow_counter is using state class 'measurement' which is impossible considering device class ('water') it is using; expected None or one of 'total_increasing', 'total'; last_period_energy_counter is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total_increasing', 'total';

To Reproduce Steps to reproduce the behavior:

  1. Added the integration with an esybox_mini_3
  2. Observed the above sensor configuration warnings in logs.

Expected behavior No configuration warnings in logs.

Screenshots Logger: homeassistant.components.sensor Source: components/sensor/init.py:528 Integration: Sensor (documentation, issues) First occurred: 2:43:42 PM (2 occurrences) Last logged: 2:43:42 PM

Entity sensor.esybox_mini_3_last_period_flow_counter (<class 'custom_components.dabpumps.sensor.DabPumpsSensor'>) is using state class 'measurement' which is impossible considering device class ('water') it is using; expected None or one of 'total_increasing', 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/ankohanse/hass-dab-pumps/issues Entity sensor.esybox_mini_3_last_period_energy_counter (<class 'custom_components.dabpumps.sensor.DabPumpsSensor'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total_increasing', 'total'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/ankohanse/hass-dab-pumps/issues

Additional context Thank you for developing this integration. I've been working on one myself, but found yours before I could finish it. Happy to contribute if I can.

ankohanse commented 10 months ago

Thank you for logging this issue, it is very helpfull for me to be notified of issues with other pumps (got a regular ESybox myself) .

I've now adapted the 'state_class' for 'last period flow counter' and 'last period energy counter'. Should be resolved in then next version v2023.12.5 which I will publish sometime in the next few days.