Converting influxdb db into a home assistant format

Hi,

I am intending to move from a different home automation to HA.
In the other system I have recorded data for some time which I want to reuse in HA.

My approach would be that I access the old data and rewrite the data points into a home assistant compatible format.
Does anyone has some code that I can adopt for my needs?

Help is really appreciated.

Writing historical data into HA is kind of a grown upon thing.
There is the Spooky integration, which Frenck use to publish features that the HA dev team otherwise do not want to support and that integration contains a service call to add historical data to the HA database.

The only other method known to me is to add it directly to the database, but you need to understand the complex database scheme used by HA.

Thanks for the reply. It sounds pretty complicated. :frowning:

I’m not sure why would would need to bring that older data into HA. If you setup the InfluxDB integration in HA, it will start pushing data into InfluxDB. Then, using something like Grafana, you could merge the datasets there and have access to both your old data and new data.

However, if you really want to pull the old data out of InfluxDB and into HA, you’ll have to jump through some pretty large hoops. Mostly because whatever your old home automation platform was, it won’t have the same entities or IDs that HA uses. So, you’d have to basically integrate the devices into HA and then try to figure out how to map the old data points to the new schema. I’m not sure that’s something anyone really wants to do.

Thanks for the feedback.

The approach I am pursuing is the following.
I have written an AppDaemon Script that uses the Rest API of influxdb.
In this script the data of HA entities is written to my “legacy db” influxdb.

The benefit is that all the Grafana diagram and respective queries do not need a change.