Setting Up a Smart Lighting Automation for Energy Efficiency

Hi everyone! I’m excited to share my recent project where I set up a smart lighting automation to save energy. I’ve been wanting to optimize my home’s lighting system to reduce energy consumption without compromising comfort. Here’s how I tackled it!

First, I identified the key areas where lights are often left on unnecessarily—like the living room and hallway. I decided to use motion sensors and schedule-based automations to manage these lights effectively.

I started by integrating my Philips Hue bulbs with Home Assistant. It was a breeze thanks to the built-in integrations. Next, I set up motion sensors in both areas. The goal was to have the lights turn on when motion is detected and dim after a few minutes of inactivity.

Here’s the automation I created:
yaml
automation:
alias: Living Room Smart Lighting
trigger:
platform: state
entity_id: binary_sensor.living_room_motion
to: ‘on’
action:
service: light.turn_on
data:
entity_id: light.living_room_lights
brightness: 255
condition:
platform: time
after: ‘08:00:00’
before: ‘22:00:00’

alias: Living Room Dim After Inactivity
trigger:
platform: state
entity_id: binary_sensor.living_room_motion
to: ‘off’
action:
service: light.turn_on
data:
entity_id: light.living_room_lights
brightness: 50
condition:
condition: and
conditions:
- condition: state
entity_id: light.living_room_lights
state: ‘on’
- condition: time
after: ‘08:00:00’
before: ‘22:00:00’