All my xiaomi devices have been renamed with _2 appended. How to prevent this from happening?

I do have them in so many places (script groups, automation, and they are so many, all renamed
from
binary_sensor.motion_sensor_158d000112xxxx
to
binary_sensor.motion_sensor_158d000112xxxx_2

I don’t know how to revert this.

Same with me yesterday after upgraded to 64.0, but thats happen when i disable/comment discovery, and suddenly all xiaomi sensors dissapear in frontend, and all automation related with xiaomi sensors not running. when check entity on state tab all xiaomi sensors become _2 but it will back as normal after uncomment discovery and restart…

I reverted back to 0.63.3 because of the broadlink error, and your solution does not work.

What a mess

I noticed that today when some integrations I have weren’t running. I went looking around and my google home mini’s were all renamed with a “_2” at the end of them. What a pain as I have several scripts running from Vera that use them.

Yes all my chromecast and GH and GH groups, all renamed

you renamed all the scripts, or

@cloudio, for now I updated my scripts. Hoping to find a better answer/fix so this doesn’t happen again.