Debugging Entry Light Automation

I'm trying to automate the light at our front door to:
a) turn on around sunset at a low level
b) when a motion detector senses motion, raise lighting level
c) when motion is no longer detected, return to low lighting level
d) turn off around sunrise

However, my rule is broken, and the light isn't turning off at sunrise, and isn't adjusting the lighting level. I'm hoping someone can help walk me through debugging this.

How about something like this plus a second rule to handle turning the light on and off at the required times.

Then one for just the light.

1 Like

@croweflight has given you a rule that will work

I thought it might be helpful for you, to point out why your rule isn't working exactly as you intended.

Your rule has 3 triggers. Your Required Expression will only allow triggers that occur between 6:45 am and 7:45 am to execute the actions in your rule.

So your triggers...........
#1 Sunset-20 @4:23 pm will always be ignored.
#2 Sunrise+ 20 @ 7:35 am will always work
#3 Motion Sensor Changed will only work between 6:45 am and 7:45 am

So without trigger #1, your light will not come on at 4:23 pm

When trigger #2 occurs (7:35 am) , you will turn the light to either 75 or 25, depending on the current state of the motion detector, and then turn off the light. If the motion sensor reports motion or no-motion, during the next 10 minutes (up to 7:45 am) , the light will come on again at 75% or 25%, and stay on continuously for the rest of the day.

When trigger #3 occurs, your light should operate as desired, but only during the 6:45 to 7:45 time period

1 Like

Your required expression is only valid for 1 hour in the morning! Is that what you really want?

I'm pretty sure that the OP just made a typo in his Required Conditions. I believe he meant to enter Sunset-30 rather than Sunrise-30.

With that simple correction his rule would work pretty much the way he wanted (or I think he wanted).

The only remaining problem would be if after shutting the lights off at 7:35 am, another motion event occurred in the remaining 10 minutes in the Required Condition time window.

I think if he issued the "lights off" command, with an 11 minute delay (i.e. 7:46), that the lights would turn off and stay off for the remainder of the day, since the Required Conditions time window would not allow any more changes until the next evening.