Merge double entities in DB

For some reason, since 2024.12.0 several entries of my Plugwise Adam are re-created (opentherm, climate, etc).
I still can see the old ones in the history list and in the database. Also the history is still there.
I’d like to merge the old entries into the new one, so I have the history in one view.

Does anyone know of a script that I can run in SQLite Web that can achieve this?
(Backup will be made prior to execution ofcourse).

The reason for the change was this problem: Mismatch in climatecontrol thermostat with plugwise app when using two tom/floors in a zone · Issue #130597 · home-assistant/core · GitHub

Stange, I have NO floor’s.
And only 2x tom in 2 separate zones. Not in 1 zone.
But, now that the reason is known, how can I fix my history issue?

You misunderstand I think. The issue made me realize that the implementation of climate entities in the Plugwise integration has been wrong since I started working on this several years ago. That has now been corrected, now the operation is (more) similar to how the Plugwise App functions.

Anyway, getting back to your question: did you search via Google? A quick search with these terms: “home assistant merge old statics” lead me to this: Merge statistics of old entity to new entity

And there are more applicable results found…

I get there was something fixed in the background that was wrong initially. I’m all for that. I’m not that keen on breaking changes without head’s up, there was nothing in the HA 2024.12.0 changelog on this. It’s now up to me to get that part fixed, unfortunately.

From my point of view, great change, but please look beyond the scope of the change and own the implications for end users that are not that deep into coding, like me.
I understand some bits and bytes, but not to the extend of actually writing an addon.

I’m sure that when this change was developed, the same behaviour was observed?
Ofcourse I did try to google this, but I end up in a forest of so many different scripts and iterations of those scripts, that I can’t make head’s or tails of it.

I’d welcome a script specifically for the plugwise entities to merge them. :slight_smile:

I’m working on getting the HA 2024.12.0 release-notes updated for this specific topic.

Sorry, can’t help you, SQL_DB updating/changing is totally not my thing.