Table of Contents

Maintenance

SQLite database repair

systemctl stop domoticz
 
echo .dump | sqlite3 domoticz.db > /tmp/domoticz.sql
mv domoticz.sb domoticz.sb.bak
sqlite3 -init /tmp/domoticz.sql domoticz.sb
 
systemctl start domoticz

remove strange values form db

sudo service domoticz stop
 
cp domoticz.db domoticz.db.bak
 
sqlite3 domoticz.db
SELECT * FROM Meter WHERE DeviceRowId=16;
SELECT * FROM Meter WHERE DeviceRowId=16 AND VALUE=99999 AND DATE LIKE "2023-08-16 22:%";
DELETE FROM Meter WHERE DeviceRowId=16 AND VALUE=99999 AND DATE LIKE "2023-08-16 22:%";
.quit