-
Notifications
You must be signed in to change notification settings - Fork 4
Home
With the introduction to version 4, I have upgraded the plugin to the Domoticz Extended Framework. As a consequence, new devices will be created that do not contain the historic data. This can be prevented in 2 ways (first preferred as far less risky!!!)
Install the new version as a new hardware module and migrate the devices for which you want to preserve the history according the Wiki: manage devices. This is be far the easiest and safest migration.
Follow these steps to manually move the device definition to the new structure. So follow the below steps carefully!
Start by installing sqllite if not already installed:
sudo apt-get install sqlite3
Then, make a backup of the Domoticz database:
cd /home/pi/domoticz
cp domoticz.db domoticz_<date>.bak
then, we’re going to export the device defintion table to an csv file:
sudo systemctl stop domoticz.service
sqlite3 domoticz.db
.mode csv
.separator ";"
.headers on
.output devicedata.csv
select * from DeviceStatus;
.quit
Open the file devicedata.csv using an editor like Notepad++ on your domoticz device and do the following steps:
-
locate the lines for your inverter (they have the names you gave them)
-
the 3rd column now holds a generated ID (something like 000E0001 to 000E0012 but)
-
modify that value for all devices to the serial number of yor inverter (something like 54200DSN123R4567)
-
save the file
Now we will import the csv back into the domoticz database:
sqlite3 domoticz.db
DROP TABLE IF EXISTS DeviceStatus;
.mode csv
.separator ";"
.import devicedata.csv DeviceStatus
Now, check the the device import was succesfull:
select * from DeviceStatus;
if this shows the devices again, continue:
.quit
sudo systemctl start domoticz.service
You are now ready to run with version 4 of the plugin!