Hi, welcome to my attempt at importing data into Home Assistant. The Goal is to import data from
At this point the import tool is usable, but you have to be somewhat of a techy to get the options right. This is not an add-on, but a tool that's creates SQL scripts that import data into Home Assistant.
I could look at these charts like.. forever :heart:
This tool relies fully on the Home Assistant Community Add-on: SQLite Web. You need to have this installed and know a bit about SQL-queries before continuing.
There is also a thread on the home-assistant community about importing history.
ALWAYS create a backup before experimenting.
Download a release for linux or windows, unzip and (for Windows) run Home Assistant Import.exe
. There is no need to compile the code yourself.
Follow the steps in the application. Any red text indicates an error and means it will take more time to find out why this is happening.
In Home Assistent it is possible to find and edit weird imported data in "Developer tools > Statistics". Find the sensor, click on the graph icon and see "Outliers". There you can adjust values.
Any Meter & Multimeter values can be imported from Domoticz database file. Export the database directly from the dashboard.
A specific configuration of the SMA CVS file is supported at this moment. Follow the tools instructions to create an import script. You can get your export from your SMA webportal. Carefully select the starting date, as the export may give random values if the unit had no values.
SMA has a pretty bespoke specification, so in deviceSma.js a lot or lines are being skipped and it has a custom dateformat. Only first two columns matter, the date and TotWhOut.
sep=,
Version CSV3|Tool WebUI|Linebreaks CR/LF|Delimiter comma
,SN: 1234567890,SN: 1234567890,SN: 1234567890,SN: 1234567890
,SUNNY TRIPOWER 4.0,SUNNY TRIPOWER 4.0,SUNNY TRIPOWER 4.0,SUNNY TRIPOWER 4.0
,1234567890,1234567890,1234567890,1234567890
,Metering.TotWhOut,Metering.GridMs.TotWhOut,Metering.GridMs.TotWhIn,TotVal.TotCsmp
,Analog,Analog,Analog,Analog
DD.MM.YYYY hh:mm:ss,[Wh],[Wh],[Wh],[Wh]
13.09.2019 02:00:00,0,0,0,NaN
14.09.2019 02:00:00,14450,0,0,NaN
A request has been made to create a generic cvs importer. I have not started on this yet. The configurable parts would be:
Creating an Electron app was on my cool-list. I just needed to try this one out :) I could refactor everything into a Home Assistant add-on. That would make importing history even easier.