Which tool to use: automation, script, scene, blueprint, or helper
Home Assistant has five tools for making your home do things: automations, scripts, scenes, blueprints, and helpers. They overlap, and many tasks use more than one of them. This page explains what each tool is for, and how they work together.
The five tools
For each tool, this section says what it is, when to use it, and when another tool fits better. If you’re not sure where to start: most things that you want to happen in your home start with an automation. Add the other tools when your automation needs them.
Automation
- What it is
- A set of steps that starts by itself when something changes, for example, when the sun sets or a door opens.
- Use it when
- Something should happen in response to a change in your home.
- Not for
- Steps that you mainly want to start yourself, for example, from a button on a dashboard. You can run the actions of an automation yourself, but a script is a better fit.
For details, refer to Understanding automations.
Script
- What it is
- A saved list of steps that runs when you start it. It has no triggers.
- Use it when
- You want to start the same steps from a dashboard, with Assist, or from several automations.
- You want to give the steps different values each time, with fields.
- Not for
- Reacting to a change by itself. A script only runs when something starts it. Use an automation for that.
For details, refer to Scripts.
Scene
- What it is
- A saved set of states for several devices, which Home Assistant applies all at once.
- Use it when
- Several lights and devices should go into a specific state together, for example, dimmed lights and closed blinds for a movie night.
- Not for
- Steps that happen one after the other, waiting, or decisions. Use a script or an automation for that.
For details, refer to Scenes.
Blueprint
- What it is
- A reusable template for an automation, a script, or a template entity, with inputs that you fill in.
- Use it when
- You need the same automation for several rooms or devices.
- You want to use an automation that someone in the community has already made.
- Not for
- Writing your own blueprint for an automation that you only need once. Create the automation directly instead.
For details, refer to About blueprints.
Helper
- What it is
- An entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] that you create yourself.
- Some helpers store a value or a state, for example, a toggle, a timer, a schedule, or a dropdown.
- Others calculate a value from other entities, for example, the minimum of several sensors.
- A few combine or control other entities, for example, a group of lights that you control as one light.
- Use it when
- An automation needs to remember something, or you want to change how an automation behaves without editing it.
- Not for
- Reacting to changes or doing steps one after the other. Use an automation or a script for that, and let it use the helper.
You create helpers in Settings > Devices & services > Helpers. For all helpers you can create, refer to the list of helpers.
Some helpers calculate their value with a template, a small piece of code that, for example, combines the values of several sensors.
Combining the tools
Most of the time, you combine the tools. These combinations come up often:
- An automation that activates a scene
- For example, when you start a movie, an automation activates the movie night scene. The scene holds the states, and the automation decides when.
- An automation that runs a script
- If several automations should do the same steps, put the steps in a script, and let each automation run it. When you change the steps, you only change the script.
- A toggle helper to pause an automation
- Create a Toggle helper, for example, “Motion lights active”, and add a condition to the automation that checks it. To pause the automation, turn off the toggle. Anyone who can use the dashboard can do that, without editing the automation.
- A timer helper instead of a long delay
- A delay in an automation stops when Home Assistant restarts. A Timer helper with Restore state and time when Home Assistant starts turned on continues after a restart. Start the timer in one automation, and react to it in another one with the Timer finished trigger.
- If the timer ran out while Home Assistant was off, the Timer finished trigger doesn’t run when Home Assistant starts again. For details, refer to the Timer finished trigger.
- A schedule helper instead of several time triggers
- A Schedule helper holds time blocks for each day of the week, for example, the hours when the heating should be on. An automation reacts with the Schedule block started trigger, or checks the Schedule is on condition. To change the times, you edit the schedule, not the automation.
- A blueprint for the same automation in each room
- For example, a motion-activated light. Create the automation once from the blueprint for each room, and fill in that room’s motion sensor and light.