Key takeaways
- Start with time-based or sunset automations before motion sensors – they’re easier to troubleshoot and verify.
- The four most common beginner mistakes: leaving ‘From’ filled in state triggers, wrong time zone, entity ID typos, and automation mode conflicts.
- Each automation includes a device requirements matrix showing what’s required versus optional, plus specific entity IDs and menu paths.
- The visual editor handles most automations in 2026; learn YAML only when you need templates, complex conditions, or repeat loops.
- Test time-based automations by temporarily changing the time to 2 minutes from now, not by using the Run button, which bypasses the trigger.
Your first Home Assistant automation should turn off all lights at a specific time each night. This requires no sensors, works with any smart light brand, and teaches you the visual automation editor without introducing variables like sensor placement or motion timeouts. The five automations below progress from time-based triggers to state changes to numeric thresholds – the three patterns that cover most home automation use cases.
What You Need Before Starting
Before you create your first automation, verify you have:
- Home Assistant installed and accessible – version 2026.1 or later (check Settings → About)
- At least one smart device integrated – a light, switch, sensor, or media player already showing in your Devices & Services
- The entity ID of that device – found by clicking the device in Settings → Devices & Services → Entities, shown as something like
light.living_roomorbinary_sensor.front_door - Your time zone set correctly – Settings → System → General, under Location. An incorrect time zone is the second most common reason automations fail to trigger.
You do not need YAML knowledge for four of these five automations. The visual editor handles everything. The fifth automation includes YAML because it demonstrates how to graduate from the UI when you need more control.
1. Turn On a Light at Sunset
This automation turns on a specific light when the sun sets, using your Home Assistant location. No motion sensor required.
Device Requirements
| Required | Optional |
|---|---|
| One smart light or switch integrated into Home Assistant | Additional lights to turn on simultaneously |
| Location configured in Settings → System → General | Offset (e.g., 30 minutes before sunset) |
Setup Steps
- Navigate to Settings → Automations & Scenes
- Click the blue Create Automation button (bottom right)
- Click Create new automation (not “Start with an empty automation” – that’s for advanced users)
- Under “When”, click Add Trigger, then select Sun
- In the dropdown, choose Sunset. Leave offset at 0 unless you want the light on earlier.
- Under “Then do”, click Add Action, then Call service
- Search for and select Light: Turn on
- Click Choose entity and pick your light from the list
- Click the three dots (top right) → Rename and call it “Living room light at sunset” or similar
- Click Save
If this screen looks different: Home Assistant versions before 2026 show “Add Trigger” as a separate card. The function is identical – click the card, then choose Sun.
Verification
You cannot wait until sunset to test this. Instead, click the three dots next to your saved automation → Run. The light should turn on immediately. If it does, the automation works – it will trigger automatically at sunset going forward.
What breaks: If the light turns on at the wrong time, your location or time zone is wrong. If it never triggers, check that the light entity is available in Developer Tools → States.
2. Send a Notification When a Door Opens
This requires a door/window sensor. When the sensor changes to “open”, Home Assistant sends a notification to your phone.
Device Requirements
| Required | Optional |
|---|---|
| Door/window sensor integrated (Zigbee, Z-Wave, or Wi-Fi) | Multiple sensors to monitor |
| Home Assistant Companion app installed on your phone with notifications enabled | Condition to only notify when you’re away (requires device_tracker) |
Setup Steps
- Settings → Automations & Scenes → Create Automation
- Click Create new automation
- Under “When”, click Add Trigger → State
- Click Choose entity and select your door sensor (will be named something like
binary_sensor.front_door) - In “To”, type on (this is the “open” state for binary sensors)
- Under “Then do”, click Add Action → Call service
- Search for Notifications: Send a notification via mobile_app
- Your phone will appear as a target – select it
- In “Message”, type:
Front door opened - Rename the automation to “Front door open notification”
- Click Save
Verification
Open the door. You should receive a notification on your phone within seconds. If you don’t, check that the Home Assistant app has notification permissions enabled in your phone’s Settings → Apps → Home Assistant → Notifications.
What breaks: If notifications never arrive, the Companion app may not be registered as a mobile_app device. Go to Settings → Devices & Services → Mobile App to verify your phone appears. If the sensor shows “unavailable” in Developer Tools → States, the integration lost connection to the sensor.
3. Turn Off All Lights at Bedtime
This automation runs at a specific time every night, turning off every light in your home. It has immediate, visible impact and requires no sensors.
Device Requirements
| Required | Optional |
|---|---|
| At least one smart light integrated | Exclude specific lights (e.g., a nightlight) |
| Correct time zone in Home Assistant settings | Condition to skip if someone is still awake (requires presence detection) |
Setup Steps
- Settings → Automations & Scenes → Create Automation
- Click Create new automation
- Under “When”, click Add Trigger → Time
- Enter your bedtime in 24-hour format (e.g.,
23:00:00for 11 PM) - Under “Then do”, click Add Action → Call service
- Search for Light: Turn off
- Do not choose a specific entity. Instead, click Choose entity, then at the top of the list, toggle All lights
- Rename to “Turn off all lights at 11 PM”
- Click Save
If this screen looks different: Older versions require you to manually add each light entity. The “All lights” toggle was added in a 2026 release.
Verification
Change the time to 2 minutes from now, save, and wait. Lights should turn off. Then change the time back to your actual bedtime. Do not use the “Run” button for time-based automations – it bypasses the trigger and won’t tell you if the time is configured incorrectly.
What breaks: If lights turn off at the wrong hour, your time zone is wrong. If some lights stay on, those entities may be unavailable or not tagged as lights – check Developer Tools → States and verify they show domain: light.
4. Flash Lights When the Doorbell Rings
This automation makes your lights flash when someone presses a smart doorbell, useful if you’re hard of hearing or wearing headphones. It requires a smart doorbell integrated into Home Assistant – Ring, Nest, Aqara, and Amcrest models work.
Device Requirements
| Required | Optional |
|---|---|
| Smart doorbell with Home Assistant integration | Specific lights to flash (otherwise all lights flash) |
| At least one smart light | Color change instead of flashing |
Setup Steps
- Settings → Automations & Scenes → Create Automation
- Click Create new automation
- Under “When”, click Add Trigger → State
- Choose your doorbell entity (often named
binary_sensor.doorbellorbutton.doorbell) - In “To”, type on
- Under “Then do”, click Add Action → Call service
- Search for Light: Turn on
- Choose the lights you want to flash
- Click Show options (bottom of the action card)
- Find Flash and select short from the dropdown
- Rename to “Flash lights on doorbell”
- Click Save
Verification
Press your doorbell. Lights should flash twice. If they don’t, check that your doorbell entity actually changes state in Developer Tools → States when pressed. Some doorbells expose a “last pressed” sensor instead of a state change, which requires an event trigger instead.
What breaks: If lights don’t flash, your doorbell may not expose a state entity. Check the integration documentation – Ring doorbells, for example, require you to enable “binary_sensor” entities in the integration settings. Some doorbells only fire events, not state changes.
5. Turn On Fan When Temperature Exceeds 24°C (YAML Example)
This automation monitors a temperature sensor and turns on a fan when it gets too warm. It includes YAML because it demonstrates numeric state triggers, which the visual editor handles awkwardly.
Device Requirements
| Required | Optional |
|---|---|
| Temperature sensor integrated into Home Assistant | Smart plug or fan with speed control |
| Smart plug controlling a fan, or a smart fan | Second automation to turn fan off when temperature drops |
Setup Steps
- Settings → Automations & Scenes → Create Automation
- Click Skip (bottom left) to start with an empty automation
- Click the three dots (top right) → Edit in YAML
- Delete the placeholder and paste this:
alias: "Turn on fan when hot"
trigger:
- platform: numeric_state
entity_id: sensor.bedroom_temperature # Replace with your temperature sensor
above: 24 # Temperature threshold - adjust to your preference
for:
minutes: 5 # Wait 5 minutes above threshold before triggering (prevents rapid on/off)
action:
- service: switch.turn_on # Use fan.turn_on if you have a smart fan entity
target:
entity_id: switch.bedroom_fan # Replace with your fan switch or fan entity
mode: single # Prevents the automation from running again while already on
- Replace
sensor.bedroom_temperaturewith your actual temperature sensor entity ID - Replace
switch.bedroom_fanwith your fan’s entity ID - Adjust the
above: 24value to your preferred temperature (this sensor reports in Celsius – use 75 if yours reports Fahrenheit) - Click Save
If this screen looks different: The YAML editor button moved to the three-dot menu in Home Assistant 2026.3. Earlier versions show it as a tab at the top.
Verification
The easiest test: temporarily change above: 24 to a value below your current temperature (e.g., above: 10), save, and wait 5 minutes. The fan should turn on. Then change the threshold back to your real value.
What breaks: If the fan never turns on, check that your temperature sensor reports a numeric value in Developer Tools → States. Some sensors report “24.5°C” as a string, not a number, which breaks numeric_state triggers. You’ll need to extract the numeric part with a template sensor first.
Four Mistakes That Stop Automations from Triggering
1. State vs Trigger Confusion
The problem: You set a state trigger with “From” and “To” both filled in, but the entity never goes through that exact transition.
The fix: For most automations, leave “From” blank. Only fill “From” if you specifically need to catch a transition from one state to another (e.g., from “locked” to “unlocked”). For “door opened” notifications, you only need “To: on”.
2. Time Zone Offset
The problem: Your time-based automation triggers at the wrong hour, or sunrise/sunset is off by several hours.
The fix: Go to Settings → System → General. Verify your time zone is correct. If you’re in New York, it should say “America/New_York”, not “GMT-5” or “Eastern”. The generic UTC offsets don’t handle daylight saving time.
3. Entity ID Typos
The problem: The automation saves without error, but never runs. When you click “Run” manually, nothing happens.
The fix: Go to Developer Tools → States and search for your entity. Copy the entity ID directly from there. Entity IDs are case-sensitive and must be exact: light.living_room is not the same as light.livingroom or light.Living_Room.
4. Automation Mode Conflicts
The problem: The automation triggers once, then stops working until you restart Home Assistant.
The fix: Edit the automation in YAML and check the mode: line at the bottom. If it says mode: single, the automation can’t trigger again while it’s still running. For automations with delays or waits, change it to mode: restart (cancels the previous run and starts over) or mode: queued (waits for the previous run to finish).
When You Need YAML: Four Triggers the Visual Editor Handles Poorly
The visual automation editor in Home Assistant 2026 handles most use cases. You should learn YAML when you need:
- Templates – dynamic values like “turn on the light to 50% brightness during the day, 10% at night”
- Complex conditions – “trigger only if it’s after sunset AND someone is home AND it’s a weekday”
- Choose actions – different actions depending on which sensor triggered the automation
- Repeat loops – flash a light five times, waiting 2 seconds between each flash
The visual editor can build these, but the YAML version is shorter and easier to copy between automations. For the five automations above, the visual editor is faster.
Next Steps: Presence Detection, Scenes, and Conditional Logic
Once you have these five working, common next steps include:
- Presence-based lighting – turn on lights only when someone is home (requires the Home Assistant Companion app with location tracking enabled)
- Conditional notifications – alert you about an open door only when you leave the house
- Scheduled scenes – trigger a scene (a saved set of device states) instead of individual device actions
- Media-triggered actions – dim lights when you start playing a movie
Frequently Asked Questions
What should my first Home Assistant automation be?
Start with a time-based automation that turns off all lights at bedtime. It requires no sensors, works with any smart light, and gives you immediate confirmation that automations work. Avoid motion-sensor automations first – they introduce variables like sensor placement and timeout settings that make troubleshooting harder when you’re still learning the basics.
How do I create my first automation in Home Assistant?
Go to Settings → Automations & Scenes, click Create Automation, then Create new automation. Add a trigger (the “when” – like sunset or a specific time), then add an action (the “do” – like turn on a light). Give it a descriptive name and click Save. Test it by clicking the three dots next to the automation and selecting Run.
What are simple Home Assistant automation ideas for beginners?
Turn on porch lights at sunset. Send a phone notification when a door opens. Turn off all lights at a specific time. Flash lights when the doorbell rings. Turn on a fan when temperature exceeds a threshold. These five require minimal hardware and teach you the three core trigger types: time, state change, and numeric threshold.
Do I need coding knowledge for Home Assistant automations?
No. The visual automation editor in Home Assistant 2026 builds automations by clicking dropdowns and selecting devices. You never see code. YAML knowledge becomes useful for advanced automations with templates or complex logic, but you can run a house full of automations without writing a single line of YAML. The editor generates it for you.
What’s the difference between Home Assistant scenes and automations?
A scene is a snapshot of device states – “living room lights at 60%, TV on, thermostat at 68°F”. An automation is a rule that triggers actions – “when motion is detected, turn on the lights”. Scenes capture what you want devices to do; automations decide when to do it. You can trigger a scene from an automation, making scenes reusable across multiple automations.
Photo by Jakub Zerdzicki on Pexels