Page 1 of 1

Migrating Temperature device history to SetPoint device

Posted: Thursday 03 October 2024 14:45
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?

Re: Migrating Temperature device history to SetPoint device

Posted: Thursday 03 October 2024 19:02
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

Re: Migrating Temperature device history to SetPoint device

Posted: Thursday 03 October 2024 20:21
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.