How to Create Your First Home Assistant Automation
Automations are the “brain” of Home Assistant. They allow you to move beyond manual control (pressing buttons in an app) to a truly smart home that anticipates your needs based on events and state changes.
The Foundation: Triggers, Conditions, and Actions
Every automation in Home Assistant follows a simple logic: When X happens (Trigger), if Y is true (Condition), then do Z (Action).
- Triggers: The event that starts the automation (e.g., “The sun sets”, “A motion sensor detects movement”).
- Conditions: Optional checks to ensure the automation only runs when it makes sense (e.g., “Only if I am at home”, “Only if it is after 10:00 PM”).
- Actions: What you want Home Assistant to actually do (e.g., “Turn on the porch lights”, “Send a notification”).
Step-by-Step: Creating a “Welcome Home” Automation
Let’s walk through creating an automation that turns on the hallway light when you arrive home after dark.
1. Open the Automation Editor
Navigate to Settings > Automations & Scenes and click Create Automation in the bottom right. Select “Create new automation”.
2. Set the Trigger
- Click Add Trigger.
- Search for and select Zone.
- Choose your Person (or device tracker) and the Home zone.
- Set the event to Enter.
3. Add a Condition
We don’t want the lights turning on during the day.
- Click Add Condition.
- Search for and select Sun.
- Choose After Sunset.
4. Define the Action
- Click Add Action.
- Select Device.
- Find your hallway light and set the action to Turn on.
5. Save and Test
Give your automation a descriptive name (e.g., “Hallway Light on Arrival”) and click Save. You can test the “Action” part immediately by clicking the three dots on the action card and selecting Run.
Debugging Your Automations
If an automation doesn’t fire when you expect it to, use the Trace tool.
- Open your automation in the editor.
- Click Traces at the top right.
- This shows a step-by-step visual timeline of exactly where the logic failed (e.g., which condition stopped the action from running).
Start simple, and soon you’ll have an Intel NUC managing your entire home effortlessly!