Skip to content
This repository was archived by the owner on Jun 27, 2022. It is now read-only.

Wip#4

Open
ladlap45 wants to merge 4 commits into
dseifert:masterfrom
ladlap45:wip
Open

Wip#4
ladlap45 wants to merge 4 commits into
dseifert:masterfrom
ladlap45:wip

Conversation

@ladlap45

Copy link
Copy Markdown

Thanks for the original code.
Unfortunately I encourtered errors, I guess database format has changed on Home Assistant.
I adapted SQL code to new database design to transfer data from table "states" to influxdb. Then I decided I wanted to transfer also data from table "statistics" so I added an optional argument to choose from which table you want to get data.

This worked for me (tested only with sqlite3 as source database), I hope this will do the trick for you also.

fabyte and others added 4 commits January 9, 2021 19:30
Initially, MySQL/MariaDb and SQLite are supported.
Add support for different database types
- works even when mysql driver is not installed (when using sqlite of course)
- I had to correct handling of dates (calling homeassistant util/dt fonction to parse string)
- added option --dry-run to test everything bit writing to influxdb
- added option --table to choose if we want to transfert data from table "states" or from table "statistics"
  by default "states" only keeps 10 days of data but "statistics" keeps hourly data without limit
  so this might be a good point to retrieve these data too.

This code worked for me and I was able to retreive both states and statistics data on my systems.
I saw on the forums that several others encountered the same bugs and error messages I had to correct
so I decided to PR this code
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants