Home Assistant Advanced Automation Guides
Quick take: Home Assistant's automation engine supports conditional logic, presence detection, weather triggers, and multi-step action sequences -- no subscription required. Blueprints from the Blueprint Exchange give you tested automation templates without writing YAML. Scripts are reusable action sequences; scenes restore saved device states. Complex automations use YAML, but the visual editor handles most common patterns without code.
Home Assistant's real power isn't the device integrations -- it's the automation engine. Once you've gotten comfortable with the basic UI and your devices are connected, advanced automations are where the platform separates itself from every commercial smart home system. No subscription required. No restrictions on what devices can trigger what actions. The only limit is what sensors and logic you're willing to configure.
This section is for users who've moved past basic on/off schedules and want automations that respond to actual context: presence, time, sensor state combinations, device history, and external data feeds like weather or calendar events. If you haven't gone through the Home Assistant setup guide yet, start there -- advanced automations require a properly configured base installation with backups, user accounts, and a working Zigbee or Z-Wave coordinator.
What Does Advanced Home Assistant Automation Actually Mean?
Most smart home users run simple automations: lights on at sunset, thermostat down at bedtime. These work and are worth setting up. Advanced automation is different in kind, not just complexity.
Advanced automations use conditional logic -- "when X happens AND condition Z is true AND it hasn't happened in the last 30 minutes, do Y" -- rather than simple trigger-action pairs. The practical results look like:
- Turn on the porch light when motion is detected, but only after sunset and only when the security mode is armed
- Send a notification if the garage door has been open for more than 15 minutes between 10 PM and 6 AM
- Start the robot vacuum when everyone leaves the house, but only if it hasn't run today and only on weekdays
- Adjust the thermostat setpoints based on tomorrow's weather forecast, not just a fixed schedule
- Dim the living room lights gradually over 45 minutes before bed rather than switching them off abruptly
These automations change how you experience your home. They're the difference between a home that waits for commands and a home that responds to how you actually live. The garage door one caught me off guard -- I'd assumed I was good about closing it, but the first week of notifications showed I was leaving it open past midnight about twice a month.
The Home Assistant smart home guide covers the full device ecosystem -- sensors, integrations, and network setup -- that makes automations like these practical to build.
How Is the Home Assistant Automation Architecture Structured?
Home Assistant automations have four distinct components, and understanding all four is necessary for building anything beyond basic triggers.
Triggers start the automation. A state change in an entity, a time event, a webhook from an external service, a calendar entry, a numeric threshold crossing (temperature above 80F), or a tag scan all work as triggers. Multiple triggers can apply to a single automation -- any one of them fires the automation.
Conditions are optional checks that must pass before the automation proceeds. Is it currently after sunset? Is anyone home? Is the temperature above a threshold? Has this automation run in the last hour? Conditions use the same template syntax as other Home Assistant fields, which means they can be arbitrarily complex logical expressions.
Actions are what actually happens: call a service, send a notification, run a script, set a scene, add a delay, or loop through a sequence. Actions support parallel execution -- multiple things can happen simultaneously rather than sequentially.
Automation Modes
Mode controls what happens when an automation is triggered while already running:
- Single: Ignore new triggers while running (default, good for most automations)
- Restart: Cancel the current run and start fresh (good for "dim lights, wait, then turn off" sequences)
- Queued: Finish the current run, then run again with the new trigger
- Parallel: Run multiple instances simultaneously (use carefully)
Mode matters most for automations triggered by frequently-changing sensors. A motion sensor that fires every 30 seconds will restart the automation 30 times without "single" mode set -- which is usually not what you want.
When Should You Use YAML vs. UI Automations in Home Assistant?
The visual automation editor in Home Assistant covers around 80% of practical use cases. For the remaining 20%, raw YAML gives you access to every available option. New to the platform? The getting started guide walks through the initial configuration that makes the automation editor usable from day one.
YAML advantages go beyond just coverage. Automations written in YAML are easier to share with others, can be stored in version control (git), and can be packaged as Blueprints for reuse across multiple instances. The Home Assistant Blueprint documentation covers the format in detail -- Blueprints let you create parameterized automations where users fill in device names, thresholds, and times rather than editing YAML directly.
The Bridge approach works well: build an automation in the UI until you hit a limitation, then export it to YAML using the Edit as YAML button and extend it from there. The UI-generated YAML is clean and readable, making it a good starting point for manual editing.
How Do You Use Scripts and Scenes for Reusable Automation Logic?
Scripts in Home Assistant are named, reusable action sequences. Rather than duplicating identical action lists across multiple automations, you create a script once and call it from anywhere.
A "Movie Mode" script might dim the living room lights to 15%, adjust the bias lights behind the TV to a specific color temperature, set the thermostat down two degrees (movie watching generates body heat), and send the speaker volume to a preset level. The Philips Hue integration guide covers setting up full color and brightness control so scripts like this work reliably. Five automations can call that script -- from a voice command, a dashboard button, a TV power-on trigger, or a time-based scene. Change the script once and all five automations update.
Scenes work differently: they save the current state of a set of entities and let you restore that exact state later. "Living Room: Evening Reading" captures the brightness level, color temperature, and which lights are on for that specific state. Activate it from an automation or dashboard button and everything returns to that saved configuration simultaneously.
Scripts support wait_for_trigger and wait_template actions that pause execution until a condition is met or an event fires. This enables sequences like: "turn on lights, wait until motion stops being detected, delay 3 minutes, then turn them off." You can build this entire sequence in one script without needing separate automations for each step.
How Do You Set Up Presence Detection That Actually Works?
Reliable presence detection is the hardest problem in home automation. Get it wrong and automations fire when nobody's home (wasted energy) or fail to fire when people return (frustrating experience).
Common approaches and their failure modes:
- Wi-Fi device tracking: Fast when someone connects, but mobile phones aggressively drop Wi-Fi when sleeping. False "away" readings are common.
- GPS from phone apps: More reliable but has 1-5 minute delay between physical location change and state update.
- Router-based tracking: Depends on your router's API. Very fast when it works; breaks completely when the router is updated.
The solution that works reliably is combining multiple presence methods through Home Assistant's Person entity system. A Person entity aggregates multiple device trackers for the same person and applies a sensible combination rule: if any tracker shows "home," the person is home; only when all trackers agree on "away" is the person considered away. This dramatically reduces false "away" readings.
The Home Assistant Companion app on iOS and Android provides both Wi-Fi device tracking and GPS, and sends state updates when significant location changes are detected. Pair it with router-based tracking and you get fast detection on arrival and reliable detection on departure. I've been running this combination for eight months -- the Person entity marked me "away" incorrectly once after a firmware update, compared to false readings every few days when I relied on Wi-Fi tracking alone.
For households that want room-level presence (not just home/away), mmWave presence sensors from brands like Aqara, Tuya, and Sonoff detect stationary people rather than just motion.
For energy-aware automations -- tracking which circuits are active rather than just who's home -- the TONGOU smart switch metering guide covers per-circuit consumption monitoring that feeds directly into presence-informed automations. A person sitting still reading is invisible to a PIR motion sensor but detected by a radar-based presence sensor.
How Do You Use Blueprints and the Community Exchange?
Blueprints are reusable automation templates that accept user-defined inputs. Installing a Blueprint gives you a complete, tested automation structure that you customize with your own device names, time values, and thresholds.
The Home Assistant Blueprint Exchange on the Home Assistant Community forum has thousands of contributed Blueprints covering common patterns: motion-activated lights with configurable timeout, door left open notifications, presence-based thermostat control, and hundreds of others. Before writing complex YAML for a common use case, it's worth checking whether a Blueprint already handles it. The SmartThings to Home Assistant migration guide maps common SmartThings automations to Blueprint equivalents -- useful if you're arriving from a commercial hub.
Creating your own Blueprints becomes useful once you've built an automation you want to replicate in multiple rooms or share with other Home Assistant users. The Blueprint format adds input definitions at the top of a YAML automation file -- a few extra lines that make the whole thing reusable.
How Do You Create Template Sensors and Calculated Values?
Template sensors compute values from other entities rather than reading from physical hardware. The current outside temperature minus the inside temperature, a boolean that's true when any window is open, the battery percentage of the lowest-battery device in your Zigbee mesh -- these are all template sensors. Devices with built-in metering like Shelly relays in local mode feed live wattage into template sensors that power energy dashboards and consumption-triggered automations.
Use template sensors when you want to trigger on a computed value rather than a raw entity state. "Run the whole-house fan when the outside temperature drops below the inside temperature by more than 3 degrees" is much cleaner as a trigger on a template sensor than as a conditional logic mess inside an automation.
Advanced automation in Home Assistant rewards patience. The learning curve is real -- YAML errors, integration quirks, and debugging broken automations are part of the experience. But the payoff is a home that responds to your actual patterns rather than rigid schedules, with no subscription and no cloud dependency. A locally-hosted voice assistant is the natural extension -- commanding your own server instead of a cloud endpoint fits the same local-first approach.
Running Home Assistant on a dedicated Raspberry Pi hub rather than a general-purpose machine reduces resource contention and keeps complex automations executing on schedule. The community around Home Assistant is one of its best resources. The Home Assistant Community forum and the r/homeassistant subreddit both have active users troubleshooting issues and sharing automation ideas. Most problems have been solved by someone else first.
If your base installation is still fresh, the first 10 things to configure after installation checklist covers the logging, backups, and coordinator setup that all advanced automations depend on.
Browse the guides below for detailed walkthroughs of building a fully automated home using these advanced techniques applied across a complete setup.