I would like to get statistics about some sensors more even over years… I.e. I would like to see how many time the heater has been working (last month, last year, this year, etc…)…
I know you have https://www.home-assistant.io/components/sensor.history_stats/
to do this, but I dont know if this sensor can work with database recorder set to standard 10 days.
Obviously, I dont want to have a database with 5 years for all sensors, because of space disk ,startup time, etc. (i am runnig in a rpi3). Today I have purge_keep_days=10 days and a 300MB of database size.
I have about 200 entities from wich I would like to have record for a few (less than 10) for more than 1 year, a few 30-40 to have tipical record 10-30 days, and the rest of devices not recorded at all. This seems that cant be configured in “recoder” because you have whitelist and blacklist, but only a “purge_keep_days” global for all entities…
I have seen that HA design has poorly support for save permanent (or long live) state of things… I have seen restore_state @ https://www.home-assistant.io/components/recorder/ but it is suported by only a few components…
I would like to know If anyone has though something similar. At least for get a cummulative sensor that get the time activated from where you want, independent of your “purge_keep_days” database.
as @nickrout said, Influx is probably what you are after, as you can pipe into it whatever sensor’s you want, just one, or 10, and then just keep a record/database of them, then let Home Assistant do it’s home assistant’y things
I use it to keep a track of my temp and humidity sensors.
I have implemented something similar to this for one of my entities. It might not be the right solution for you since you’re wanting to track several entities but I’ll share anyways. May help you or someone else.
I wanted to track how many hours my heater/air conditioning have ran for the entire winter/summer season. I have a history_stats sensor that calculates how long it has been running today. I created an input_number sensor that I update the value of each night using an automation just before midnight before the daily history_stats sensor resets.
An optional step is to create a sensor that gives the state of the input_number so you have a read-only value in your front end instead of and editable input_number.
Just make sure that the input_number is set to restore_state so it won’t get reset when you restart Home Assistant.
Thanks Cee…
I think that has long term statistics of a house are things that a home assistant could do. You have history graphs that are so related with " home assistant’y things" as this long-term statistics.
For me, for example, can be very useful to know how it impacts an automate open-close blinds intelligently in the gas bill (or get info on how to equalize it).