2021.9 Sensor Statistics Changes
mjmeli opened this issue · 3 comments
In 2021.9, Home Assistant is changing how long-term statistics are supported on sensors. This is a breaking change for how the data gets into the energy dashboard.
Currently: use state_class measurement
and set the last_reset
state attribute when the meter ticks over
After 2021.9: use state_class total_increasing
(STATE_CLASS_TOTAL_INCREASING
) without the last_reset
state attribute
https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics
Sensor not working after updating to 2021.9, getting this error:
Unable to prepare setup for platform duke_energy_gateway.sensor: Platform not found (cannot import name 'STATE_CLASS_TOTAL_INCREASING' from 'homeassistant.components.sensor'
@griffincorriher you shouldn't be hitting that in 2021.9. It sounds stupid but I'd double check you actually are running that version. They did a rollback of 2021.9.0 at some point. I'm running 2021.9.2.
@griffincorriher you shouldn't be hitting that in 2021.9. It sounds stupid but I'd double check you actually are running that version. They did a rollback of 2021.9.0 at some point. I'm running 2021.9.2.
I just checked and it was not on the newest version, I guess my update didn't work. Thanks for the help, awesome integration!