maaxion / homeassistant2influxdb Goto Github PK
View Code? Open in Web Editor NEWThis project forked from dseifert/homeassistant2influxdb
Migration of Home Assistant's log database to InfluxDB
This project forked from dseifert/homeassistant2influxdb
Migration of Home Assistant's log database to InfluxDB
Hi, I'm trying to use the script to recover a hole of missing data in InfluxDB.
As I was using the SQLite DB created by HA 2022.8.1, I thought I should install the dependencies like so:
git clone https://github.com/Maaxion/homeassistant2influxdb migrate2influxdb
cd migrate2influxdb/
git clone --depth 1 --branch 2022.8.1 https://github.com/home-assistant/core.git home-assistant-core
python3 -m venv .venv
. .venv/bin/activate
pip install -r home-assistant-core/requirements.txt
pip install -r requirements.txt
python homeassistant2influxdb.py --type SQLite --database /mnt/hgfs/influxdb/image/home-assistant_v2.db --dry-run
When typing the last command I get this error:
(.venv) user@debian:~/mig/migrate2influxdb$ python homeassistant2influxdb.py --type SQLite --database /mnt/hgfs/influxdb/image/home-assistant_v2.db --dry-run
option --dry-run was given, nothing will be writen on InfluxDB
Migrating home assistant database statistics, states to Influx database /mnt/hgfs/influxdb/image/home-assistant_v2.db and bucket homeassistant_missing
Traceback (most recent call last):
File "/home/user/mig/migrate2influxdb/homeassistant2influxdb.py", line 358, in <module>
main()
File "/home/user/mig/migrate2influxdb/homeassistant2influxdb.py", line 151, in main
cursor.execute(tmp_table_query)
sqlite3.OperationalError: near "SELECT": syntax error
Can you please suggest what I'm doing wrong?
I also tried downloading the same HA version listed in the README, but I get the same error.
Looking at the sources, it seems to fail on:
homeassistant2influxdb/homeassistant2influxdb.py
Lines 345 to 350 in c25dc11
(.venv) user@debian:~/mig/migrate2influxdb$ sqlite3 /mnt/hgfs/influxdb/image/home-assistant_v2.db \
"SELECT max(states.attributes_id) as attributes_id, states.entity_id \
FROM states \
WHERE states.attributes_id IS NOT NULL \
GROUP BY states.entity_id;"
8984|switch.presa_mss310h_main_channel_2
66891|update.fritz1_fritz_os
66880|update.fritz2_fritz_os
66089|var.total_car_fuel_liters
181|var.zero_emissions_km
... CUT ...
71732|weather.casa
66854|zone.home
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.