Page 1 of 1

Missed one record, how to repair?

Posted: Monday 05 February 2024 21:40
by peterbos
Hi,

I updated Domoticz last Saturday at about 24:00. At that time Domoticz saves the data of the day. Because the event system apparently wasn't working because of the update I missed the day values and now have a gap in the graphics. Is it possible to add the missing line of data by hand to the database?

Peter

Re: Missed one record, how to repair?

Posted: Monday 05 February 2024 21:58
by willemd
Yes, you can use sqlite3 to insert a value into one of the xxxxxx_calendar tables (which table you need depends on the device type).
Insert into those tables is pretty safe, but always make a backup first since it is easy to make a typo with far reaching consequences.

Re: Missed one record, how to repair?

Posted: Monday 05 February 2024 22:06
by HvdW
Yes you can.
Supposing you're on a Windows machine
- Install DB browser (SQlite)
- Edit the tile you want to repair and find the Idx (let's assume 111)
- Goto settings -> backup/restore and make a backup
- for today name that backup 20240205_01_domoticz.db (your safeguard)
- make another backup a leave it like domoticz.db
- Open DB browser (SQlite)
- open domoticz.db
- Goto tab gegevensbrowser
- You'll find Table Applications, a dropdown menu
- Open at Meter_Calendar
- Fill in the field Filter with your Idx 111
- Scroll down and you will find the missing value

- When ready goto File -> Save file (Ctrl-S)
- then close database
- Now back to domoticz
- Open settings -> backup/restoreClick on restore database
- Choose your domoticz.db
- Click on upload and wait because seemingly nothing happens. Have some patience.
- Now find your data a check if it worked.

Beware!! You're on your own! Don't blame me if things go wrong!

If you allow me to give you a tip:
Leave it like it is. What's the value of that one day of data.
After a week it is no longer visible on the second table, after a month it dissappears from months' data and you will forget it.
What is the difference on 365 days.
What is the difference over years.
Nothing.