For whatever reason in the past I have created a Temperature sensor that should have been a Setpoint device (it shows the SetPoint temperature of my heatpump heating buffer).
I have now corrected this (so the value is shown on the Utility tab and not on the Temperature tab).
I would like to migrate all of the history (past days, last month, last year) that still resides with the Temperature sensor to the new Setpoint device (so I keep an overall view and also get the compare working again).
My guess would be to do this directly on the db using SQLite3 but open to _any_ solution
To avoid messing things up, Can anyone point out how (in SQL) to select the historic values from the temperature sensor and how to insert them linked to the setpoint device?
Migrating Temperature device history to SetPoint device
Moderators: leecollings, remb0
-
- Posts: 46
- Joined: Tuesday 23 June 2015 23:06
- Target OS: Linux
- Domoticz version: 2023.2
- Location: NL + SE
- Contact:
Migrating Temperature device history to SetPoint device
Domoticz on BPI-M2-Pro (compiled on Ubuntu 22.04) and RPI (binary on Raspian 10)
RFXCom, Sonoff Zigbee stick, eBusd Adapter 5, P1, S0, Husdata H60 integration
Zigbee2MQTT AD, MQTT local, AirconWithMe, Ebusd, VolvoRecharge, PSA Car Controller
RFXCom, Sonoff Zigbee stick, eBusd Adapter 5, P1, S0, Husdata H60 integration
Zigbee2MQTT AD, MQTT local, AirconWithMe, Ebusd, VolvoRecharge, PSA Car Controller
-
- Posts: 564
- Joined: Monday 20 March 2023 14:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Somewhere in NL
- Contact:
Re: Migrating Temperature device history to SetPoint device
First stop Domoticz.
Make 2 copies of the database.
Do every change on the first copy.
Easiest would have been to change the current temperature device in a Setpoint device in the database by changing type and subtype.
I think that somewhere on the Wiki those types and subtypes are listed.
Copy the changed database over the current database ( you still have the second copy).
Start Domoticz and everything should run fine.
If not stop Domoticz copy the second copy back over the current database and start Domoticz again.
Then you are at least back to the original state.
Temperature should be type: 80 Subtype 5 or something similair.
Setpoint shoild be type: 242 Subtype: 1
Make 2 copies of the database.
Do every change on the first copy.
Easiest would have been to change the current temperature device in a Setpoint device in the database by changing type and subtype.
I think that somewhere on the Wiki those types and subtypes are listed.
Copy the changed database over the current database ( you still have the second copy).
Start Domoticz and everything should run fine.
If not stop Domoticz copy the second copy back over the current database and start Domoticz again.
Then you are at least back to the original state.
Temperature should be type: 80 Subtype 5 or something similair.
Setpoint shoild be type: 242 Subtype: 1
Logic will get you from A to B. Imagination will take you everywhere.
- waltervl
- Posts: 5397
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Migrating Temperature device history to SetPoint device
Compare functions are not available on setpoint devices. Also setpoint devices are used for setting a setpoint. So if you only want to read the setpoint value in Domoticz you better stay at a temperature device. But that is up to you of course.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Who is online
Users browsing this forum: No registered users and 0 guests