Move sensor to new location while keeping the database integrity

Hi!

I have a question, and maybe this has been answered already frequently and I haven’t found the right search terms. If so, please point me in the right direction.

My issue:
I have a H&T Sensor with display in the bedroom and now bought one without display as well.
Now I want to move the sensor with the display to the bathroom, as we will use the display there more often and place the new sensor in the bedroom.
I would like to keep the logging intact, so that the new sensor logs to the database so that I can use long term statistics for the bedroom even with the sensor switch.

Thank you for your help!

Okay, I digged a little bit deeper and did find some threads with equivalent problems.

The solution should be:

Unfortunately I already renamed the old entity ID and named the new one after the old one, now the LTS is gone. But InfluxDB has me covered, as far as I can tell.

For reference the threads with proposed solutions:

The approach has been changed after 2023.4. The following way worked me for the current version of HA:
OS Version: Home Assistant OS 11.4
Home Assistant Core: 2024.1.5

  The new process is:

    1. Delete old entity (Settings > Device&services > Entities) It was in "Restored" status. Select the checkbox at the begining of the row!
    2. Rename new entity to old entity_id -> click to the entity_id > settings > rename entity_id > update  
    3. New entity will inherit old entities history (no reboot needed, it is on the fly...)

IMPORTANT: Do not under any circumstances rename the old entity before you delete it, this will cause the history to follow the renamed name. (If you already renamed it, beacuse you followed the earlier process, you have to rename it back, than reboot, than follow the new process above. It worked me this way too.)
1 Like