Get the value of a sensor at a specific time


I would like to get the state of a sensor at a specific historical time. I can see it in the graph in the UI, but would like to have an automation based on this.
Example: what was the value of the sensor 3 hours ago?

I searched a lot but couldn’t find anything…


This post here will help.

Thanks a lot @petro! Will try this…

Anyway, it’s strange that to have it in an easier way is not a wanted feature for a lot of people.

Oddly enough, not many people want this. I think I’ve seen ~4 posts over the past 4 years.

1 Like

Does seem like a odd use case. What automation would you want triggered specifically at a 3hr past moment in time?otherwsie historical values can be seen in the log charts, or grafana.