Smart Lighting Automation: Motion Detection Between Sunset and Sunrise

Hey everyone, I’ve been working on setting up an automation for my outdoor lights to come on when motion is detected between sunset and sunrise. The goal is to have the lights activate for a few minutes when someone walks by, but I’ve run into a bit of a snag.

Initially, I set up the automation with the time condition set to trigger only between sunset and sunrise. However, I noticed that the lights were turning on automatically at sunset, even without any motion detected. It was a bit frustrating because I wanted the motion sensor to be the primary trigger. After some trial and error, I realized that the order of conditions in the automation mattered a lot. By adjusting the logic to prioritize the motion sensor over the time condition, I was able to get the desired behavior.

Here’s what I did: I created an automation that first checks if motion is detected and then verifies if the current time falls between sunset and sunrise. If both conditions are met, the lights turn on for a set duration. This approach ensures that the lights only activate when motion is detected during the specified time frame.

I’d love to hear how others have tackled similar scenarios. Do you have any tips or alternative methods for ensuring that motion sensors work seamlessly with time-based automations? Let’s share our experiences and help each other out! :star2: