Open AngellusMortis opened 5 months ago
I even don't get the dialogue box where HomeAssistant asks if it should rename the entitys accordingly
I even don't get the dialogue box where HomeAssistant asks if it should rename the entitys accordingly
Note the dialog popup is only given to users with "Advanced Mode" enabled.
When renaming entity ids, ids are only modified if the entity id contains exactly the slug of the old device name, and only that subset of the entity id is modified to the new name.
So if you're renaming "Foo Device" to "Bar Device", sensor.xxxx_foo_device_yyyy
will be renamed sensor.xxxx_bar_device_yyyy
, but an entity that does not contain the string foo_device
is not modified.
If you want to bulk rename entities that don't match the current device name, you may be able to take advantage of this by renaming the device multiple times, first rename it such that it matches the part of the id that you want renamed, and then try renaming it a second time.
only given to users with "Advanced Mode" enabled
Off-topic, but so far see no reason to have this "advanced mode" disabled.
When renaming entity ids, ids are only modified if the entity id contains exactly the slug of the old device name, and only that subset of the entity id is modified to the new name.
So if you're renaming "Foo Device" to "Bar Device",
sensor.xxxx_foo_device_yyyy
will be renamedsensor.xxxx_bar_device_yyyy
, but an entity that does not contain the stringfoo_device
is not modified.If you want to bulk rename entities that don't match the current device name, you may be able to take advantage of this by renaming the device multiple times, first rename it such that it matches the part of the id that you want renamed, and then try renaming it a second time.
Thank you @karwosts for sharing this. I could not figure out why sometimes the device_id would not update and this is the reason. I do think this is a bug because you still get the dialog asking you if you want to rename your device_id, but it's not actually doing anything which makes it very confusing.
Update: Okay, I don't know what's going on but it seems to be working now. I did allow it to have cloud access yesterday to double check some settings but that's about the only change I've mad recently. I'll keep an eye on it to see if it continues to work.
Checklist
Describe the issue you are experiencing
If an entity's entity ID does not match the entity/device name, choosing "Rename Entity IDs" will not work on the entity ID.
Describe the behavior you expected
Entity IDs should be renamed according to new device name
Steps to reproduce the issue
https://github.com/home-assistant/frontend/assets/490848/e1d89dd7-1bb9-4c7c-83b8-a3900e84e710
This is also re-producible if the device/entity names are updated from upstream. In my case, I renamed the devices in UniFi Protect and reloaded the integration so the devices/entities would get their new proper names. Now I cannot rename the device manually to bulk update all of the entity IDs.
Bulk renaming the entity IDs is really useful for upgrading/replacing devices which is what I am doing here. I replaced 4 outside cameras with newer models. Renamed the old ones and then disabled them. Then renamed the new ones to match what the old ones were.
What version of Home Assistant Core has the issue?
core-2024.1.6
What was the last working version of Home Assistant Core?
2023.12 ish? maybe?
In which browser are you experiencing the issue with?
Edge (Chromium)
Which operating system are you using to run this browser?
Windows 11
State of relevant entities
Enabled and working? Basically trying to upgrade/replace a device.
Renamed old device, verified entity IDs on it were renamed. Then disabled it. Renamed replacement device, all of the entity IDs are still the old default name (
ai_pro_*
).Problem-relevant frontend configuration
N/A.
Javascript errors shown in your browser console/inspector
None.
Additional information
The device does have a lot of entities that may be causing it (40+).