For your information, as a Software Developer I’ve investigated a little bit because I want to achieve the same thing. Exporting loads of history from Domoticz and importing/viewing this history in home-assistant. In my case it’s energy/gas sensor history and solar inverter history.
But I failed. TLDR: My conclusion is that home-assistant uses relative sensor information for its graphs and Domoticz has absolute sensor information. I was too lazy to calculate all relative values per month (best guess, please correct me).
My best guess was exporting dsmr history as csv or read the backup file with sqlite (
select * from DeviceStatus). For importing sqlite-web could be used; very handy.
The actual problem is with transforming the data from different data schemes. I was hoping to do this with some manual replace-all’s and then run the sql query to import history. However because home-assistent uses the
sum field in
statistics to show its graphs you need to ‘calculate’ this value.
This not only requires actual coding but if you already have sensor information, you need to correct it or clean up. My current guess is that the sum fields starts at 0 every month, so ideally you would want to time your migration to avoid this hassle.
By this time I figured I needed to consult the documentation to find out if it could be done easier haha. But looking at the code of home-assistent might prove more valueable. Maybe using
statistics_short_term with a run to automatically let home-assistent do the calculations is more easy.
If I ever continue my quest. I’ll keep this thread updated.