Query Sensor Values from Home Assistant database

Hello, I would like to query the sqlite3 database for the values of my esphome temperature sensor.
I tried the short tutorial here but I could not figure out how to get the actual sensor values.
What interests me is the latest value that was stored for entity_id “sensor.temp”.
Does someone know the sqlite command for that?

You don’t have to query the recorder database if you want to use the state in Home Assistant. What are you actually trying to accomplish?

Don’t describe how you are trying to do it, describe what you want as an end goal. https://en.wikipedia.org/wiki/XY_problem

hi @tom_l, thanks for your answer!
What I want to accomplish is to simply query the values from the database in order to use them somewhere else than Home Assistant.
I want to publish the temperature on a public website for example.

Just interrogate the Home Assistant API to get the state of an entity ( get /api/states/<entity_id> )

perfect, that’s exactly what I was looking for :slight_smile: Thanks a lot!

Can you also Set Values?