I need to modify my rule with 2 motion sensors

Hi guys,

I'm using the motion and light app for my hallway light so at a certain time of day if the motion sensor in the hallway is active it will turn on the hallway and it works great.

Because my wife and my daughter keep running into each other wanting to use the bathroom and sometimes walking in on each other because they didn't hear the knock or the verbal "is anyone in there" To keep the peace in my house I created a rule. When someone is in the hallway bathroom and the bathroom door contact sensor is closed, to start flashing the hallway light "this way we know someone is in the bathroom so we don't need to knock on the door to check"

The problem I'm having now is when someone is using the bathroom that falls in the time frame of the hallway motion and light app to turn on the hallway light between a certain time the rule will stop and the light will just be on and not flashing but also the light will turn off after 2 minutes once the hallway motion is inactive and not trigger the rule to flash.

So now I'm trying to figure out how I can rewrite this rule so if the light is flashing but the motion sensor in the hallway is active from someone who walked by to not let the motion and lighting app take precedent and to keep flashing until the rule end once the bathroom door is open

image

Not that I can offer a rule modification, but the two rules are competing. The flashing rule will not activate because the first rule is operating. You would need to have the bathroom rule flip a virtual switch that would deactivate the first rule. Also, you need two trigger events. This needs to be something on the order of:

Hallway bathroom door closed
AND
Hallway bathroom Sensor active

Then for actions,
IF (Hallway bathroom Sensor active (T) [TRUE])
AND
IF (Hallway bathroom door closed(T) [TRUE]) THEN
Flash: Hallway AND
On: Bathroom Virtual Switch
ELSE
Off: Bathroom Virtual Switch
END-IF

Then you would need to use the option for using the virtual switch to disable your first rule while the Bathroom Virtual Switch is On.

Don't forget that you need to create a virtual switch in your devices. Name it appropriately as in my example above and use the Virtual Switch device type.

I'm not entirely sure if what I have written will fix your problem, but hopefully, it will get you thinking in ways that will help you fix it.