I would like to have a statistics graph showing me how much energy was used during that hour in a bar chart. But whenever I add the card and point it towards a sensor outputting kwh, I can only show the summed value meaning I see it grow during the day.
For example; I have put the dryer power consumption (measured via a power plug) through the utility meter:
There seems to be a native solution! It’s currently not configurable via the UI, but it does exactly what I want. It’s the statistics card with stat_types state that does the trick:
chart_type: bar
title: Last 24 Hours
period: hour
days_to_show: 1
type: statistics-graph
entities:
- sensor.garage_dryer_energy_spent_hourly
stat_types:
- state
@TheNr1Guest how did you get it to show hourly use instead of summed value? I tried your code and also now you can select state as an option in the UI but I still get a summed value. Thank you!
@krkr Hmm, I have not upgraded to the latest version yet so I hope this is not something that changed. But the above code still works for me. Are you sure you are using a sensor reporting hourly values? So if you look at the sensor history, do you see it dip back to 0 every hour?
Thank you for your reply. Now, I believe it does not dip back to 0. At the same time, I have the same entity added to the Energy Dashboard and there I can see the energy use per hour.
Maybe it will help if I explain the use case. I am very happy with the Energy Dashboard. I recently started experimenting with adding not only a total energy use entity to it but rather showing the total enery split into several devices so something like heat pump energy consumption + fridge + freezer + other energy consumption - this adds up to the total energy consumption but shows it as a nice stacked graph. Since this setup required creation of new entities based on templates, I only have statistics for the past day. I like the option to compare energy use between days/weeks etc so I started wondering if I could re-create the total energy consumption graph and for this I need it to display an hourly use. Maybe I need another template where I state that the state of this entity resets every hour or so?
Either way, all of this is only a workaround. I would prefer to be able to add a nice stacked graph and keep the Energy Dashboard simple. I will try with the Apex card.
Hello!
I have a sensor that calculates the hourly exportation (positive) or importation (negative) amount of electricity to/from the grid, resetting every hour (Riemann integral).
I’d like to get the last value of this sensor before it resets in a bar chart, taking into account that I can have a value of 1.2 kWh at 12.30 but a value of 0.5 kWh at 12.59 (so I cannot use the max value).