Door opened followed by another door open

I'm trying to make a rule that if the garage door is opened, followed within 5 minutes that the hall door is opened, the hall lights turn on and stay on for at least 5 minutes. After the 5 minutes, if there is motion in the hallway the hall lights stay on for another 5 minutes.

I'm new to HE and Rule Maker, and would really appreciate help! Thank you.

Seems a little unnecessarily complicated since hall motion would turn the hall light on anyway after you step into the hallway from the garage... BUT...

It is a virtual switch + two rules...

Create virtual switch to represent the "garage door open within last 5 minutes" condition, call it something like vGarageDoor5Min

Rule 1 -
conditions: garage door open
rule: garage door open
true action: virtual switch = on
false action: virtual switch = off after 5 minute delay (cancel on truth change)

Rule 2 -
conditions: virtual switch = on, hall door open, hall motion = active
rule: (virtual switch = on and hall door open) OR (hall motion active)
true action: turn on light
false action: turn off light after 5 minute delay (cancel on truth change)

My hall motion sensor is a little slow to capture motion at the end of the hall near the door, so thatā€™s why I want to use the two doors to turn on the lights.

Thank you very much for your help with the rule. You saved me a lot of time!

1 Like

Why don't you just turn on the Hall lights if the door is opened and the lights are off? It seems unnecessary to check that the garage door opened.

But this would be easier to accomplish with a wait.

Trigger: Garage Door Opened.
Action:
Stop actions for this rule (delay 5 mins)
Wait for Hallway door open
Turn on Hallway lights.

The motion sensor rule should take care of turning the light off. The stop action with delay closes out the wait if it never occurs within the 5 minutes.

I'm wanting the lights to come on automatically only if I am coming from outside the garage and then through the hall door.

Thank you very much for your rule. I'm going to give it a try.

My point is though, why does the garage door have to be opened first? If you did the following:
Trigger: hall door open
Condition/rule: light off
True action: turn on light

Wouldn't that accomplish the same thing? If you have a motion sensor, the light will be on if the door is opened from the inside. So, rule wouldn't fire.

I was looking for a solution to a problem I have and I found this thread that is pretty similar. I have a motion sensor upstairs and another motion sensor downstairs. What I want is that when I am going from downstairs to upstairs then my upstairs lights to turn on and when going from upstairs to downstairs then my downstairs lights to turn on. I cannot just use alone the upstairs sensor because then when I am walking upstairs my lights would always turn on and I do not want that, I only want them to turn on when I am going from downstairs to upstairs and same logic when going from upstairs to downstairs.

I am currently a Smartthings and Webcore user migrating to HE and MR. in WebCore I use the operator "followed by" is there something that easy in RM instead of doing virtual switches and multiple rules?

First, virtual switches and multiple rules ARE easy.

But to answer your actual question, as @Ryan780 mentioned above, you could probably use the "Wait for" action in a rule.

What confuses me about this is isn't the downstairs light already on before you walk UP the stairs since you are already at the bottom? Maybe I'm just assuming being in that area would trigger a light prior to walking up the stairs...and of course don't know the whole layout...

When I am downstairs I can have probably only 1 o 2 lights on. When coming from upstairs to downstairs I want all my 6 lights downstairs to turn on

1 Like

Yes I noticed that but I want to avoid creating too much devices

1 Like

You can see how using virtual switches will soon have you up to your eyeballs in them. And what happens if they ever get out of sync? I try to avoid adding new devices if I can. I would even use a Boolean Global Variable in RM before I would use a virtual device.

A Virtual Device is basically a global boolean variable, right? I mean, don't they have the same characteristics? Is the only difference that you create a global variable in Rule Maker and you create a virtue device on the devices page? So then if you want your device list to be smaller, you would use global variables?

Global variables are only accessible inside RM and devices are accessible everywhere. I would think that a device would be more resource hogging than a variable would. But I may be wrong about that. Just seems logical to me.

I have a question on how DELAY works in Rule Maker.
Hereā€™s my rule:

My question is if the garage door opens a second time within 5 minutes, and therefore this trigger runs a second time, would vGarageDoor turn off in LESS than 5 minutes?

FOR EXAMPLE,

  1. Garage Door Opens at 1:00 pm. Trigger fires and vGarageDoor5 is set to on.
  2. According to this Trigger, after 5 minutes, at 1:05pm (in this example), vGarageDoor5 would be set to Off.
    BUT
  3. Garage Door Opens again, this time at 1:04 pm, and the trigger fires again.

Will vGarageDoor5 turn off at 1:05 pm based on the first time the trigger fires, after the 5 minute DELAY, or when the trigger fires again at 1:04, will that ā€œoverwriteā€ the DELAY, so that now vGarageDoor5 will be set to off at 1:09 pm?

If the trigger runs twice, since you don't have any cancellation of the previous schedule. So, in this case, the light would turn off at 1:05 still. What you need as the very first action in the rule is "Stop actions for this rule". That will unschedule the pending delayed actions.