Home Assistant Automations Examples: 7 Proven Recipes
If you've ever walked out the front door and immediately wondered whether you left the lights on — or worse, the garage door open — you already understand why smart home automation exists. Home Assistant is one of the most powerful platforms for solving exactly these kinds of everyday annoyances, but for many homeowners the learning curve feels steep. The good news? You don't need to be a developer to get real value out of it. In this post, we're breaking down practical home assistant automations examples complete with YAML snippets you can copy, tweak, and deploy today.
Whether you're just getting started or you're looking to level up your existing setup, these recipes cover the most common household pain points: lights that actually behave intelligently, locks that respond to your presence, and sensors that do the thinking for you.
---
Why Home Assistant Automations Are Worth the Setup Time
Before we dive into the YAML, it's worth understanding what makes Home Assistant different from simpler smart home platforms. Unlike Alexa routines or Google Home scenes, Home Assistant gives you full local control, meaning your automations run even when the internet goes down. It also integrates with hundreds of devices across dozens of ecosystems — Zigbee, Z-Wave, Matter, Wi-Fi — all under one roof.
The real magic happens when you start writing automations that respond to context: time of day, who's home, what devices are active, and even weather conditions. That's where YAML-based automations shine. If you're curious about how local smart home tech fits into a broader connected home strategy, the team at Digital Kitsap has helped homeowners in the Pacific Northwest navigate exactly these decisions.
---
1. Lights On at Sunset (The Classic Starter)
This is the automation that hooks most people. Instead of fumbling for switches at dusk, your living room lights come on automatically.
yaml
alias: Living Room Lights at Sunset
trigger:
- platform: sun
event: sunset
offset: "-00:15:00"
action:
- service: light.turn_on
target:
entity_id: light.living_room
data:
brightness_pct: 60
color_temp: 3000
The offset parameter fires the automation 15 minutes before sunset — useful because actual darkness lags behind the astronomical event. You can also add a condition to only trigger this when someone is home, which we'll cover next.
---
2. Presence Detection: Home/Away Automation
Presence detection is arguably the most powerful category among home assistant automations examples. It transforms your home from passive to responsive.
This recipe uses the Home Assistant Companion App on your phone to detect when you leave or arrive:
yaml
alias: Welcome Home Scene
trigger:
- platform: state
entity_id: person.your_name
to: "home"
condition:
- condition: sun
after: sunset
action:
- service: scene.turn_on
target:
entity_id: scene.welcome_home
The condition block ensures the lights only flip on during evening arrivals — you don't need the house lit up when you pull in at noon. Pair this with a scene that sets your thermostat, disarms your alarm, and turns on the entryway lights, and your home genuinely feels like it's greeting you.
Pro tip: Use a combination of phone GPS, Wi-Fi detection, and a Bluetooth beacon for more reliable presence detection. False departures are the #1 frustration with presence-based automations, and layering sensors dramatically reduces them.
---
3. Smart Lock Auto-Lock After 5 Minutes
Forgetting to lock the front door is a genuine security concern. This automation handles it silently:
yaml
alias: Auto-Lock Front Door
trigger:
- platform: state
entity_id: lock.front_door
to: "unlocked"
for:
minutes: 5
condition:
- condition: state
entity_id: binary_sensor.front_door
state: "off"
action:
- service: lock.lock
target:
entity_id: lock.front_door
The condition checks that the door is actually closed before locking — you don't want the deadbolt engaging on an open door. This is one of those home assistant automations examples that sounds simple but requires a little logical nuance to get right.
---
4. Motion-Activated Night Lights (Without Waking the House)
This automation is a game-changer for households with kids or anyone who gets up in the middle of the night:
yaml
alias: Hallway Night Light - Motion Activated
trigger:
- platform: state
entity_id: binary_sensor.hallway_motion
to: "on"
condition:
- condition: time
after: "22:00:00"
before: "06:00:00"
action:
- service: light.turn_on
target:
entity_id: light.hallway
data:
brightness_pct: 15
color_temp: 2200
- delay:
minutes: 2
- service: light.turn_off
target:
entity_id: light.hallway
The low brightness (15%) and warm color temperature (2200K) minimize disruption to your sleep cycle, while the 2-minute delay ensures the light stays on long enough to be useful. This is the kind of quality-of-life improvement that makes guests ask, "How does your house do that?"
---
5. Water Leak Detection Alert
This one isn't glamorous, but it might save you thousands of dollars in water damage:
yaml
alias: Water Leak Alert
trigger:
- platform: state
entity_id: binary_sensor.basement_water_sensor
to: "on"
action:
- service: notify.mobile_app_your_phone
data:
title: "⚠️ Water Leak Detected!"
message: "Check the basement immediately. Water sensor triggered."
- service: switch.turn_off
target:
entity_id: switch.main_water_valve
If you have a smart water valve (brands like Dome or Fortrezz work great with Home Assistant), the automation can shut off the water supply automatically. That second action is optional but enormously valuable.
Solutions like this are part of why connected home technology is expanding beyond convenience into genuine safety infrastructure — something the professionals at Digital Kitsap discuss often when helping clients build out their smart home ecosystems.
---
6. Morning Routine Trigger Based on Weekday
This automation uses a time-based trigger with a weekday condition so it doesn't blast your bedroom lights at 6 AM on Saturday:
yaml
alias: Weekday Morning Routine
trigger:
- platform: time
at: "06:30:00"
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: light.turn_on
target:
entity_id: light.bedroom
data:
brightness_pct: 40
color_temp: 4000
- delay:
minutes: 15
- service: climate.set_temperature
target:
entity_id: climate.main_thermostat
data:
temperature: 70
The gradual light increase (you can chain multiple light.turn_on calls with delays) mimics a natural sunrise, which is significantly easier on your body than a jarring alarm. Pairing this with your thermostat ensures the house is comfortable by the time you're fully awake.
---
7. Guest Mode Toggle
One of the more sophisticated home assistant automations examples involves a virtual switch that temporarily disables automations when guests are over — because nobody wants their house shutting the lights off while company is sitting in the living room:
yaml
alias: Guest Mode - Disable Motion Automations
trigger:
- platform: state
entity_id: input_boolean.guest_mode
to: "on"
action:
- service: automation.turn_off
target:
entity_id:
- automation.living_room_motion_off
- automation.hallway_night_light
Create an input_boolean.guest_mode in your Helpers section, put it on your dashboard, and toggle it when visitors arrive. Simple, but it solves a real UX problem that comes up constantly in smart homes.
---
Putting It All Together
The home assistant automations examples above represent a progression from simple time-based triggers to contextual, multi-condition logic. As you get comfortable with YAML structure, you'll start combining these patterns in creative ways — like triggering your morning routine only if your phone has been still (i.e., you've been sleeping) for at least 6 hours, or locking the doors only after confirming all windows are closed.
Home Assistant's power comes from layering these building blocks. Start with one or two automations, test them thoroughly, then build outward.
If you're looking for guidance on how to integrate these automations into a broader smart home or networking strategy — especially in the Kitsap Peninsula area — Digital Kitsap offers the kind of local, hands-on expertise that online forums can't replace. From network infrastructure to device selection, having a trusted local resource makes the difference between a frustrating setup and one that just works.
For deeper dives into Home Assistant configuration, integrations, and local tech resources, keep an eye on the Digital Kitsap blog — it's a growing hub for Pacific Northwest homeowners serious about smart technology.
---
Final Takeaway
Smart home automation doesn't have to mean complex setups or expensive professional installs. The home assistant automations examples in this post prove that a few dozen lines of YAML can eliminate daily annoyances, improve your home's security, and genuinely make your living space feel like it's working for you. Start small, iterate often, and don't be afraid to look at the Home Assistant community forums for inspiration. The best automation is the one you'll actually use — and that usually starts with solving something that bugs you every single day.
Stay Ahead
Delivered each morning.