Support Energy date picker? #463
Replies: 2 comments 8 replies
-
I second this request. It would enable a lot more entities to be graphed. This would be most useful to show data held in entities with state_class: total or state_class: total_increasing. For these entities the data is stored in the statistics table and it looks like a time-series table: column start_ts in the statistics table represents the time column (in UTC). The value to show is however harder to retrieve. Each time-frame's value must be calculated by taking the difference of the [sum] columns on 2 rows: the [sum] value of the row at the end of the time frame minus the [sum] value of the last row before the start of the time-frame. The recorder stores the statistics in 2 different time series:
Which results in this table:
To get the values per day, week, month, etc. one would simply sum up all the hourly values for that day, week, month, etc.. I very much would like to be able to create a graph from these total and total_increasing statistics, especially using the energy dashboard's date selection card as the selection criterium for the time-frame as was suggested by the OP. To give you an impression of which data could be easily put into a graph once this gets implemented, run the following query against your own homeassistant db:
|
Beta Was this translation helpful? Give feedback.
-
The Sankey Chart card supports having a date selector. It might be a good reference on how to implement it here. |
Beta Was this translation helpful? Give feedback.
-
It would be great if we could put an apex chart on a page containing type: energy-date-selection as mentioned here https://www.home-assistant.io/dashboards/energy/ and the apex chart adjust to match the dates/period in the picker. I'm sure it's possible using a combination of config template card and this websocket
but im yet to figure out how.
Any idea?
Beta Was this translation helpful? Give feedback.
All reactions