Missed one record, how to repair?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
peterbos
Posts: 93
Joined: Saturday 07 November 2020 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Missed one record, how to repair?

Post 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
willemd
Posts: 795
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2026.3
Location: The Netherlands
Contact:

Re: Missed one record, how to repair?

Post 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.
Tukker
Posts: 675
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Missed one record, how to repair?

Post by Tukker »

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.
Bugs bug me.
Post Reply