Bulk renaming of related entities

alighmty59’s suggestion of renaming the device name portion to match the entity id and then renaming the device again helped with one device, although it seems like a fairly bad user interface since nothing is explained to the user and it appears that the entity renaming worked when it didnt.

However, there is another device is stuck with a _2 at the end, e.g. switch_main_bedroom_light_2. There are NO entities without the _2 (there’s no switch_main_bedroom_light). Home assistant gives no notice that the renaming failed, and so you’re stuck looking at the entity table to see. I have a ton of automations referring to the entity without the _2, but I can’t rename the entities to not have it. Manually renaming each one works, but the switch has over 30 entities associated with it.