Migrating Temperature device history to SetPoint device

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
joostvanderlinde
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

Post by joostvanderlinde »

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?
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
Kedi
Posts: 561
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

Post by Kedi »

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
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
waltervl
Posts: 5369
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

Post by waltervl »

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
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests