Import Domoticz history

Managed to solve it by reverting to SQL Lite version 3.9.2
Download here: https://github.com/hassio-addons/addon-sqlite-web/files/13064014/addon_a0d7b954_sqlite-web_3.9.2.tar.zip

Delete the installed Addon (higher version) then go to Settings > System > Backup and choose Upload Backup in the top right menu and upload the tar.
Be sure to turn off auto-update.

Ref: Error "400: Bad Request" on all queries · Issue #281 · hassio-addons/addon-sqlite-web · GitHub

I am trying to do this. But i get this error:

Analysis: Error occured
{
“error”: {
“code”: “SQLITE_CORRUPT”
}
}

Does this mean that my domoticz backup is corrupt or am i doing somthing wrong?

You’re my hero!

Trying to import Electricity data, from the script. But there is an error.

Is there anyone who can point out what is wrong with this? Was created by the tool of Johan Bos
The syntac to read out the ID for the energy meter was ok.

System SQLweb 3.44.2
Home assistant core 2024.4.3
Operating system 12.2
Supervisor 2024.04.0
frontend 20240404.2

Try end the code lines with a ;

Thanks it works, the data is imported!

Trying to import my gas data from Domoticz but keep getting this error. Anyone any idea?

Split the lines and run then one by one.

1 Like

That indeed worked! Thanks @Xenomes

When entering all the lines as an individual query did the trick.

Hi,

extremely grateful for this tool. I just made some screenshots that even allow the not so gifted SQL users to use this tool.

Instead of running the query, just go to the SQL Web tool and find the required ID’s:

Then load your database, select the Domoticz DB file and use the ID’s found before. This will result in this output:
Image 2

For each of the entries (3 in total) go to the SQL Web tool, select the appropriate table and, go to the query tab, paste your data & click execute.
Image 3,4,5

Repeat the same steps also for the other ID’s (I have 3: Gas in M3, Electricity Low in Kwh and Electricity High in Kwh.

Result: A very happy me !

Schermafbeelding 2025-01-06 175004

Just wanted to say thank you! Succesfully imported my power and gas usage from the last 5 years :slight_smile:

1 Like

I try to import some Domoticz data into the SQL and got the following error:
UNIQUE constraint failed: statistics.metadata_id, statistics.start_ts
what to do?

insert into statistics (created_ts, start_ts, state, sum, metadata_id) values
(unixepoch(“2021-05-02 02:00:00.000000”), unixepoch(“2021-05-02 02:00:00.000000”), 571.662, 0.000, 52),
(unixepoch(“2021-05-03 02:00:00.000000”), unixepoch(“2021-05-03 02:00:00.000000”), 572.051, 0.389, 52),

At first thanks alot for taking the effort for making this tool.
I am currently busy with migrating from domoticz to HA.

So far I succeeded in the following:

  • Electricity consumption/delivery
  • Gas consumption
  • SolarEdge consumption (Using Modbus integration)

Currently failing at:

  • Water usage history (not that important for me now)
  • Easee charging history

Below, red marked area is imported data into the database, that data is also correct in HA.
Problem is once new data is added the sum is different. And I get a negative -2000 value on that day.
After the -2000 (not exactly 2000 by the way) data shows correctly again. But at weekly/monthly/yearly table I will always have -2000 less kWh displayed.
The green marked area I did change the sum and then the -2000 disappears also. But once new values get added I got -2000 again.

Long story short, anyone knows how to fix it?

Hello, I am trying to transfer the p1 gas meter data from Domoticz to Home Assistant, see images, something is wrong, anyone have any ideas?

Schermafbeelding 2025-11-02 105003
Schermafbeelding 2025-11-02 104807
Schermafbeelding 2025-11-02 103239
Schermafbeelding 2025-11-02 103102
Schermafbeelding 2025-11-02 102906