I needed a solution for my very large Home Assistant database of 27 GB (growing by the minute).
After a quick search I decided to go with InfluxDB and Grafana.
Unfortunately, Home Assistant doesn’t have a built-in way to migrate historical data to InfluxDB. Since I couldn’t find any recent discussions or solutions for this, I teamed up with ChatGPT to create a Python script that copies Home Assistant historical data from an SQLite database to an InfluxDB bucket.
Tested with Home Assistant Core 2024.10.1 and InfluxDB v2.7.10.
I run both HA, Influx and Grafana in separate Dockers.
You can check it out on GitHub:
My next step is to create a nice Grafana Dashboard.
Comments or hits are welcome!
I’ve been using influxdb for more than a year now. Could I use your script to import only the data that aren’t in influx db yet? Does your script check the existing data in influx, or it duplicates them?