Get History Record of a sensor in template

Hi Guys,

simple Question:

is there a way to get the history of an sensor-state?

I have a Growatt-inverter and can read two sensors: kWh today and kWh total:

{{ states('sensor.growatt_energytotal') | float(0) }}
{{ states('sensor.growatt_energytoday') | float(0) }}

Output is something like:
660.1
4.4

So good, so nice. But i want to display the kWh that my solarsystem generated yesterday - and display it in a entity-list. So i can’t use the core history graph.

Is there a way to get an array or record / history of that sensor?

Thanks a lot :slight_smile:

You can try with Apexcharts and an offset

If you want the value and not a graph use an SQL sensor.

There’s an example of retrieving a value from a day ago in the docs.