Ignore Motion events for N number of minutes after door closes?

I'm almost to the point of just writing a Groovy App to do this, but it seems like something that should have an obvious solution via Rule Machine.

I have a driveway sensor that I have automations in HE to turn on lights when someone enters the driveway. My challenge is I don't want to trigger those when I leave the house... Only when I (or someone else) arrives. The driveway sensor cannot discern the difference between an arrival vs departure. It only sees motion.

The most obvious way I can think of to solve this problem is to program it so that when the garage door closes (I have a sensor on it) that the "Rules" to trigger the lights from the driveway sensor are ignored for a minute or two after the garage door is closed. Seems simple enough... but I cannot figure out how to solve this in Rule Machine. I know I could have just written an App by now but I'm trying to learn the ins and outs of Rule Machine. :slight_smile: Plus I have a number of other desired automations that would follow this same pattern: IE: Don't turn on the garage lights when the garage door is opened if they were turned off in the past 30 seconds, or don't do XYZ if the Alarm Keypad was recently armed, etc.

-Jeremy

Enable private Boolean restriction on your motion rule. Then use another rule to set PB false for the motion rule when certain conditions are met, and set it back to true after a delay.

This is the part that I can't figure out how to do...

After you pick the other rules to set Booleans for, an option will open up to add a delay

Lots of people here recommend using virtual switches...and honestly I see why now. Until you really get rule machine that help make things easier to see/understand.

You could create a virtual switch for "not home" or something. And set it true with ALL your presence sensors be "not present" as the condition. Then a delay these actions by on the rule of x minutes with cancel on truth change. Then use this to turn on/off that switch.

Then you have a switch to use in your driveway automations. If the "Not present" switch is on...you have not been home and can trigger the driveway. I have the delay on arriving because I don't know what presence sensors you use and how far away they "sense" someone home. IF your presence sensor picks up someone arriving PRIOR to hitting the driveway this could be automated a bit better by each person arriving and running the driveway lights for each person regardless of who else is home/etc.

I found it easier to use an "Action" since you can delay for a number of seconds rather than just a whole number of minutes like you can in set boolean true. This is the action:
14-02-12-57
Then wherever I am setting the PB to false, I also select "Run Rule Action" and select this rule. That way, I'm not forced to wait a whole minute when I really only need a few seconds.

Very helpful responses. Thanks everyone.

So far every response I've gotten seems to have 1 thing in common: Every "Rule" that needs to be temporarily disabled for a few seconds or minutes requires setting up basically three rules in Rule MAchine:

1.) The rule to actually do the thing.
2.) The rule to temporarily disable the thing.
3.) The rule/action to re-enable the thing.

Do I have that right? Are there any simpler methods for accomplishing what seems like a fairly common use case? My list of "Rules" under Rule Machine is already becoming slightly unwieldy. :slight_smile: This is going to make it much worse.

Perhaps an improvement could be suggested for Rule Machine (And Simple Lighting to be honest): Add a "restriction" based on any recent events. IE: Recent door open/close, recent motion, etc. That would greatly simplify a lot of rules.

-Jeremy

No, you can do it all in one, depending on your use case. Three would be the most you would need. For example, I have the rule that does the thing and disables the thing together then an action to re-enable it which is trigger by the first rule to do the thing.
I found that it's important to come up with a naming schema to keep everything straight. All of my rules start with the room (or function, like HSM) then the function the rule performs. For now, that is keeping everything straight for me. But would definitely help if you have something planned out ahead of time rather than having to go back and edit every rule later (like i did).

Can you show me an example?

If I want Rule A to not run if some other event happened in the past X number of minutes/seconds... I don't see a way to do that with less than 3 rules?

Sure, i just threw this together. This would turn light on when motion active, off when inactive with a delay of 5 mins which cancels if it goes active again. And when it turns it off it disables the rule for one min. Now, i don't think this is the best way to do it but it is possible.

14-15-26-09

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.