mmillmor / geo_home

Geo Home smart meter integration for Home Assistant
Apache License 2.0
25 stars 4 forks source link

Enable Home Assistant long term statistics #35

Closed rmtsrc closed 11 months ago

rmtsrc commented 11 months ago

Home Assistant 2023.12 added long term statistics to the history graphs.

Out of the box this worked with most of the Geo Home statistics, however a couple of them were missing an _attr_state_class which is required for recording long term statistics, so these statistics were lost after the default data retention period (defaults to 10 days).

Note that long term statistics only starts recording from the moment that a sensor has these 3 attributes (device_class, state_class, native_unit_of_measurement), so it will take around 10 days for the long term statistics to start appearing (which I've been testing on my install).

Before:

Screenshot from 2023-12-22 09-25-49

After:

Screenshot from 2023-12-22 09-25-13