WTH automatic replacement of an old entity by a new entity in all *.yaml and Dashboards

From time to time, devices fail and have to be replaced with new ones. This also changes the ID of the corresponding entities. If you are not working with helpers, these old entity IDs have to be replaced with the new ones in all automations, scenes, dashboards, configuration.yaml and sensor.yaml. It would be great if there was a tool that automatically replaced the old entity ID with the new one everywhere, so that you don’t have to do this manually (Ctrl-H) in RAW dashboard, automation.yaml, configurations.yaml, sensor.yaml etc. The preparatory work has already been done by showing which entities are being changed when an entity name is changed.

Note that sometimes entity_id is composed in templates - so it will not be auto-replaced anyway.

I agree, and I would extend this cast to moving historical data. Just because a device is broken and replaced, I do not want to loose all the related statistics.

1 Like

Just rename the new entity to the old entity name and you are up and running with everything.
Using device id is another matter and many of us warn against the usage again and again here on the forum.

Always use the entity names that are logical fornuse, not related to device naming itself.