Retrieve data from a sensor in HA with Jinja template

How to retrieve data from a sensor in Home Assistant using a specific time in a Jinja template. Let say I want get value from sensor.television which had value at 10:00 yesterday.

Jinja templates can only access the current state value of entities and their attributes.

To access a previous state stored in the database use an SQL sensor.