Help with rule engine

Hi @josh @James just need a little guidance with a rule i’m creating. I’m trying to make this 1 rule rather than making multiple rules.

Here’s what i’m trying to do
(a) When it’s between sunset and sunrise & garage door or mudroom door opens = turn on garage lights wait 3 minutes then turn off (if no motion) BUT if the garage motion sensor detects motion in the garage I want the lights to stay on.

Here you go. :wink:
Make sure you change the IF_Condition’s logic to “OR” for the “after sunset or before sunrise” (between sunset and sunrise) conditions.

Wow, just wow. Thank you. I’ll test out later & report back. Thanks again

1 Like

@James I think your nested Garage Motion IF_Condition would need to be a ‘state stays’ condition as I would imagine he wants no motion within the last 3 minutes rather than no motion exactly at 3 minutes later.


Also, depending on the desired logic, it might be easier to break this into multiple rules. For example, this rule would only avoid turning off the light again if motion is detected within the 3 minute period immediately after the garage door or mudroom door was opened (and it’s between sunrise and sunset). At the point, the lights wouldn’t ever turn themselves back off.

Some people also like to add a separate rule that will turn the lights off after no motion is detected for X minutes (eg. Trigger: Motion stayed inactive for 5 minutes, Flow: Turn garage lights off).

1 Like

Hi @josh i tried the two rule approach but certain instances would either leave the lights on or turn the lights off when someone was in the garage. Here’s what I had before:

Rule 1. Between sunrise & sunset, if Garage/Mudroom door is opened turn lights on wait 3 minutes turn off
Rule 2. Between sunrise & sunset, If there is motion in the garage, turn garage lights on.

Where this would fail is, if I was in the garage working and someone opened the door to check on me; then Rule 1 would run and turn off the lights then I would have to wave my hand in front of the motion sensor to turn the lights back on. (Another pain point is, the motion sensor I have reports motion every 3 minutes to smartThings). So if the above scenario happens at the perfect time; I have to wait 3 minutes before it detects motion and turn the lights back on.

Hopefully the updated rule, will make things easier. I’ll test later and report back.

Thanks for the details. Is there always motion detected in the garage when the garage/mudroom doors are opened?

What type of motion sensor is it? Some of them have configurable cool down periods.

No. Motion sensor is pointed in the direction of the cars, the door is on the side. So if the person doesn’t go into the garage then it will not detect motion

I’m using the Bosch Motion Detector in the garage.