
5 Useful Home Assistant Automations You Can Build in 30 Minutes
Getting started with Home Assistant can feel overwhelming. There are thousands of integrations, countless dashboards to build, and endless possibilities for automation.
But if you are just starting out, the best approach is to focus on small automations that solve real everyday problems.
In this first part of my beginner-friendly Home Assistant automation series, we will look at five practical automations focused on lighting and presence detection. These are easy to set up, require minimal hardware, and immediately make your smart home feel smarter.
These examples are ideal if you already have a few smart bulbs, switches, motion sensors, or device trackers connected to Home Assistant.
Understanding the Basic Components
Before creating automations, it helps to understand the three core building blocks:
Trigger
A trigger is what starts the automation.
Examples:
- Motion is detected
- A person arrives home
- A light turns on
- Time reaches 22:00
Condition
A condition is an optional rule that must be true for the automation to continue.
Examples:
- Only after sunset
- Only if nobody is home
- Only if indoor temperature is below 20 °C
- Only if electricity usage is above 2 kWh
Action
An action is what Home Assistant does when triggered.
Examples:
- Turn on a light
- Send a notification
- Lock a door
- Set thermostat temperature
With these three building blocks, you can create nearly any automation.
1. Turn On Hallway Lights When Motion Is Detected
This is often the first automation people create, and for good reason.
It solves a simple problem: no more fumbling for light switches when entering a dark hallway.
What You Need
- A motion sensor
- A smart light or switch
- Home Assistant
How It Works
Trigger: Motion detected
Condition: Only after sunset
Action: Turn on hallway light
YAML Example
alias: Hallway Motion Light
trigger:
- platform: state
entity_id: binary_sensor.hallway_motion
to: "on"
condition:
- condition: sun
after: sunset
action:
- service: light.turn_on
target:
entity_id: light.hallway
mode: single
This simple automation ensures the light only turns on when it is actually dark outside.
You can make it even smarter by adding an automatic shutoff after 2 minutes.
2. Automatically Turn Lights Off When Nobody Is Home
We have all left home and wondered if we forgot to turn something off.
Presence-based automations solve that problem.
What You Need
- Device tracking enabled
- Smart lights or switches
Home Assistant can track phones using:
- The Home Assistant Companion App
- Wi-Fi presence detection
- Bluetooth tracking
How It Works
Trigger: Everyone leaves home
Condition: None
Action: Turn off all lights
YAML Example
alias: Lights Off When Leaving
trigger:
- platform: state
entity_id: zone.home
to: "0"
action:
- service: light.turn_off
target:
entity_id: all
mode: single
This saves electricity and adds peace of mind.
If your home typically consumes 0.2–0.5 kWh overnight from forgotten lights and devices, this automation can noticeably reduce unnecessary energy use over time.
3. Welcome Home Lighting
A smart home should greet you when you arrive.
This automation turns on selected lights automatically when someone comes home after dark.
What You Need
- Presence tracking
- Smart lights
How It Works
Trigger: A person arrives home
Condition: After sunset
Action: Turn on entryway lights
YAML Example
alias: Welcome Home Lights
trigger:
- platform: state
entity_id: person.john
from: "not_home"
to: "home"
condition:
- condition: sun
after: sunset
action:
- service: light.turn_on
target:
entity_id:
- light.entryway
- light.living_room
mode: single
This is especially useful during winter months when it gets dark early.
If your outdoor temperature is below 5 °C, arriving to a warmly lit home feels even better.
You can later expand this automation to include:
- Adjusting heating to 21 °C
- Starting music
- Sending a welcome notification
4. Bedroom Lights as a Gentle Night Routine
Bright lights late at night can be unpleasant.
Instead of manually dimming lights, Home Assistant can automatically create a calmer atmosphere.
What You Need
- Dimmable smart bulbs
How It Works
Trigger: 21:30
Condition: Bedroom light is on
Action: Reduce brightness
YAML Example
alias: Evening Bedroom Dimming
trigger:
- platform: time
at: "21:30:00"
condition:
- condition: state
entity_id: light.bedroom
state: "on"
action:
- service: light.turn_on
target:
entity_id: light.bedroom
data:
brightness_pct: 30
mode: single
This creates a subtle evening routine without needing expensive circadian lighting systems.
It is a small automation, but one that quickly becomes part of daily life.
5. Get Notified If a Light Is Left On Too Long
Sometimes automation is not about doing something automatically.
Sometimes it is about simply letting you know.
This example sends a notification if a light has been left on for more than 1 hour.
What You Need
- Home Assistant mobile app notifications
How It Works
Trigger: Light has been on for 1 hour
Condition: None
Action: Send notification
YAML Example
alias: Living Room Light Reminder
trigger:
- platform: state
entity_id: light.living_room
to: "on"
for: "01:00:00"
action:
- service: notify.mobile_app_phone
data:
message: "The living room light has been on for more than 1 hour."
mode: single
This is a great beginner-friendly way to start using notifications.
If that light draws 12 W and is left on unnecessarily for several hours every day, it can add measurable kWh usage over a year.
Why Start with Lighting and Presence?
Lighting automations are perfect for beginners because they are:
- Easy to understand
- Easy to test
- Immediately useful
- Expandable later
They also teach the core automation concepts you will use everywhere else.
Once you understand motion sensors, presence detection, conditions, and actions, you can build more advanced automations for:
- Heating
- Energy optimization
- Security
- Notifications
- Appliance control
What Comes Next?
This article is the first in a three-part beginner series.
Next up:
Part 2: Time-Based Automations and Daily Routines
We will build automations based on:
- Fixed schedules
- Sunrise and sunset
- Temperature thresholds in °C
- Energy-aware routines using kWh consumption data
These automations help your home adapt automatically throughout the day.
Final Thoughts
The best Home Assistant automations are not necessarily the most advanced ones.
They are the ones that quietly make daily life easier.
Start small.
Build something useful.
Learn how triggers, conditions, and actions work.
Before long, you will be building automations that feel genuinely intelligent.
Some of the links in this article are "affiliate links", a link with a special tracking code. This means if you click on an affiliate link and purchase the item, we will receive an affiliate commission. The price of the item is the same whether it is an affiliate link or not. Regardless, we only recommend products or services we believe will add value to our readers. By using the affiliate links, you are helping support our Website, and we genuinely appreciate your support.