Question about Rule Machine setup on presence/door open


#1

Hi All,

I am 1 week into my migration from ST. Nearly all devices are moved over except some unsupported leak sensors and my Arlo integration (IFTTT for now). I have my basic Rule Machine rules configured ie door chimes, duplicates of my Goodbye and I'm Home! automation from ST.

My question is in regards to more advanced rule triggering and restrictions.

  1. How can I make a rule run only once per arrival? Meaning I have a presence sensor that when it arrives AND the front door sensor opens I want to play an Alexa Speaks message to welcome home. But I only want this to happen once per presence sensor arrival. I don't want the welcome message playing over and over.
    I have the basic rule below to do this but it runs over and over. How do I make it only once per "arrival sensor arrives AND front door opens"?

Any help is very much appreciated!

Craig


#2

I'm wondering why you're using a RM 4.0 Triggered rule? That isn't going to do what you want that way. I would use a 4.0 Rule. What you want to do is only trigger of the arrival, if that is what happens first. So, you would have something like this:

Trigger: Arrival

Actions:
Wait for front door open or timeout of x
Speak welcome home.

If you want to stick with RM 3.0 your triggered rule will have to include some Private Boolean logic.


#3

I use an RM4 rule. I have one big rule that handles everything that happens when the mode changes. As part of "Away," a virtual contact sensor -- Contact Virtual - Alexa Home -- is set to "open." When I arrive home, only if the virtual contact sensor is open, the rule waits for the entry way motion sensor to be active, and then closes the virtual contact sensor, which triggers Alexa to speak. Because the virtual sensor has to be open, and it's only set to open when I leave, it's only triggered when I get home.

Hopefully something in there helps.

ETA: The "else" stuff happens when I first get up in the morning. Because the sensor is closed, that means the mode has changed to home while I'm already there.


#4

@Ryan780

I was using a RM 3 rule because I cant get a 4.0 to not use OR. It only allows me to say arrival OR Front Door Sensor open. That mean every door open with the presence sensor TRUE will trigger the message right?

@jabecker I like the virtual contact idea. Something that can be "reset" when the presence sensor leaves but only with a mode change. Key part there seems to be you could leave home and come back with only one message.


#5

You don't have to make it that complicated. If you want it to trigger on your arrival, that is the trigger, the only trigger, you need. Everything else will go in your action. I showed you an example of something that would work perfectly.

You cannot have an AND trigger because two events cannot, by definition, occur at the exact same time. That's because the system can only process one event at a time. Even if only milliseconds apart, they are not at the same time to a computer. So, why bother trying to deal with virtual anything. You want it to trigger when you arrive home, do that. Then simply wait for the front door to open via a wait statement. Why make it overly complicated if you don't have to?


#6

@Ryan780

Good advice, thank you. How would I only allow triggering one time per arrival? Is that where the Private Boolean comes into play?


#7

You don't have to do that if you only trigger off arrival. Since you only arrive once, it only triggers once.


#8

What @Ryan780 said. If you use RM4 and trigger off of arrival, it should only trigger once because you only arrive once.

The reasons my example is set up the way it is are:
-- I trigger this rule base on mode change, and I need to know if the mode changed to "Home" because I just woke up, or because I was away and returned. All of my mode changes are built into this rule, not just "Home."
-- Alexa can "see" the virtual contact sensor, so my welcome home routine in Alexa is triggered by the contact sensor closing.

I'm kind of killing two birds with one virtual contact sensor stone, so to speak. But if you don't need any of that complexity, there's no need to use it.