WTH Don’t we automatically update entity IDs when changed

It should fix entity ID in dashboards, automations, scripts… I’d even like it to fix it in included yaml(old history stats sensors, template sensors, etc)

It should give the option like it does for entity renaming with devices. Sometimes I’m renaming an entity back to what it was (looking at you NodeRED and your _2’s), and sometimes I want to rename it everywhere.

Side note: the Spook! integration is extremely helpful for a workaround, it creates new repair issues wherever the entity is now incorrect.

3 Likes

Yes, changing an entity name should prompt me with the option of finding+replacing the old name with the new name in all automations/scripts/dashboards/etc. Better, we should be able to either replace all in one click or have the possibility review them one by one. Just like in most text editors.

1 Like

Agree, it’s crazy to me that this is not a thing people are clamoring for. Once you get a bunch of automations going, especially the more involved you get, having to update an entity ID in every single place that it’s being referenced is just an absolute nightmare. At least Spook can tell me if an Automation or whatever is referencing an entity ID that no longer exists, otherwise I would just never even try to change IDs

1 Like

We all use tools that do this for us, like notepad++ and vscode. Both offer the ability to change an entity_id in automations in all files in less than 5 seconds.

1 Like

99% time I go this route. It all goes a bit wrong with the GUI created templates that may rely on the old entity ID though. So maybe it’s not such a bad suggestion.

Yeah, but like, the goal of the project is to be open to everyone, not just us nerds that are going to do this. Another thing is, I often want to make changes on mobile.
Just logically, anyone approaching HA for the first time would need to be forgiven for assuming it must already works this way.

Realistically, entity IDs themselves should probably go away (replaced with UUIDs and a capable search function), but I don’t want to start any fights haha.

I get what you’re saying, but you can get what you want right now without any nerdy things needed. Install vscode addon, run it, click Edit → Find in Files then type the entity_id out. It’s probably the least nerdy thing ever.

That’s already a thing. People don’t use it because a mishmash of numbers and letters is meaningless to them.

I think you may have nerded too long and no longer see the nerding :wink:

Hm, I thought this was only for devices not for entities.

1 Like

Non technical people want a way to do this in the UI. And frankly, if you have everything configured in the UI, this should happen automatically for example during upgrades when the integration owner decides to change up his entity ids (which seems to happen fairly often with no very good reason).

Integrations can’t change onboarded entity_ids. So it’s really not a problem.

There have been many changes over the past few releases. Even if you delete devices, your entities will retain their original entity_id.

It is a problem when some integration owner just decides to change all his entity_ids on a whim and breaks all your stuff on the upgrade.

Again, it’s not possible with how the entity system works. I’m not sure how to explain this to you. If you onboard an entity, a registry is created and the entity ids will not change. Its how HA works under the hood. You’re thinking of past HA.

I am talking about a more specific case, when you need to reinstall the integration. For example, one of my HACS integrations for WeatherFlow Tempest decided one day that they were going to refactor all the names for the entities in the new version. When I upgraded to the new one, all the names were different and nothing worked. This has happened to me many times. Another one I can remember is the BMW integration. Probably I was forced to reinstall to get the new version, but there was no way to port the entity names over. I just got all new entity names which bared no resemblance to the old ones.

And what you keep glossing over is that this functionality changed a few releases ago. The information is cached even if the integration is removed. Meaning, no matter what, your entity_id’s are retained.

I’m stuck on a very old version due to a bug in the migration of the AppDemon addon which can only be fixed by downgrading to an even older version and then building back up from there. I need to go back 2 years and just don’t have the heart to do it. So it’s likely I never saw the features you are talking about. Breaking changes and migrations finally brought me down.