Hi everyone,
I wanted to share my recent success in setting up a garage lighting automation using OpenHAB. After some research and experimentation, I managed to create a system that turns on the garage lights based on multiple criteria: presence detection, garage door status, and time of day. This setup has been working flawlessly for the past few weeks, and I thought it would be helpful to walk through my process in case anyone else is looking to achieve something similar.
First, I identified the necessary components:
- A presence detector to sense when someone is near the garage.
- A garage door sensor to monitor the door’s open/close status.
- A smart light bulb or switch for the garage lights.
Next, I configured OpenHAB to handle the automation logic. I used the Rule Engine to create a rule that triggers when any of the conditions are met:
- Presence Detected: The presence sensor detects motion near the garage.
- Garage Door Opens: The door sensor indicates that the garage door is open.
- Time-Based Activation: The lights turn on automatically after sunset or at a specific time (e.g., 7 PM).
To ensure the lights don’t stay on indefinitely, I added a timer that turns them off after a set period. This prevents wasted energy while still providing ample lighting for those brief moments when the garage is accessed.
One challenge I encountered was ensuring that the rule didn’t trigger false positives. For instance, if someone walks past the garage without actually needing the lights, I wanted to avoid unnecessary activation. By combining presence detection with the garage door status, I minimized these false triggers.
Here’s a snippet of the rule I created for reference:
java
rule “Garage Lights Automation”
when
Item Garage_Presence changed to ON or
Item Garage_Door_State changed to OPEN or
Time cron “0 0 * * *” // Sunset or specific time
then
if (Garage_Presence.state == ON || Garage_Door_State.state == OPEN) {
Garage_Lights.sendCommand(ON)
createTimer(now.plusMinutes(30), [| Garage_Lights.sendCommand(OFF) ])
}
end
This rule ensures that the lights turn on when any of the conditions are met and turn off automatically after 30 minutes. I also set up a cron job to activate the lights at sunset, which adds an extra layer of convenience.
I’m really happy with how this setup has improved my daily routine. It’s one less thing to worry about, and it’s been a great way to reduce energy waste. If anyone has questions or suggestions for improvement, I’d love to hear them!
Cheers,
[Your Name]