Replace the broken sensor

Hi there
my temperature sensors was broken, I want replace it. however the entity id is different therefore I just can not like the new record with the old history. I tried to change the entity id but the system is showing the id is already there. Dose any body know how to do the replacement?

Rename the old one to something else first (or delete it). If you delete through an integration, you may have to restart HA for it to disappear. And if it sticks around with a “restored” attribute, you can delete it through the Dev Tools property page. Note that assuming you’ve got at least 2023.4 installed, it will not pick up the old entity’s history.

1 Like

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.)
2 Likes