Collect long-term statistics #559
Replies: 7 comments 13 replies
|
I think we should use a modern take on Round-Robin-Databases (RRD) https://community.home-assistant.io/t/storing-your-very-long-history-rrd-recorder/222758 My custom component is based on the C library, but we could re-implement the RRD principles |
|
I think that this is a good idea. Decoupling the statistics from entity states will release us from constraints by the state machine. For example, this will also solve the often requested feature to import historical data into Home Assistant. Since this data is only used for rendering graphs, it's fine that it is no longer coupled to the state machine. I think that it's still good to keep track if a statistic belongs to an entity ID so we can easily show a graph in the more info dialog. Since not all imported statistics can be tied to an entity, should we allow linking it to a config entry ID? For time series, would you just want to save a dump every hour? How will that work if an integration can only import data that wraps 24 hours ? |
|
Thanks to @dgomes for pointing me to this discussion. Keeping aggregated data separate sounds like a good idea to reduce lock time of If you don't mind, I'll leave here a link to the RFC I've created today... maybe it will be useful for someone ...or maybe you can comment it - https://community.home-assistant.io/t/anyone-interested-in-a-reports-for-utility-meter-or-maybe-historical-sensor-value/304841?u=palivoda |
|
@rostislav-palivoda Thanks for linking to the community thread. Aggregating data from utility type meters (energy, gas, water) is one of the main drivers for adding statistics functionality. |
|
Future values Both weather data and energy prices have future data values.
Maybe we could add support for future values also? The data should be available both for visualization and automation. |
|
Hi guys! |
|
Issue is closed, but unanswered. Isn't the answer that (today) you can add a |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary:
Compile long term statistics.
We should be able to collect long-term statistics, for example year's worth of temperature measurement, energy usage etc. without relying on external tools.
High level proposal:
statestable which collects a much smaller amount of data and thus can store much longer periods of data (the recorder defaults to 10 days) without unreasonable growth of the database size.The new table would for example hold hourly min, max, mean for a temperature sensor and hourly consumption for a utility meter.
sensorandutility_meterintegrations.A proposed MVP is to implement 1, 2 (for a very limited set of entities) and 4
An initial draft of 1 and 2 is implemented in home-assistant/core#49852
All reactions