Pull sensor history data from exact 24h ago

Hi,
I am wondering if there is possibility to read sensor history value using dynamic query like ‘now-24h’. I have PV and my inverter exposes entity for daily total production up to this moment: sensor.inverter_daily_yield. What I want to achieve is to see underneath it daily yield from same time yesterday. Is something like this even possible?

Doesn’t have to be real time, it can be done by some automation for example every 1 minute.

Yes you can use the SQL sensor to query the database to return that. There’s even an example query for exactly that in the SQL sensor documentation.

1 Like