I am working on a custom dashboard. I have several Monthly, Daily and Yearly utility sensors that store kWh. I also have a lifetime sensor for most of my devices that will increase every day.
Now, I have a date picker and an input_select on my dash.
The user can select in the input_select a device, and in the datepicker he/she can select a date.
How do I access my sensor to get the kWh value from that day?
I can access it using sql but then I have to hard code everything. I have the date (year, month, day) and the name of the sensor as parameters.
I dont want to use grafana, influx or the energy dashboard. I want to access all the nice info that my unility sensors store for me.
For a sensor that tracks values daily it is a very basic requirement to access all those daily values. FOr some reason, the only attribute available is the “last”… ?
Generally the only easy way to view history in core home-assistant frontend is with a history graph or a statistics graph.
The cards are typically not that dynamic that you can change their behavior through an input_select either.
There are some new features in 2025.2 and 2025.3 that let you drive a statistics graph and statistics card respectively from an energy-date-picker card, so at least you can surf the history around that way, but that won’t help you dynamically change the entity.
You can maybe achieve some of that with a custom card that allows you to wrap card configs in templates, and do some templating work. The name of this card escapes me at the moment but it’s probably not too hard to find.
I appreciate your reply, but I am not interested in using any other cards other than the ones I make. It is way too difficult to style the built in cards to my exact needs. I just need the raw data from LTS, nothing more, nothing less. I can access it with the SQL, but for some unknown reason, parameters are not allowed there so I can’t pass a date as parameter, which makes it totally pointless IMHO. Who is interested in static SQL queries?
I managed to get something working with the REST api api/history/period, but now I found a thread stating that I dont get LTS if I go past 10 days which is the recorder purge date. I totally hope that is NOT the case, or I am about to throw HA out the window.