Populating recorder with states

Hi there,

I would like to feed some sensors with historical values (so that they then are available e.g. for graph cards to plot) - is there any known way to do this?

Thanks in advance
Best regards
DBa

take a look at this

Yeah, I am already using an SQL sensor in order to show the “last time a certain motion sensor was active” in a badge, but the point is that the “states” table contains a “state_id”, which seems to be a primary index and a running number - and I have no idea how to generate it. Plus, I don’t know whether I can insert there withzout populating “events”, too.
If you were thinking of using this as a SQL query for a sensor value…Does not work since it would record only the current value and I want history to be there.

tbh I don’t understand your goal - could you explain it in other words and giving an example maybe? :wink:

Okay… Following is my issue: I noticed that new “Coronavirus” integration in the recent HASS versions and activated it (and also added it to a mini-graph card). However, the data is recorded only since I activated it, which means that I see only the few past days. In order to see the entire curve in my country though, I would like to manually insert the data for the past, too.

so you want to add external data to HA sensor’s data stored in the DB?
huh… it should be possible but it’s completely outside HA - you just need to modify your DB properly if I get it right.