After renaming an entity ID, notify of the required automation changes

The UI allows renaming entity_ID. However, after doing so, it is required to adapt all the scripts, automations and UI elements in the dashboards.
Home Assistant knows which automations these entities are part of.
Would it be possible to have a pop-up window notifying of all the required changes after updating an entity_ID ? Or even better, updating them automatically ?

There’s a custom component that can help there.

1 Like

I would say update them automatically. This is home automation after all. :laughing:

2 Likes

Thanks for pointing me to this custom component. It does pretty much what I need, but it would really be great if it was built in Home Assistant by default !

actually watchman does not help

it might tell you you need to update lovelace (which page out of a dozen dashboards most people have?)

or it might say it’s in automations.yaml - great which hundreds of automations or scripts or what?

You can simply do a find/replace for entity_ids. It should take less than 5 minutes. You have multiple options too:

  1. Vscode addon has built in find/replace in all files/folders
  2. Connect HA to samba share and use another PC in combination with a text editor that supports find/replace in all files/folders. (notepad++ for example)
  3. Connect HA to SSH and use a software that can view the files via ssh (Like VSCode)

Also, the custom integration spook will tell you exactly which automations have unknown entity_ids

@petro ,

For a newbie like me, everything you just said sounds “Greek” to me. I have no idea what a Vscode addon, what a samba share is, or “a software that can view files” is.

But I do like mat44150’s and themanieldaniel’s suggestion to that it would be a benefit to have Home Assistant carry the entity ID change through all instances for you.

There’s always a time to learn. These are rather simple things, installing the vscode addon being the easiest if you run HAOS.

it’s simply NOT safe to code by find/replace in all files/folders
plus, I’ve found SOME changes in Vscode gets overwritten by HA when it reboots

It’s very safe to do with entity_id’s because they are unique to the system. The utilities provided by vscode also allow to preview each individual change. They also allow regex. Also vscode provides an undo button, so you can always go back.

If HA alters files when it reboots, you shouldn’t be altering those files. Find/replace should only be performed on the config folder (not hidden folders within config) and those files are all controlled by you, the user with the exception of HA which attempts to manage the yaml of the automations.yaml file.

yes the automations is a big problem
that is where most of it will be and some of it will be in helper templates

what I don’t understand is why under storage are there records of old ID which were used when you first create an object but are no longer used