I have a bunch of Xioami Temperature/Humidity Sensors and have a question about them.
I have over a dozen scattered throughout my house. About every 6 months I have to change the battery.
Once the new battery is installed HA creates a new entity for it
IE: sensorbattery_a4c138370444, sensorbattery_a4c138370444_2, sensorbattery_a4c138370444_3 and so on. With _3 being the one that was created today.
This also happens on a few other devices as well.
I know I can delete the first and second sensor in config/.storage/core.entity_registry but can I delete all of them, do a restart and have them be recognized again.
Trying to save some work to edit a lot of lovelace and automations.
Thanks
Which type of sensors do you have? I have many of the Xioami Aqara Zigbee Temperature/Humidity sensors and they certainily do not behave like this.
I don’t think you should be editing anything within /.storage as you risk causing a corruption.
Worst case you should be able to delete the _1 and _2 entities from the Integration page and then rename the new _3 entity as _1 eliminating the need to change any of your Lovelace config.
I guess it depends how the ESP32 creates the unique_id of the sensor, if it does.
If it stays the same, you wouldn’t have duplicate.
If it doesn’t, or does not create one, you’ll get duplicates, but the old ones should appear as “orphans” (red “unavailable” icon). In my experience, if you delete the old ones and restart, the last one should roll back to having no suffix.