Hey everyone, I’m diving into the world of home automation and I’m absolutely loving the possibilities it brings! I’ve been using two PIR sensors in my living spaces to control the lights, and it’s been working like a charm. However, I’m looking to take it a step further by adding some time-based controls to make it even smarter.
Currently, I have these two PIR sensors set up to trigger the lights whenever there’s motion. It’s been a great setup, but I want to deactivate this automation during certain times of the day, specifically from sunset until 11 PM. I’m thinking this would help reduce unnecessary light usage during the late evening when I’m usually winding down for the night.
Here’s what I have so far in my configuration.yaml file:
yaml
-
alias: Turn on Bhaus Sala if there is movement
trigger:- platform: state
entity_id: binary_sensor.bhaus_sala_motion, binary_sensor.bhaus_kitchen_motion
to: ‘on’
action: - service: homeassistant.turn_on
data:
entity_id:
- switch.bhaus_sala - service: timer.start
data:
entity_id: timer.bhaussala
- platform: state
-
alias: Turn Off Bhaus Sala 5 minutes after
trigger:- platform: event
event_type: timer.finished
event_data:
entity_id: timer.bhaussala
action: - service: homeassistant.turn_off
data:
entity_id:
- switch.bhaus_sala
- platform: event
timer:
bhaussala:
duration: 00:05:00
I’m wondering if there’s a way to integrate a time-based condition into this setup. Maybe using the sun component or setting specific start and end times? I’m also curious if others have tackled similar projects and if there are best practices or tips to share.
Another thought I have is about using multiple motion sensors in a single room. I’ve heard some people use two sensors to ensure reliability, and I’m considering doing the same. It would be great to hear if anyone else has experience with this setup and how it’s worked out for them.
Automation is such a fascinating area, and I’m excited to see how I can refine my setup further. Any advice or insights would be greatly appreciated! Let’s keep the ideas flowing! ![]()