Simple lighting with motion and illuminance inconsistent turning off

I have been having some issues with inconsistent behavior with the Simple Lighting App when I use motion and have an illuminance setting. Basic functionality always worked, that is motion detected lights go on then after a minute lights go off. Where my problems come in is when you re-trigger the motion before the delay ends. When this happens my lights do not turn off. I have this happen all the time and I think I figured out why. I created this simple rule machine to recreate my issue:


The logs in question look like this:
app:3232019-12-14 12:08:33.890 pm infoAction: END-IF

app:3232019-12-14 12:08:33.887 pm infoAction: Off: Basement Entry, Basement Hallway --> delayed: 0:02:00 (cancelable) (skipped)

app:3232019-12-14 12:08:33.877 pm infoAction: On: Basement Entry, Basement Hallway (skipped)

app:3232019-12-14 12:08:33.869 pm infoAction: IF (Basement Hall Motion Sensor active(T) AND Illuminance of Basement Hall Motion Sensor(81) is < 10(F) [FALSE]) THEN (skipping)

app:3232019-12-14 12:08:33.776 pm infoAction: Cancel Delayed Actions

app:3232019-12-14 12:08:33.748 pm infoBasement Hallway Motion Triggered

app:3232019-12-14 12:08:33.735 pm infoBasement Hallway Motion: Basement Hall Motion Sensor motion active

So what is happening is the light is on from the initial motion this causes the cancel delay and stops the countdown. Then because the illuminance is greater than the value set it does not re-execute turning on and delay turn off and thus my lights stay stuck on. This rule machine behavior is the same as the Simple Lighting App behavior.

What I really want to do in Simple lighting is to only use the illuminance value when the light is off initially not when you want to reset the delay since motion is detected.

I think you could do what you want with two Simple Lighting rules, an "on" rule with all your desired restrictions, and an "off" rule with fewer restrictions (including no lux restriction). Simple Lighting restrictions are fairly naive--they stop the whole rule from running, not just the on (or off) actions.

You could use Rule Machine to get the desired behavior with one rule, but the way you've written it is a bit odd. There is a basic motion lighting example in the docs, which I'd recommend reading. You'd need a "changed" (not "active ") trigger and an IF/ELSE (conditional) to do different things depending on motion, as documented there. The only addition you'd need is turning the "on" action into a simple conditional instead (for example, "IF (Iluminance < 10) On: Light" instead of just "On: Light"). There are several variations you could do depending on what you want.

Thanks, I see the error in my thinking. I had Active because I thought that is the only trigger that I cared about since I handed the off with a delay. But the problem with that approach is that if I stay active for 2 minutes then the lights will go off until another active trigger occurs. That is not what I wanted. So I fixed the rule like follows:

Thanks for the work-around for the simple lighting. The on behavior with Turn off when motion stops is still a bug. My lights stayed on even with no motion.