Automations
Automations are at the heart of Home Assistant's power. They let you make your smart home truly smart by having things happen automatically - no need to open an app or press a button. With automations, your home responds to you, your schedule, sensors, time, and even the environment. An automation is a set of instructions that tells Home Assistant: "When something happens (a trigger), and if certain optional conditions are true (the conditions), then do something (the action)." Example of an automation you can create: "Turn on the hallway light if motion is detected, but only at night." When setting up the action for your automation, you'll often be asked what you want to control. You can usually choose from an area, a device, or an entity. Here's what each means: Which should you use? If your automation always applies to a whole room, use areas. If you only want to control a single item, use entity or device. Now your automation is ready to go. Test it by triggering any of your selected triggers and see if the action runs as expected! The visual editor covers almost everything you'll need, but sometimes guides or advanced features might mention "editing YAML." What is YAML? YAML (pronounced "yammel") is just a way of writing settings or instructions using plain text that's easy for both humans and computers to read. In Home Assistant, YAML files describe things like automations, scripts, or integrations. You can edit the underlying YAML for any automation by clicking the three dots (⋮) in the top right of the automation editor and choosing "Edit in YAML." This is completely optional - many users will never need to touch it, but it can be handy for copying settings, advanced tweaks, or following some online tutorials. What is an Automation?
You can add multiple conditions. Multiple Triggers & Conditions Explained
If you add more than one trigger (for example, "motion detected" or "door opened"), the automation will start if any one of the triggers occurs. This uses OR logic.
By default, if you add more than one condition (e.g. "It's after sunset" and "I'm home"), all conditions must be true for the automation to run. This uses AND logic.
If you want to change this, Home Assistant's visual editor lets you create groups of conditions with AND or OR blocks. For example, you could require that either "Person A is home" OR "Person B is home". Targeting: Area, Device, or Entity
Example: Turn off all lights in "Bedroom" at bedtime.
Benefit: Makes automations simpler to manage, especially as you add or change devices. If you add a new light to the "Hallway" area, or replace the existing one, your automations can control it automatically - no need to update each automation.
Example: Turn on your "Front Door Sensor" chime. light.kitchen_lamp or sensor.living_room_temperature. Every device creates one or more entities.
Benefit: Gives you fine-grained control if you want to act on just one specific light or sensor.Creating an Automation (Example)
Best Practice Tips
Editing YAML
Common Use Cases for Automations
Automations can be as simple or as complex as you like. Don't be afraid to experiment and try out new ideas - Home Assistant is designed to help you make your home work for you! Automations can be disabled or deleted at any time.