Rules for Stairs Way

I need some helps with the rule below. If I added the section in RED, nothing works but if removed the section in RED, it works as expected.

My logic betrayed me lol

Thanks

You have conditions for "time is sunrise" and "time is sunset". Those are exact moments in time and will prevent the If or Else-If actions from ever running unless the motion sensor changes state at that exact moment, which likely will never happen.

Ah....I see.
I thought they are more as AFTER Sunset or Sunrise. I should change to between hours then.

Thanks

There appear to also be a few oddities with your rule. Is this the complete picture? If so, you're setting the rule's Private Boolean to True, but apparently just for fun because it's never used anywhere. :slight_smile: (It does not do anything on its own; it's just a variable you can set from this rule or another rule, and you can use it in a conditional to test its value where needed for whatever purpose you intend to use it for.)

Second, you have the lights turning off as a trigger, but I'm not sure what that's doing for you. It will do nothing unless one of your sensors is active and your time conditions (both of which I'm guessing you'll fix) are met, in which case it will turn them right back on; that would never happen from this rule, so I'm assuming you're trying to account for some other real-word behavior that's not apparent from just seeing this rule. (If you're just trying to create a motion lighting rule, you don't need that, and actually this whole thing could probably be done with two Motion Lighting child apps if you preferred--and certainly one if you used modes instead of time.)

Third, you're creating a delay of 30 seconds followed by an "off" command every time your rule executes and enters that code path, which (with corrected time conditions) would be more or less when the motion sensor is inactive--every time it becomes inactive (even within those 30 seconds--yes, it will keep scheduling more) and even if motion becomes active again (if you're used to webCoRE, Rule Machine does not read your mind and try to cancel things you created; you have to do it yourself). This means your lights are likely to keep turning off unexpectedly. This can be fixed with a "Cancel Delayed Actions" action in your IF and ELSE-IF (or anywhere that would catch all cases when the sensor is active) and setting the "cancelable" flag on your "Delay" action in your ELSE. The Rule 4.0 docs contain an basic example of this if you care to see more (see the screenshot labeled "Rule 4.0 Cancel delay on change"); the idea is the same, though your rule is more complicated. (Does Motion Lighting sound more appealing yet? :slight_smile: )