Home Assistant has come a long way since the days when all your automations had to be written in YAML. These days, you can build automations in the automation editor without seeing a single line of code. With so many actions to choose from in the automation editor, it’s easy to miss some of the most useful ones.
Call a script
A lot of my automations contain some similar actions. For example, I have multiple automations that send a notification to my phone, my wife’s phone, and if we’re home and it’s powered on, to my smart TV.
I could have added notification actions for all three devices to each automation that required them. Instead, I wrote a script that requires the message as input and then sends that message to all three devices.
The benefit of calling a script rather than adding three notify actions to each automation is that if I ever decide to change which devices I want my notifications to go to, or we upgrade our phones or our TV, I’ll only have to make changes to the script. All the automations that call that script will work as expected once the script is updated, saving me from having to wade through multiple automations to fix them.
You can create a script by going to Settings > Automation & Scenes > Scripts and clicking the “Create script” button. The method is similar to building an automation in the automation editor, but you can use the “Add fields” option from the three-dot menu to add required fields, such as the content of your notification message. Once created, you can select your script as an action in the automation editor.
Related
4 Home Assistant blueprints that saved me hours of effort
You don’t need to reinvent the wheel.
Use choose
If you have an automation that you want to perform one of two different sets of actions, depending on the conditions, then the “If-then” action can do the job. It will follow one set of actions if the condition is met and the other set if it isn’t. Sometimes, however, you may have more than two possible sets of actions that you want to choose between.
That’s where the “choose” action comes into play. Instead of just having two options (“if” and “else”), you can add multiple sets of conditions. The first option where all the conditions are met is the one that will run. You can also add a set of default actions that will run if none of the conditions are met.
Using the “choose” action has a number of benefits, such as helping you trim down a bunch of similar automations into just one or two. For example, you can include multiple triggers in an automation, and give each one a trigger ID. Using the “choose” action, you can have different sets of actions run depending on which trigger ID triggered the automation to run.
Wait actions
There are several “wait” actions in Home Assistant, each of which has its own benefits. “Wait for time to pass (delay)” is an action you can use to add a delay to your automation. For example, if you want to send two voice notifications to a smart speaker one after another, you might use this action to stop the second notification playing before the first has finished.
There are two other useful “wait” actions you can use. “Wait for a template” will pause your automation until such time as a template is evaluated as true. If it isn’t, the automation will stay paused.
The template is evaluated again whenever an entity that the template references changes state. If the template still isn’t true, the automation will continue to wait. Only when the template is re-evaluated as being true will the rest of the actions be performed.
The “wait for a trigger” action can be used to pause the automation until a specific trigger event happens. These are the same triggers that you use to make Home Assistant automations fire, such as a button being pressed or motion being detected.
For all “wait” actions, you can add an optional timeout that will stop the automation after a set period of time elapses. This ensures that a “wait for a template” action doesn’t cause an automation to pause indefinitely, for example.
Create a scene
The “scene.create” action can be really useful and it’s not one I was really aware of for a long time. It’s effectively a way to take a snapshot of the current state of devices in your smart home. You can then recall that scene at any time to return your smart home to the exact state that it was in when you took the snapshot.
For example, if a water leak is detected, you might want the lights in your home to flash red so that you’re immediately informed about the problem. If you’d originally had the lights in the living room dimmed to watch TV, however, you don’t want them to come back on at full brightness once the water leak has been stopped.
Using the “scene.create” action, you can list all of the entities you want to take a snapshot of in the “Entities snapshot” section. If there are any entities that aren’t in the state you want, you can use the “Entity states” section to manually set the states of entities for your scene. You can then use the “scene.activate” action with the ID of the scene you created to return all your devices to their previous states.
Home Assistant has a large number of actions you can use in your automations. Even with the introduction of the new “Targets” selector, it can be easy to miss some of the useful actions that are available. It’s definitely worth trying some of them out, as they could save you a significant amount of time and effort.

