Automation editor
The automation editor lets you create and edit automations directly from the Home Assistant user interface, without writing any YAML. The editor walks you through choosing a trigger, optional conditions, and the actions to run.
If you’re new to automations, start with the Tutorial: Create your first automation. It walks you through creating your first automations in the editor, step by step.
Editing an automation in the visual editor
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- Result: The visual editor opens and you can edit the automation.
- Optional: To add a YAML example, such as one from the documentation, copy the YAML, and in the editor, press Ctrl+V (or Cmd+V on Mac).
- The example can be a full automation, a single trigger, a condition, or an action. For an example to try, refer to Automation: Send a notification when Home Assistant starts.
- If you paste a full automation into an automation that already has content, the Pasted automation dialog asks whether to Append it or Replace the existing content.
- Select Save.
Editing an automation in YAML
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- In the upper-right corner, select Menu
, and then select Edit in YAML. - Result: The YAML editor opens and you can change the YAML code.
- If you just want to edit the YAML of a trigger, a condition or an action of the automation, select Menu
in the right corner of the respective element, and select Edit in YAML.
- Optional: To add a YAML example, such as one from the documentation, copy the YAML, and paste it at the right place in the YAML editor. For example, paste a trigger under
triggers:, and make sure its indentation matches the other triggers. - Select Save.
- If you want to go back to the visual editor, select Menu
again, and then select Edit in visual editor.
Undoing and redoing changes
In the visual editor, you can undo and redo your changes before you save them.
- To undo a change, in the top bar, select Undo
. - To redo a change, in the top bar, select Redo
.
On narrow screens, Undo and Redo are in the Menu
Renaming an automation and adding details
When you save a new automation, you give it a name. You can change the name later, and add a description, a category, labels, and an area.
- Open the automation.
- In the top bar, select Menu
, and then select Rename. - Change the name. To add more details, select Add description, Add icon, Add category, Add labels, or Add area.
- Select Rename.
- Renaming an automation doesn’t change its entity ID. To change the entity ID, select Menu
> Settings, and then change the Entity ID.
Changing the mode of an automation
The mode decides what happens when an automation starts while it is still running.
Automations that use a blueprint don’t have the mode option.
- Open the automation.
- In the top bar, select Menu
, and then select Change mode. - Select a mode:
- Single: Doesn’t start a new run while the automation is running, and logs a warning. This is the default.
- Restart: Stops the current run, and starts a new one.
- Queued: Starts each new run after earlier runs finish. Under Queue length, set the maximum number of running and queued runs combined. The default is 10.
- Parallel: Starts the new run right away, next to the running runs. Under Max number of parallel runs, set how many runs can run at the same time. The default is 10.
- Select Change mode, and then save the automation.
Duplicating, turning off, or deleting an automation
Open the automation, and in the top bar, select Menu
- Duplicate: Opens a copy of the automation in a new editor. The copy is only kept when you save it.
- Disable: Turns off the automation, so it doesn’t react to its triggers. To turn it on again, select Enable.
- Delete: Deletes the automation after you confirm. You can’t undo this.
Working with triggers, conditions, and actions
Each trigger, condition, and action has its own Menu
After changing a trigger, condition, or action, select Save to apply your changes to the automation.
Renaming a trigger, condition, or action
A name makes it easier to find a trigger, condition, or action in a long automation, and in the trace.
- On the right side of the row, select Menu
, and then select Rename. - Enter a name, and select Submit.
Copying, moving, and duplicating triggers, conditions, and actions
- To add a copy in the same automation, in the Menu
of the row, select Duplicate. - To copy or move it, in the Menu
of the row, select Copy or Cut. Then, in the Menu of another row, select Paste. The copy is inserted after that row. You can also paste it in another automation. - To change the order, drag the row by its handle
.
Turning off a trigger, condition, or action
To try an automation without one of its triggers, conditions, or actions, turn it off instead of deleting it.
- On the right side of the row, select Menu
, and then select Disable. - Result: The row shows Disabled. Home Assistant skips it until you turn it on again.
- To turn it on again, select Menu
, and then select Enable.
Continuing after an action fails
By default, an automation stops when an action fails. To continue with the next action after an error Home Assistant can handle, in the Menu
Deleting a trigger, condition, or action
In the Menu
List of keyboard shortcuts
The visual editor supports the following keyboard shortcuts. On a Mac, use Cmd instead of Ctrl. The shortcuts don’t work while you type in a text field.
- Ctrl+S: Save the automation.
- Ctrl+Z: Undo.
- Ctrl+Shift+Z or Ctrl+Y: Redo.
- Ctrl+C: Copy the selected trigger, condition, or action.
- Ctrl+X: Cut the selected trigger, condition, or action.
- Ctrl+V: Paste after the selected trigger, condition, or action.
- Ctrl+Delete or Ctrl+Backspace: Delete the selected trigger, condition, or action.
Checking the targeted entities of an automation
After creating an automation and adding a trigger, condition, or action that targets a floor, area, device, or label, you can see how many entities are included, as well as their name, state, and other details.
To check the number of targeted entities of a trigger, condition, or action
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- Add a trigger, condition, or action with a floor, area, device, or label as a target.
- Result: The number of entities appears in parentheses in the trigger, condition, or action row.
To see which entities are targeted and check their details
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- Add a trigger, condition, or action with a floor, area, device, or label as a target.
- In the trigger, condition, or action row, select the target with the entities you want to check.
- Result: The Target details dialog opens, where you can see a list with the name and state of the entities, grouped by parent target.
- From the entities list, select an entity to check its details.
- Result: A dialog opens with more information about the entity.
If a trigger, condition, or action has a single entity as the target, instead of a floor, area, device, or label, select it from the row to open the entity details dialog.
Adding notes to an automation
You can add notes to a trigger, condition, or action in an automation. Use notes to explain why a step exists, or to include additional context.
To add a note to a trigger, condition, or action:
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- Add a trigger, condition, or action to your automation.
- On the right side of the trigger, condition, or action row, select Menu
and then select Add note. - In the Add note dialog, enter the text of your note and select Submit.
- Result: You can read your note by hovering over or selecting the
button.
- Result: You can read your note by hovering over or selecting the
Editing notes in an automation
If you want to change a note on a trigger, condition, or action:
- Select the trigger, condition, or action row where your note is.
- Result: The options of the trigger, condition, or action open.
- In the Note section, select Edit.
- Enter the new text or change the existing one and select Submit.
Troubleshooting missing automations
If you can’t see your automation, refer to My automation doesn’t appear in the UI.