ThisCalculator

Everyday

Home Assistant Renames: Why Automations Break & Fixes

Updated · Standard formula, shown below

Home Assistant Renames: Why Automations Break & Fixes

When you rename an entity, device, or area in Home Assistant, automations that referenced the old name can silently stop working. The fix is to update the automation’s YAML to use the new entity ID, or better, to use unique IDs and stable references. This article explains why renames break automations, how to fix them, and how to avoid the problem in the future.

Why Renames Break Automations

Home Assistant stores automations as YAML files (or in the internal database if you use the UI). Automations reference entities by their entity_id, a unique string like light.living_room or sensor.outdoor_temp. When you rename an entity through the UI, Home Assistant creates a new entity_id and marks the old one as unavailable. However, it does not automatically rewrite every automation, script, or dashboard that used the old ID. The automation still points to the old ID, which no longer resolves to a live entity, so the automation either errors or simply does nothing.

This behavior is by design: Home Assistant cannot know whether an automation’s reference to light.living_room was meant to follow the rename or to point to a different entity. So it leaves the old reference untouched, and you must update it manually.

How Entity Renames Work in Home Assistant

When you rename an entity from the UI (Settings → Devices & Services → Entities), Home Assistant changes the friendly name (the display name) and also offers to change the entity_id. The entity_id is the internal identifier used in automations, scripts, templates, and dashboards. If you only change the friendly name, the entity_id stays the same, and automations continue to work. If you change the entity_id, any reference to the old ID breaks.

Similarly, renaming a device or an area can affect automations that use the device or area as a target. For example, an automation that triggers on device: abc123 will break if the device is removed and re-added (which changes its device ID). Renaming a device does not change its internal device ID, so that alone is safe. Renaming an area changes the area ID, and automations that reference area: living_room will break.

How to Fix Broken Automations After a Rename

If you already renamed something and an automation stopped working, follow these steps:

  1. Open the automation in the UI (Settings → Automations & Scenes).
  2. Look for red or missing entity references. The UI often shows a warning icon next to invalid entities.
  3. Click on the entity reference and select the new entity from the dropdown, or manually type the new entity_id.
  4. If the automation uses YAML mode, edit the YAML directly and replace the old entity_id with the new one. You can find the new ID on the entity’s page (Settings → Devices & Services → Entities → click the entity).
  5. Save the automation and test it.

If you have many automations referencing the old entity, you can search your YAML files for the old ID using the File editor add-on or a text editor. Replace all occurrences, then reload automations.

Preventing Breakage: Use Unique IDs and Stable References

The best way to avoid breakage is to design automations that don’t depend on entity_id strings that can change. Here are strategies:

  • Use the UI automation editor – it creates automations with internal IDs that are more resilient to renames (though not immune).
  • Use device-based triggers and conditions – when you pick a device from the dropdown, Home Assistant stores the device ID, not the entity_id. Renaming the entity won’t break it.
  • Use areas and zones – reference an area instead of a specific entity. If you rename an entity, the area reference still works.
  • Use groups or helper entities – create a helper (like an input_boolean or a group) and reference that in automations. Then you can change the underlying entities without touching the automation.
  • Use templates with states() and device_attr() – these can look up entities dynamically, but they still need the entity_id string. However, you can use device_attr('device_id', 'name') to get the current entity_id.

Common Mistakes and Misconceptions

One common mistake is assuming that renaming an entity through the UI also updates all automations. It does not. Another is thinking that the “old” entity still exists – after a rename, the old ID becomes unavailable and any automation referencing it will fail to trigger or will error in the log.

Some users believe that using the “Copy” button in the automation editor will preserve references. It copies the YAML, so any old IDs are copied too. Also, renaming a device does not change the entity_id of its entities, but renaming an entity does change its entity_id. So the two are not equivalent.

Another misconception: if you rename an entity back to the old ID, automations will work again. That is true, but it is a temporary fix and can cause confusion if you later rename again. Better to update the automation.

Automation vs. Script vs. Dashboard References

Automations are not the only place where entity IDs appear. Scripts, scenes, dashboards, and even other automations can reference the same entity. When you rename an entity, all of those break. The fix is the same: update each reference. To find all references, you can use the “Related” tab on the entity’s page – it shows which automations, scripts, scenes, and dashboards use that entity. That is the fastest way to see what needs updating.

For dashboards, you can edit the card and re-select the entity. For scenes, you can open the scene and re-add the entity. For scripts, edit the YAML or use the UI editor.

Frequently Asked Questions

Why does my automation still show the old entity name after I renamed it?

Because the automation stores the entity_id, not the friendly name. The friendly name is just a label; the entity_id is what the automation uses to call the entity. Renaming the entity changes the entity_id, but the automation still has the old ID in its YAML.

Can I make Home Assistant automatically update automations when I rename an entity?

No, there is no built-in feature to automatically rewrite all references. However, you can reduce the impact by using device-based references or helper entities. The “Related” tab shows you what needs manual updating.

What if I renamed a device, not an entity? Does that break automations?

Renaming a device (changing its display name) does not change the device ID, so automations that reference the device by ID will still work. However, if you delete and re-add the device, the device ID changes and automations break.

How do I find the new entity_id after renaming?

Go to Settings → Devices & Services → Entities. Find the entity (it will have the new friendly name) and click on it. The entity_id is shown at the top, like light.living_room_2.

Is there a way to use the old entity_id as an alias?

No, Home Assistant does not support aliases for entity_id. Once you rename, the old ID is gone. You can create a template sensor or a group that mimics the old ID, but that is a workaround, not a true alias.

Will reloading automations fix the break?

No. Reloading only re-reads the YAML; it does not change the references. You must edit the automation to use the new entity_id, then reload (or it will reload automatically when you save).

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.