Long-term statistics for sensor values have been available in Home Assistant for some time. These long-term statistics are not affected by database purges, take up little space and are very useful for long-term analyses: https://data.home-assistant.io/docs/statistics/
It would be cool if the sensor values of the ha_toyota custom component were also included in these long-term statistics. As you can see in my screenshot from the "Developer Tools -> Statistics" section, only the current weekly, monthly and yearly statistics for my Corolla are currently included in the long-term statistics.
By the way, the "reichweite_corolla" sensor here is a self-made template sensor that determines the current remaining range based on the tank level according to the ha_toyota custom component ;-)
The inclusion of further ha_toyota senor values in these long-term statistics should not be a problem. All that needs to be done is to provide the sensors with a valid device_class, state_class and unit_of_measurement.
I'll see if I can find the time to get back into ha_toyota to create a pull request. In any case, I wanted to record it here in case I don't get around to it. Are there any other opinions or ideas?
Long-term statistics for sensor values have been available in Home Assistant for some time. These long-term statistics are not affected by database purges, take up little space and are very useful for long-term analyses: https://data.home-assistant.io/docs/statistics/
It would be cool if the sensor values of the ha_toyota custom component were also included in these long-term statistics. As you can see in my screenshot from the "Developer Tools -> Statistics" section, only the current weekly, monthly and yearly statistics for my Corolla are currently included in the long-term statistics. By the way, the "reichweite_corolla" sensor here is a self-made template sensor that determines the current remaining range based on the tank level according to the ha_toyota custom component ;-)
The inclusion of further ha_toyota senor values in these long-term statistics should not be a problem. All that needs to be done is to provide the sensors with a valid
device_class
,state_class
andunit_of_measurement
.An overview of the valid
device_class
options can be found here: https://developers.home-assistant.io/docs/core/entity/sensor/#available-device-classes An explanation of thestate_class
can be found here: https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statisticsI'll see if I can find the time to get back into ha_toyota to create a pull request. In any case, I wanted to record it here in case I don't get around to it. Are there any other opinions or ideas?