fsaris / home-assistant-zonneplan-one

Unofficial Zonneplan integration for Home Assistant
https://github.com/fsaris/home-assistant-zonneplan-one
MIT License
108 stars 18 forks source link

Incompatible state_class vs. device_class for sensor.zonneplan_one_omvormer_expected_surplus #137

Closed HindrikDeelstra closed 1 month ago

HindrikDeelstra commented 2 months ago

No info on when it started, I just updated to 2024.9. Now I'm getting the following warning in the HA logs:

2024-09-04 19:57:01.210 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.zonneplan_one_omvormer_expected_surplus (<class 'custom_components.zonneplan_one.sensor.ZonneplanPvSensor'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total', 'total_increasing'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/fsaris/home-assistant-zonneplan-one/issues

fsaris commented 1 month ago

@HindrikDeelstra can you check the main/beta version and validate the warning is gone?

HindrikDeelstra commented 1 month ago

I've installed the committed version via the new method https://hacs.xyz/docs/use/entities/update/#install-action, and restarted HA.

The warning is now indeed gone, and the state of the sensor seems to be without errors ;)

fsaris commented 1 month ago

https://github.com/fsaris/home-assistant-zonneplan-one/tree/2024.9.0