Repository navigation
Update multiple entity ID's at once #1071
|
I'm looking into the newly added update entity ID action, but I can't manage it to make bulk changes, i.e. update all entity ID's having certain string to replace only that string. Is there any way to handle it that way? |
Replies: 1 comment
|
Thanks for asking. The action does one entity per call, but a repeat:
for_each: >
{{ states | map(attribute='entity_id')
| select('search', 'living_room_light') | list }}
sequence:
- action: homeassistant.update_entity_id
data:
entity_id: "{{ repeat.item }}"
new_entity_id: "{{ repeat.item | replace('living_room_light', 'lounge_light') }}"It only works on entities with a unique ID. Try it with a notification in place of the action first, so you see what it is going to rename. Docs: https://spook.boo/entities#update-an-entitys-id Closing this one, since it is covered now. If something is still missing, feel free to open a new discussion. ../Frenck Blogging my personal ramblings at frenck.dev |
Thanks for asking. The action does one entity per call, but a
repeatloop makes it bulk:It only works on entities with a unique ID. Try it with a notification in place of the action first, so you see what it is going to rename.
Docs: https://spook.boo/entities#update-an-entitys-id
Closing this one, since it is covered now. If something is still missing, feel free to open a …