A Z-Wave powered Light Switch automating the Foyer entry light
Home ยป Blog ยป 10 Intermediate Home Assistant Automations, Pulled From My System

10 Intermediate Home Assistant Automations, Pulled From My System


๐Ÿ“… Published: May 2026 | โœ๏ธ By Brad Andrews | โฑ๏ธ 13 min read


If you have already worked through the beginner automation list, this is the natural next step. Every automation here is pulled directly from my live Home Assistant setup. Each one adds a bit more logic: a condition, a wait, a choose block. Nothing here requires deep YAML knowledge to understand or adapt.

The YAML is copy-paste ready. Replace the ALL_CAPS placeholders with your own entity IDs and you are good to go. A few of these also build directly on concepts from the beginner list, so if something looks familiar, that is intentional.

Are you just getting started? Check out the getting started guide before diving in.


How to Use the YAML in This Article

  1. Go to Settings โ†’ Automations & Scenes โ†’ Create Automation
  2. Click the three-dot menu in the top right and select Edit in YAML
  3. Paste the YAML, then use Find and Replace to swap every ALL_CAPS placeholder for your real entity ID
  4. Save and test

Entity IDs live under Settings โ†’ Devices & Services or Developer Tools โ†’ States.


1. Foyer Light Auto-Off When Forgotten Overnight

What it does: Between midnight and 7am, if the foyer light has been on for two or more hours and there has been no motion on the main floor for 30 minutes, it turns the light off automatically.

Why it punches above its weight: Three conditions working together catch a very specific scenario: the light nobody remembered before bed. Time window, light duration, and motion absence all have to be true at once. It never fires when someone is actually up, and it runs silently every night without you thinking about it.

What you need: A smart switch on the foyer light and a motion sensor covering the main floor.

yaml

alias: Foyer Light Auto Off When Forgotten Overnight
description: >
  Between midnight and 7am, if the foyer light has been on for 2+ hours
  and no main floor motion for 30 minutes, turns it off automatically.
mode: single
trigger:
  - platform: time
    at: "00:00:00"
  - platform: time
    at: "01:00:00"
  - platform: time
    at: "02:00:00"
  - platform: time
    at: "03:00:00"
  - platform: time
    at: "04:00:00"
  - platform: time
    at: "05:00:00"
  - platform: time
    at: "06:00:00"
condition:
  - condition: state
    entity_id: switch.YOUR_FOYER_LIGHT
    state: "on"
    for:
      hours: 2
  - condition: time
    after: "00:00:00"
    before: "07:00:00"
  - condition: state
    entity_id: binary_sensor.YOUR_MAIN_FLOOR_MOTION
    state: "off"
    for:
      minutes: 30
action:
  - action: switch.turn_off
    target:
      entity_id: switch.YOUR_FOYER_LIGHT

Replace: YOUR_FOYER_LIGHT with your foyer light switch entity. YOUR_MAIN_FLOOR_MOTION with your main floor motion sensor binary sensor entity.

Tip: The seven hourly time triggers are deliberate. The light could be forgotten at any point in the night, so the automation checks at each hour rather than waiting for a single window. Adjust the for: hours: 2 value if you want it to catch lights left on for a shorter time.


2. Great Room TV Scene : Play and Pause

What it does: When the great room TV starts playing after sunset, a scene activates that sets the lights for watching. When the TV pauses, the lights raise back up to 25% and the island light turns on.

Why it punches above its weight: Lights that respond to what you are doing rather than just the time of day. Pause the movie to grab a snack and the lights come up without touching a switch. Press play and they drop back down. The sun condition keeps it from running during the day when you do not need it.

What you need: A media player entity in Home Assistant for your TV and a saved scene for your watch lighting. Smart lights or switches in the great room.

Automation A : Lights Dim When TV Plays

yaml

alias: Great Room Playing at Night Set Scene
description: >
  When the great room TV starts playing after sunset,
  activate the night watch scene.
mode: single
trigger:
  - platform: device
    device_id: YOUR_TV_DEVICE_ID
    domain: media_player
    entity_id: media_player.YOUR_GREAT_ROOM_TV
    type: playing
condition:
  - condition: sun
    after: sunset
    before: sunrise
action:
  - action: scene.turn_on
    target:
      entity_id: scene.YOUR_NIGHT_WATCH_SCENE

Automation B : Lights Raise When TV Pauses

yaml

alias: Great Room TV Paused at Night Raise Lights
description: >
  When the great room TV pauses after sunset,
  raise the accent light and turn on the island light.
mode: single
trigger:
  - platform: device
    device_id: YOUR_TV_DEVICE_ID
    domain: media_player
    entity_id: media_player.YOUR_GREAT_ROOM_TV
    type: paused
condition:
  - condition: sun
    after: sunset
    before: sunrise
action:
  - type: turn_on
    domain: light
    device_id: YOUR_ACCENT_LIGHT_DEVICE_ID
    entity_id: light.YOUR_ACCENT_LIGHT
    brightness_pct: 25
  - type: turn_on
    domain: switch
    device_id: YOUR_ISLAND_LIGHT_DEVICE_ID
    entity_id: switch.YOUR_ISLAND_LIGHT

Replace: YOUR_GREAT_ROOM_TV with your TV media player entity. YOUR_NIGHT_WATCH_SCENE with your saved scene entity. Create this in Settings โ†’ Automations & Scenes โ†’ Scenes and set your lights to the brightness and colour you want for watching. Replace YOUR_ACCENT_LIGHT and YOUR_ISLAND_LIGHT with your own light entities.


3. Back Door Alert With Camera Snapshot

What it does: When the kitchen back door opens, both phones get a push notification with a live snapshot from the deck camera attached. At the same time, the kitchen tablet announces the door out loud via TTS. Tapping the notification opens directly to the deck camera view in the Home Assistant app.

Why it punches above its weight: One trigger fires three things simultaneously: a visual alert on both phones with camera context, and an audio alert on the main floor. The notification tag means each new alert replaces the previous one rather than stacking up.

What you need: A contact sensor on the back door, a camera with a Home Assistant entity, and the Home Assistant Companion app installed on both phones.

yaml

alias: Door Open Alert for Kitchen Back Door
description: >
  Notify both phones with a deck camera snapshot when the kitchen back
  door opens. Announce on kitchen tablet via TTS at the same time.
  Notification tag replaces previous alert rather than stacking.
mode: single
trigger:
  - platform: device
    device_id: YOUR_BACK_DOOR_SENSOR_DEVICE_ID
    domain: binary_sensor
    entity_id: binary_sensor.YOUR_BACK_DOOR_CONTACT_SENSOR
    type: opened
action:
  - action: notify.mobile_app_YOUR_PHONE
    data:
      title: "๐Ÿšช Kitchen Back Door Opened"
      message: "The kitchen back door was opened!"
      data:
        tag: kitchen_back_door_open
        entity_id: camera.YOUR_DECK_CAMERA
        url: "homeassistant://navigate/YOUR_CAMERA_DASHBOARD_PATH"
  - action: notify.mobile_app_SPOUSE_PHONE
    data:
      title: "๐Ÿšช Kitchen Back Door Opened"
      message: "The kitchen back door was opened!"
      data:
        tag: kitchen_back_door_open
        entity_id: camera.YOUR_DECK_CAMERA
        url: "homeassistant://navigate/YOUR_CAMERA_DASHBOARD_PATH"
  - action: tts.speak
    data:
      cache: false
      media_player_entity_id: media_player.YOUR_KITCHEN_SPEAKER
      message: "Heads up! The kitchen back door was opened."
    target:
      entity_id: tts.YOUR_TTS_ENGINE

Replace: YOUR_BACK_DOOR_CONTACT_SENSOR with your door contact sensor entity. YOUR_DECK_CAMERA with your camera entity. YOUR_CAMERA_DASHBOARD_PATH with the dashboard path for your camera view . Remove the url field entirely if you do not have a dedicated camera dashboard. YOUR_KITCHEN_SPEAKER with your kitchen media player entity. YOUR_TTS_ENGINE with your TTS entity, typically tts.piper for local voice or tts.home_assistant_cloud for Nabu Casa.

Note on entity_id vs file snapshot: Passing entity_id in the notification data lets the iOS companion app fetch the image directly from your local Home Assistant instance when the notification arrives. This is simpler and fresher than saving a JPEG to disk first. See the UniFi camera automations article for a deeper explanation of this approach.


4. UniFi Doorbell Fingerprint Unlock With Notification

What it does: When a recognized fingerprint is scanned on the UniFi G4 Doorbell Pro, the front door unlocks automatically, a push notification goes to your phone naming who unlocked it, and the event is logged to the Home Assistant logbook. Unrecognized scans are ignored entirely.

Why it punches above its weight: No app, no keypad, no key. One condition does the heavy lifting here. The identified event type check means the automation only fires when UniFi Protect has positively matched the fingerprint to a known person. Unknown or failed scans pass right through without triggering anything. The notification tells you not just that the door unlocked, but who did it, using the name stored in UniFi Protect against that fingerprint.

What you need: A UniFi G4 Doorbell Pro with fingerprint capability, the UniFi Protect integration connected in Home Assistant, and a Z-Wave or smart lock on the front door. Fingerprints are enrolled directly in the UniFi Protect app under the doorbell settings.

yaml

alias: Front Door Fingerprint Unlock
description: >
  Unlocks the front door when a recognized fingerprint is scanned on the
  G4 Doorbell Pro. Uses the native UniFi Protect fingerprint event.
  Ignores unrecognized scans. Sends a notification with the name of who unlocked.
mode: single
trigger:
  - platform: state
    entity_id: event.YOUR_DOORBELL_FINGERPRINT
condition:
  - condition: state
    entity_id: event.YOUR_DOORBELL_FINGERPRINT
    attribute: event_type
    state: identified
action:
  - action: lock.unlock
    target:
      entity_id: lock.YOUR_FRONT_DOOR_LOCK
  - action: notify.mobile_app_YOUR_PHONE
    data:
      title: "Front Door Unlocked"
      message: >
        {{ trigger.to_state.attributes.full_name }} unlocked the front door
        via fingerprint.
  - action: logbook.log
    data:
      name: "Front Door Fingerprint"
      message: "Unlocked by {{ trigger.to_state.attributes.full_name }}"

Replace: YOUR_DOORBELL_FINGERPRINT with your doorbell’s fingerprint event entity, found under Settings โ†’ Devices by searching for your G4 Doorbell Pro, then looking for the fingerprint event entity. YOUR_FRONT_DOOR_LOCK with your front door lock entity. YOUR_PHONE with your mobile app notify target.

Note on the identified condition: The event.front_door_fingerprint entity fires on every fingerprint scan attempt, recognized or not. The condition checks the event_type attribute and only continues if it equals identified. Without this condition, a failed or unknown scan would still trigger the unlock action. Keep this condition in place.

Note on full_name: The name in the notification comes directly from the full_name attribute on the fingerprint event, which UniFi Protect populates from the person profile you set up in the Protect app. Make sure each enrolled fingerprint has a proper name assigned in Protect or the notification will show a blank value.


5. Washer and Dryer Finished Notifications

What it does: When the washing machine finishes its cycle, both phones get a notification to switch the laundry to the dryer. When the dryer finishes, both phones get a notification to fold.

Why it punches above its weight: No more laundry sitting forgotten in the machine. The state sensor on a Samsung or LG appliance goes to finish at the end of a cycle. One trigger, two phones notified instantly.

What you need: A Samsung or LG washer and dryer connected via the SmartThings integration or the native Home Assistant integration. The job state sensor is included automatically.

Automation A : Washer Finished

yaml

alias: Washing Machine Finished Notification
description: "Notify both phones when the wash cycle finishes"
mode: single
trigger:
  - platform: state
    entity_id: sensor.YOUR_WASHER_JOB_STATE
    to: "finish"
action:
  - action: notify.mobile_app_YOUR_PHONE
    data:
      title: "Washing Machine Finished"
      message: "Time to switch to the dryer!"
  - action: notify.mobile_app_SPOUSE_PHONE
    data:
      title: "Washing Machine Finished"
      message: "Time to switch to the dryer!"

Automation B : Dryer Finished

yaml

alias: Dryer Finished Notification
description: "Notify both phones when the dryer cycle finishes"
mode: single
trigger:
  - platform: state
    entity_id: sensor.YOUR_DRYER_JOB_STATE
    to: "finish"
action:
  - action: notify.mobile_app_YOUR_PHONE
    data:
      title: "Dryer Finished"
      message: "Time to fold!"
  - action: notify.mobile_app_SPOUSE_PHONE
    data:
      title: "Dryer Finished"
      message: "Time to fold!"

Replace: YOUR_WASHER_JOB_STATE and YOUR_DRYER_JOB_STATE with your appliance job state sensor entities. These are typically named sensor.washer_job_state and sensor.dryer_job_state but confirm under Settings โ†’ Devices by searching for your appliance name. YOUR_PHONE and SPOUSE_PHONE with your mobile app notify targets.


6. Kids Room Lamp Auto-Off After No Motion

What it does: If no motion is detected in a room for five minutes and the lamp is still on, it turns off automatically. The condition check confirms the lamp is actually on before acting. No unnecessary service calls.

Why it punches above its weight: Kids leave lights on without thinking about it. This automation runs silently and handles it every time. The is_on condition is a small but important detail. It stops the automation from firing when the light is already off, which keeps your automation trace logs clean and avoids pointless state calls.

What you need: A motion sensor and a smart lamp or smart switch in each room you want to cover.

yaml

alias: Kids Room Lamp Auto Off After No Motion
description: >
  Turn off the lamp after 5 minutes of no motion, only if it is currently on.
mode: single
trigger:
  - platform: device
    device_id: YOUR_MOTION_SENSOR_DEVICE_ID
    domain: binary_sensor
    entity_id: binary_sensor.YOUR_MOTION_SENSOR
    type: no_motion
    for:
      minutes: 5
condition:
  - condition: device
    device_id: YOUR_LAMP_DEVICE_ID
    domain: light
    entity_id: light.YOUR_LAMP
    type: is_on
action:
  - type: turn_off
    domain: light
    device_id: YOUR_LAMP_DEVICE_ID
    entity_id: light.YOUR_LAMP

Replace: YOUR_MOTION_SENSOR_DEVICE_ID and YOUR_MOTION_SENSOR with your motion sensor’s device ID and entity. YOUR_LAMP_DEVICE_ID and YOUR_LAMP with your lamp device ID and entity. Duplicate and update the entity IDs for each room.


7. Hot Tub Light Dims the Surroundings

What it does: When the hot tub light turns on, the surrounding deck and fence lights dim down automatically. When the hot tub light turns off, the deck lights restore to full brightness.

Why it punches above its weight: The hot tub has its own light for a reason. Brighter surrounding lights work against the atmosphere. This automation handles the scene shift without any manual dimming. Two automations, one paired behaviour.

What you need: Smart lights on the deck and fence areas, and a smart switch or light entity for the hot tub light.

Automation A : Dim Surroundings When Hot Tub Light Turns On

yaml

alias: Hot Tub Light On โ€” Dim Surrounding Lights
description: "Dim deck and fence lights when the hot tub light turns on"
mode: single
trigger:
  - platform: device
    device_id: YOUR_HOT_TUB_LIGHT_DEVICE_ID
    domain: light
    entity_id: light.YOUR_HOT_TUB_LIGHT
    type: turned_on
action:
  - type: turn_off
    domain: light
    device_id: YOUR_DECK_LIGHT_DEVICE_ID
    entity_id: light.YOUR_DECK_LIGHT
  - type: turn_off
    domain: light
    device_id: YOUR_FENCE_LIGHT_DEVICE_ID
    entity_id: light.YOUR_FENCE_LIGHT

Automation B : Restore Surroundings When Hot Tub Light Turns Off

yaml

alias: Hot Tub Light Off โ€” Restore Surrounding Lights
description: "Restore deck lights to full brightness when the hot tub light turns off"
mode: single
trigger:
  - platform: device
    device_id: YOUR_HOT_TUB_LIGHT_DEVICE_ID
    domain: light
    entity_id: light.YOUR_HOT_TUB_LIGHT
    type: turned_off
action:
  - type: turn_on
    domain: light
    device_id: YOUR_DECK_LIGHT_DEVICE_ID
    entity_id: light.YOUR_DECK_LIGHT
    brightness_pct: 100

Replace: YOUR_HOT_TUB_LIGHT with your hot tub light entity. YOUR_DECK_LIGHT and YOUR_FENCE_LIGHT with your surrounding light entities. Add or remove action entries to match however many outdoor lights you want to include.


8. Backyard Lighting on Door Open (Clarke-Aware)

What it does: When the kitchen back door opens after sunset, the fence lights turn on. The automation then waits up to 20 minutes to see if a person is detected in the backyard. If a person is detected, it stops there and lets them manage the lights manually. If no person is detected within 20 minutes, meaning it was just the dog going out, it waits for all backyard animal detection to clear for five continuous minutes, then turns the lights off automatically.

Why it punches above its weight: It knows the difference between you and the dog. If Clarke goes out alone, the lights come on, stay on while he is outside, and turn off once he is back in. If you go out, they stay on until you decide. One automation, two very different outcomes based on what actually happened.

What you need: A contact sensor on the back door, fence lights, and a camera with both person detection and animal detection binary sensors. A binary_sensor.person_in_backyard group combining your backyard cameras is helpful. Create this under Settings โ†’ Helpers โ†’ Group โ†’ Binary Sensor Group.

yaml

alias: Backyard Lighting on Door Open
description: >
  Turns on fence lights when the kitchen back door opens after sunset.
  Waits up to 20 minutes for person detection. If detected, leaves lights
  for manual control. If only the dog, waits for animal detection to clear
  for 5 minutes then turns lights off.
mode: restart
trigger:
  - platform: device
    device_id: YOUR_BACK_DOOR_SENSOR_DEVICE_ID
    domain: binary_sensor
    entity_id: binary_sensor.YOUR_BACK_DOOR_CONTACT_SENSOR
    type: opened
condition:
  - condition: sun
    after: sunset
    before: sunrise
action:
  - alias: Turn on fence lights
    action: light.turn_on
    target:
      entity_id: light.YOUR_FENCE_LIGHTS
  - alias: Wait up to 20 minutes for a person to be detected
    wait_for_trigger:
      - platform: state
        entity_id: binary_sensor.YOUR_PERSON_IN_BACKYARD
        to: "on"
        id: person_detected
    timeout:
      minutes: 20
    continue_on_timeout: true
  - alias: If a person was detected, stop here and let them manage the lights
    condition: template
    value_template: >
      {{ wait.trigger is not none and wait.trigger.id == 'person_detected' }}
  - alias: No person โ€” wait for animal detection to clear for 5 minutes
    wait_for_trigger:
      - platform: state
        entity_id:
          - binary_sensor.YOUR_BACKYARD_ANIMAL_SENSOR_1
          - binary_sensor.YOUR_BACKYARD_ANIMAL_SENSOR_2
          - binary_sensor.YOUR_BACKYARD_ANIMAL_SENSOR_3
        to: "off"
        for:
          minutes: 5
        id: animal_gone
    timeout:
      hours: 2
    continue_on_timeout: true
  - alias: Turn off fence lights โ€” dog is back inside
    action: light.turn_off
    target:
      entity_id: light.YOUR_FENCE_LIGHTS

Replace: YOUR_BACK_DOOR_CONTACT_SENSOR with your door contact sensor entity. YOUR_FENCE_LIGHTS with your fence light entity or group. YOUR_PERSON_IN_BACKYARD with your backyard person detection binary sensor or group. YOUR_BACKYARD_ANIMAL_SENSOR_1/2/3 with the animal detection sensors from each backyard camera. Add or remove entries to match your camera count.

Note on mode: restart: This automation uses mode: restart so that if the door opens again while the automation is waiting, it starts fresh. Without this, a second door open while the automation is mid-wait would be ignored entirely.


9. Garage Motion Light After Dark

What it does: When the garage interior door opens after sunset, and both garage doors have been closed for at least ten minutes, the automation waits up to 60 seconds for camera motion to confirm someone actually entered. If motion is detected, the garage light turns on. It turns off three minutes after motion stops.

Why it punches above its weight: The ten-minute garage door condition is the key detail. If either garage door has been open recently, someone is probably already in the garage. This automation is for the person entering from the house side in the dark. Motion confirmation before the light fires means it runs on actual entry, not just the door sensor.

What you need: A contact sensor on the garage interior door, a motion sensor or camera motion binary sensor in the garage, and a smart light.

yaml

alias: Garage Motion Light After Dark
description: >
  When the garage man door opens after sunset, and both garage doors have been
  closed for 10+ minutes, wait up to 60 seconds for camera motion. If motion
  is detected, turn on the garage light and turn it off 3 minutes after
  motion clears.
mode: restart
trigger:
  - platform: state
    entity_id: binary_sensor.YOUR_GARAGE_MAN_DOOR_SENSOR
    to: "on"
condition:
  - condition: state
    entity_id: sun.sun
    state: below_horizon
  - condition: state
    entity_id: cover.YOUR_LEFT_GARAGE_DOOR
    state: closed
    for:
      minutes: 10
  - condition: state
    entity_id: cover.YOUR_RIGHT_GARAGE_DOOR
    state: closed
    for:
      minutes: 10
action:
  - wait_for_trigger:
      - platform: state
        entity_id: binary_sensor.YOUR_GARAGE_MOTION_SENSOR
        to: "on"
    timeout:
      seconds: 60
    continue_on_timeout: false
  - action: light.turn_on
    target:
      entity_id: light.YOUR_GARAGE_LIGHT
  - wait_for_trigger:
      - platform: state
        entity_id: binary_sensor.YOUR_GARAGE_MOTION_SENSOR
        to: "off"
    timeout:
      hours: 1
    continue_on_timeout: true
  - delay:
      minutes: 3
  - action: light.turn_off
    target:
      entity_id: light.YOUR_GARAGE_LIGHT

Replace: YOUR_GARAGE_MAN_DOOR_SENSOR with your garage interior door contact sensor. YOUR_LEFT_GARAGE_DOOR and YOUR_RIGHT_GARAGE_DOOR with your garage door cover entities. Remove one if you only have a single door. YOUR_GARAGE_MOTION_SENSOR with your garage motion binary sensor. YOUR_GARAGE_LIGHT with your garage light entity.

Note on continue_on_timeout: The first wait uses continue_on_timeout: false. If no motion is detected within 60 seconds, the automation stops entirely and the light stays off. The second wait uses continue_on_timeout: true so that if the motion sensor stops reporting before clearing properly, the light still turns off after an hour rather than staying on indefinitely.


10. Nightly Lock-Up With Smart Summary

What it does: At 11pm, all six Yale locks are locked simultaneously. Five seconds later, the automation checks which locks actually confirmed a locked state. It then sends a summary to both phones listing which locks needed locking versus which were already secured, and flags any that failed to respond with a warning.

Why it punches above its weight: The simple version of this automation (covered in the beginner list) just sends a lock command at 11pm and calls it done. This version confirms it worked. The Jinja2 variable logic snapshots the state of every lock before and after acting, so the summary tells you something useful rather than just confirming the automation ran.

What you need: Yale or any Z-Wave smart locks connected in Home Assistant. The Home Assistant Companion app on both phones for the push notification.

yaml

alias: Nightly 11pm Lock Up With Summary
description: >
  At 11pm, locks all Yale locks. Waits 5 seconds for state confirmation.
  Sends a smart summary to both phones: which locks needed locking,
  which were already secured, and flags any that failed to respond.
mode: single
trigger:
  - platform: time
    at: "23:00:00"
action:
  - alias: Snapshot which locks were already locked before acting
    variables:
      locks:
        - ["lock.YOUR_FRONT_DOOR_LOCK", "Front Door"]
        - ["lock.YOUR_BACK_DOOR_LOCK", "Back Door"]
        - ["lock.YOUR_GARAGE_MAN_DOOR_LOCK", "Garage Man Door"]
        - ["lock.YOUR_SIDE_DOOR_LOCK", "Side Door"]

  - alias: Build list of which were unlocked before locking
    variables:
      unlocked_names: >
        {% set ns = namespace(names=[]) %}
        {% for entity_id, name in locks %}
          {% if states(entity_id) != 'locked' %}
            {% set ns.names = ns.names + [name] %}
          {% endif %}
        {% endfor %}
        {{ ns.names }}

  - alias: Lock all doors
    action: lock.lock
    target:
      entity_id: >
        {{ locks | map(attribute=0) | list }}

  - alias: Wait 5 seconds for locks to confirm state
    delay:
      seconds: 5

  - alias: Build confirmation summary
    variables:
      summary_message: >
        {% set ns = namespace(failed=[]) %}
        {% for entity_id, name in locks %}
          {% if states(entity_id) != 'locked' %}
            {% set ns.failed = ns.failed + [name] %}
          {% endif %}
        {% endfor %}
        {% if ns.failed | length == 0 %}
          {% if unlocked_names | length == 0 %}
            All locks were already secured.
          {% else %}
            {{ unlocked_names | length }} lock{{ 's' if unlocked_names | length > 1 }} secured: {{ unlocked_names | join(', ') }}. All locked.
          {% endif %}
        {% else %}
          {{ ns.failed | length }} lock{{ 's' if ns.failed | length > 1 }} FAILED to lock: {{ ns.failed | join(', ') }}. Check these now.
        {% endif %}

  - alias: Send summary to both phones
    parallel:
      - action: notify.mobile_app_YOUR_PHONE
        data:
          title: "House Secured โ€” 11pm Lock-Up"
          message: "{{ summary_message }}"
          data:
            sticky: "false"
            tag: nightly_lockup
      - action: notify.mobile_app_SPOUSE_PHONE
        data:
          title: "House Secured โ€” 11pm Lock-Up"
          message: "{{ summary_message }}"
          data:
            sticky: "false"
            tag: nightly_lockup

Replace: Update the locks variable list with your own lock entity IDs and friendly names. Add or remove entries to match your actual doors. YOUR_PHONE and SPOUSE_PHONE with your mobile app notify targets.

Note on the locks variable: The list format ["lock.entity_id", "Friendly Name"] is what makes the before/after comparison work. Each lock has both its entity ID for state checking and a plain name for the notification message. The Jinja2 logic loops through both lists and matches them up. If you add more locks, just add another line to the list in the same format.


What to Build Next

These ten automations add meaningful logic to your setup without requiring you to go deep on YAML syntax. Each one is a real automation running in my home right now, and each one has saved a real moment of frustration at some point.

If you have not worked through the beginner automation list yet, that is a good place to start. The concepts there feed directly into everything here.

You may also want to make sure your add-ons and integrations are in place before building further. The Essential Home Assistant Add-Ons Every User Should Install covers the foundation layer.

If you built any of these or adapted them into something better, share it on the Facebook page. That is where the best ideas in this community tend to surface.


Smart Home Secrets is reader-supported. We may earn a commission if you buy through our links.


Join The Network on Facebook

Automations, setup ideas, and real-home experiments. Posted as they happen.

Follow on Facebook