I recently replaced my P1 Smartmeter connection to measure and display power and gas consumption in Domoticz from wired to wireless.
Domoticz created new devices (with new deviceid's) in the GUI which show the desired power and gas measurements.
All working and nice, but ... I would like to keep the historic data captured with the old wired devices under the new devices.
I have about 4 years of historic data for gas and power and would like to see this data under the new devices.
To clarify, the old situation:
the new situation:
Can anyone enlight me how to get this done without corrupting the domoticz.db, for instance by manipulating the domoticz.db with sqlite ?
Or, if this has been explained earlier on this forum (I did tried searching for it): could you point me to the relevant discussion please?
Migrating domoticz.db data
Moderators: leecollings, remb0
- FireWizard
- Posts: 1868
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Migrating domoticz.db data
Hi,
From the Wiki:
Replace device
Some devices change their unique ID when a new battery is installed and will get a new idx ID in Domoticz. Also when migration from one hardware gateway to another (eg OpenZwave to Zwave-JS-UI) you could need to replace devices.
To replace the old sensor data (history logging) to the new device act as follow:
First, add (or is added by new gateway) the new device to the system, and call it for example ‘New UV Meter’.
Next press the Edit button on the Old device, select replace and select the new Device. (In this case the devices called ‘New UV Meter’).
Next press OK. Result:
The old and new device will be merged and get the name and IDX of the old device. This will prevent changes in scripts that use this device.
The new device will be deleted. (behavior since Stable 2022.1)
If there is a hardware gateway difference between Old and New device (eg when switching from OZW to Zwave JS UI MQTT) the merged device (with old name and idx) will get the hardware gateway of the new device.
Regards
From the Wiki:
Replace device
Some devices change their unique ID when a new battery is installed and will get a new idx ID in Domoticz. Also when migration from one hardware gateway to another (eg OpenZwave to Zwave-JS-UI) you could need to replace devices.
To replace the old sensor data (history logging) to the new device act as follow:
First, add (or is added by new gateway) the new device to the system, and call it for example ‘New UV Meter’.
Next press the Edit button on the Old device, select replace and select the new Device. (In this case the devices called ‘New UV Meter’).
Next press OK. Result:
The old and new device will be merged and get the name and IDX of the old device. This will prevent changes in scripts that use this device.
The new device will be deleted. (behavior since Stable 2022.1)
If there is a hardware gateway difference between Old and New device (eg when switching from OZW to Zwave JS UI MQTT) the merged device (with old name and idx) will get the hardware gateway of the new device.
Regards
Re: Migrating domoticz.db data
Thank you so much FireWizard. Works like a charm, didn't know this feature. All historic data is visible now under the old id's and the new devices are gone (but not the data it already collected). I'm happy! 

Re: Migrating domoticz db data
I would like to replace my P1 wired connection to wireless too. Could you tell me what hardware you are using? There are several options (homewizard P1; smartgateways, JMD). Your solution is exactly what I want to achieve. It would help me to select the best option.
Re: Migrating domoticz db data
Typical huh? You help someone and post a question after helping him and he never responds.hartwich wrote: ↑Sunday 14 January 2024 12:30 I would like to replace my P1 wired connection to wireless too. Could you tell me what hardware you are using? There are several options (homewizard P1; smartgateways, JMD). Your solution is exactly what I want to achieve. It would help me to select the best option.

Very sorry about that. I bought my wireless device at https://smartgateways.nl/. Not sure if it works for you too, as this is a Dutch company and I think they mainly focus on Dutch customers. But all specs are there and their support is very good indeed.
Hope that helps!
Who is online
Users browsing this forum: No registered users and 1 guest