I can’t find anything related to that (Problably my fault), but I can’t figure if it’s possible to retrieve the state of a sensor in the past.
What I want to do is create an automation that sends me each evening if my house is hotter or colder than yesterday.
I’ve been playing with templating and I did not found anything regarding querying through history.
Is there something I’m missing? Is there another way to do what I want to do? (Have a template_sensor that records only the sensor temperature at a given hour?)
If you are using nodered this is quite easy with “get history” node.
It uses the home asistant API.
OR
can be used, with history api direct from an automation. You setup a rest command then that will gives you a new service rest_command.<the_name_of_your_rest_command> that you will be able to call from an automation. (you’ll need an long lived access token that you can get from your profile page on frontend, it will replace the ABCDEFGH in my example)
Example :
you can have an automation, triggered at any time you decide you need it, eg daily at 23.59, to record the value you want using the custom_component variable, and see/use the history of that value.