Automating Outdoor Lighting with Shelly 1: A Success Story

Hey everyone, I wanted to share my experience with automating my outdoor lighting using a Shelly 1. It’s been a fun project, and I’ve learned a lot along the way!

I recently installed a Reolink Outdoor E1 camera to monitor my driveway. The camera’s people detection feature is pretty reliable, so I thought it’d be great to link it with my outdoor lights. I have six GU10 spotlights controlled by a Shelly 1, and I wanted the lights to turn on whenever someone is detected and stay on for exactly two minutes.

I set up a Blockly script to handle the automation. The idea was straightforward: when the camera detects someone (People_detect = True), the Shelly 1 should switch on the lights for two minutes. But here’s where things got interesting. Initially, the lights would only stay on for a random short duration, sometimes even turning off before the two minutes were up. It was frustrating because the script seemed correct, and the Shelly 1 worked fine when controlled manually.

After some troubleshooting, I decided to test the Shelly 1 without the Blockly script. To my surprise, the lights stayed on consistently when I triggered them manually. This made me realize the issue wasn’t with the Shelly 1 itself but somewhere in the script or the system running it.

I reached out to the community for help, and someone suggested checking the Blockly script for any hidden issues. Upon reviewing the script, I noticed that the timing logic might not be handling the state transitions correctly. After adjusting the script to ensure the timer reset properly and the state transitions were smooth, everything started working as intended!

Now, whenever someone walks by, the lights come on and stay on for the full two minutes. It’s a small victory, but it makes a big difference in terms of security and convenience. I’m really happy with how it turned out and grateful to the community for their support.

If anyone else is working on similar projects or facing unexpected issues, don’t hesitate to ask. We’re all here to help each other out!

Cheers,
Crazy