Smart home gadgets feel magic right up until the cloud goes down and your lights forget how to turn themselves on. The thing that makes a smart home actually reliable is local logic, and in Home Assistant that logic is the automation. A Home Assistant automation is a rule that runs actions when a trigger fires and any conditions you set are met, and it runs on your own hardware rather than someone else's server.
Quick Answer
A Home Assistant automation has three parts: a trigger that starts it, optional conditions that must be true, and the actions it runs. It executes locally on your own hardware, so it keeps working even with no internet. A simple one turns a hallway light on at sunset and off at 23:00 every day.
The three parts, and how they fit together
Every automation is built from the same three pieces, and understanding the order they fire in is most of the battle.
- Triggers are the events that start the automation: motion detected, the sun setting, a button pressed, a specific time arriving.
- Conditions are optional gates that must be true for the actions to run, such as only after dark or only when someone is home.
- Actions are what happens as a result: turn on a light, send a notification, lock a door.
The sequence is strict. The moment a trigger fires, Home Assistant checks the conditions. If they pass, it runs the actions. If they fail, nothing happens and it waits for the next trigger.
Triggers versus conditions, the part that trips people up
These two look almost identical in the configuration, which is exactly why beginners confuse them. The difference is timing. A trigger watches for an event to happen and starts the automation when it does. A condition only checks the current state after the automation has already been triggered.
Put plainly: a trigger can notice that the sun just set, the moment it happens. A condition can only ask whether it is currently dark. So "turn the light on when the sun sets" is a trigger, while "only if it is already dark" is a condition. Get this distinction right and most of your automations behave the way you expect on the first try.
A worked example
Take the classic hallway light. The trigger is sunset, so the automation fires the moment the sun goes down. You might add a condition that someone is home, so it does not light an empty house. The action turns the hallway light on. A second time trigger at 23:00 turns it off. That rule then runs every day, on its own, with no app to open and no cloud to call.
In current Home Assistant the YAML keys are plural, so you write triggers, conditions, and actions, reflecting that most real automations have more than one of each. You can build the same rule in the visual editor without writing YAML at all, then peek at the generated YAML to learn the structure.
Why local execution is the point
Because automations run on your own Home Assistant hardware, they do not depend on a cloud service staying online. Your sunset routine still fires if your internet is down, which is exactly the reliability that cloud-tied smart home apps lack. That local-first behaviour is the main reason people move to Home Assistant in the first place, and it is worth choosing smart home devices that support local control rather than cloud-only operation. The small bits you add as you expand, sensors, plugs, and hubs, often appear in the accessories best sellers list.
Frequently Asked Questions
What is the difference between a trigger and a condition?
A trigger is an event that starts the automation, like the sun setting. A condition is a state check that happens after the trigger, like whether it is currently dark. Triggers begin the automation, conditions decide whether it proceeds.
Do Home Assistant automations need the internet?
No. They run locally on your Home Assistant hardware, so they keep working when your internet connection drops. That local execution is one of the main reasons people choose it over cloud-dependent smart home platforms.
Are conditions required?
No, conditions are optional. An automation needs at least a trigger and an action. Conditions only add when you want to restrict the actions to certain situations, such as time of day or who is home.
Can I build an automation without writing YAML?
Yes. Home Assistant has a visual automation editor that builds the rule for you. It generates the underlying YAML behind the scenes, so it is also a good way to learn the structure before editing YAML directly.
A reliable smart home starts with devices that support local control, so your routines keep running no matter what the internet is doing. Browse the smart home range at Evetech to build a setup ready for Home Assistant automations.