Trigger based on other triggers happening within a set time from each other?

Hello,

I currently have 2 presence devices (one based on gps geofencing using the mobile app, and the other based on being connected to the home wifi).

I'd like to have a trigger go off only when both the presence devices switch from not present to present within a couple of minutes of each other (in either order).

I'm guessing this would be possible in RM, but I'm not clear on how do it. Can anyone give me some pointers?

Thanks id advance.

See if this might work.

Trigger: Either presence1 or presence2 change

Action:
Wait 2 minutes
If presence1 and presence2 are present
Do whatever
Endif
If presence1 and presence2 not present
Do something
Endif

Why would you wait 2 minutes? The rule will trigger again when the other changes. That will just cause a delay.

What are you trying to accomplish? There are a couple combined presence apps where you can take two sensors and combine them into one output. You could then take that and do something with the combined signal.

Agreed. But now I think of it, what I suggested won't work either. He wants to know if they both triggered in a particular time frame. Or at least that is what I understand.

Yes, but that isn't necessary. If both changed to away not in a particular amount of time, you don't want the actions that would take place to take place anyway? That doesn't make any sense? Personally, I only use presence to arrive home, so I would think he would want to trigger on either happening for arrival. And for departing, I want to make sure that everything arms as soon as I leave, not a few minutes later.

My goal is to determine when I arrive home. I don't care about departures.

The reason I want both of them to trigger in a certain time frame is I want to avoid false positives.
The problem with relying on one, is neither are entirely reliable and sometimes switch to away and then back to home, even when I never left the house. I want to ensure the trigger doesn't fire while I'm already at home. I figure if they both switch to arriving in a short time frame, then it's extremely likely that I really am arriving at that moment.

That can be solved by only allowing your returning home routine to run when your house is in Away mode. That's how I solved this problem. You shouldn't mysteriously return back home when you actually aren't so, that really isn't a potential problem.

Just be careful, if you ever implement a VPN to connect to your home network while away from home, the connect to network Presence sensor, depending on the method you are using, might think that you're home.

I think you might want the app that combines multiple presence sensors. However, my notification rules work similar to what you described above.

The problem with using Away mode, is there are multiple people in the house, and I want to do something like what I'm describing for each one of us.

Okay. I still don't understand why you can't use away mode. If you are not home but the other person is, do you really want everything to run that would have run if the other person wasn't at home? And you wouldn't want the house in away mode if you both aren't home?

I had a look at the combined presence app, but I didn't think it had any timing information. Maybe I misunderstood, but what it look like is that as long as both presence devices said home, it would treat it as home. I didn't want that because if I already was home and one present device briefly toggled to away and then back to home, it would look like I was just arriving.

Thanks for positing your selection presence example. I'll see if I can understand how it works.

Why do you need timing information? If one sensor arrives home 5 minutes after the other, then you haven't actually arrived home? Yes you have. There is not need for a timeout. What you want is a method to override presence doing the same things it would have done when you've already done them through another method which can be accomplished using many different methods. But stop tying your hand with this timeout business.

Here's an example. You are away from home and one sensor arrives 2:10 seconds after the other, you want it to show you as still away? Or are you saying you only want it show you as away if both only go to away within a timeout? So, if one leaves 2:10 after the other, it will still show you as home. You see the problem?

Perhaps I'm not explaining myself properly. All I want is a dependable arrival trigger.

Say I'm sitting at home and only one of my presence devices switches to off, and then back on again. In that case, I don't want it to trigger.

I want 'redundancy' so that it would only trigger if both presence devices switch to arrived within a certain amount of time from each other.

Then what you want is the same as above with one small modification: Also, i would use a virtual presence sensor controlled through custom actions in Rule Machine. That way you get all the benefits of the presence capability in HE.

Trigger:  Either presence sensor CHANGING

Action:
If both sensors are away: 
     set virtual sensor to away
else
     set presence sensor to home
end-if 

That's it. This will only change you to away if both sensors are away at the same time. But either being home, will make you arrive home.

2 Likes

I think this could work! Thank you for the suggestion.

1 Like

I have combined presence set that if EITHER WiFi or Geolocation arrives, then I am home. On the other hand BOTH have to be gone for me to be not present.

It works fine as long as you have a phone that doesn't shut off both signals, or as long as your phone isn't off or something.

You can also set a time-out so your phone toggling or a blip somewhere doesn't trigger presence change.

Edit: this is the particular app I am using. There are other similar ones out there also. [RELEASE] Combined Presence

1 Like

Thanks for the info. For the presence sensor based on the app geofence, I wonder what the behavior would be inf the phone is turned off. Would it set it to away, or simply leave it at it's last known position?

Mine appears to think you are away if you lose geofence for any reason.

That is one reason I hate phone only for presence, if you shut it off, or it goes into power save mode, you typically lose both GPS and WiFi. My Android phone is pretty agressive in shutting both of these off once the screen turns off, so I appear like I am never home. If I plug the phone in, it is fine, but who wants to do that? The app itself works flawless otherwise.

I am going to add a third device, probably a Smartthings Fob, in addition to the GPS and WiFi and hopefully get a better handle on presence. Silly that you have to have 3 things to positively determine if you are home or away, but with current technology, that seems to be the case.

If the phone is off, it can't send a message that it has left the area. So, it would show you as still home. It can only update when the phone tells it to. The processing of your location is done on the phone. It just signal whether it's inside or outside the designated geofence. It doesn't relay your location to the cloud.