Been loving rule maker but got one I can't work out the logic for. My wife commutes from the country full of deer in the very wee hours of the morning and I always worry she didn't make it in and she is stuck in a dead spot with no cell service. I have a couple conbined presence sensors set up for her, one for when she arrives/departs home and another for when she arrives/departs work. These work pretty reliably so just need help with the actual logic around once the depart triggers, waiting for another device to update.
- detect her leaving home
- wait for up to 40 minutes, or until it is detected she has arrived at work.
- if she arrives in under the time, send a notification she made it safely and stop waiting
- if she didn't arrive and the timer is up, send a different notification.
First, welcome to the Hubitat community!
What you want to do is pretty straightforward with RM. What I would suggest is a rule that is triggered when the presence detector indicates she's departed, then a "wait until event" with work arrival as the event and a 40 min timeout. At the end of the wait you just need to check and see if she is at work or if the wait timed out (she isn't at work), and send the appropriate notification. Make sense?
Thanks for the amazingly quick response, that makes perfect sense. I think the only concept I was hoping existed was if she arrived in 20 minutes to have it see that and not wait the full 40 to send a message.
my apologies, it looks like wait for event does exactly what I asked. thanks again.
Yeah the wait will end if either the presence detector sends an "arrived" event OR the timeout expires. Which is why you then have to test to see which condition is true.
What did you decide to use for presence sensors?
Two other things to consider would be:
If she arrives back at home cancel the wait and send no notification.
How will you tell that she is actually meant to be going to work? Would it be based on the day of the week and / or the time she leaves?
I was just looking into how to cancel actually. As for how I decide when to trigger the event, it is indeed, day and time window driven, so only m-f, and only if the depart happens between 5-7am.
You could use an expression, i.e. it will only look for the trigger during those times. Not sure how best to set it up.
@user49 could do it with "required expression" - wish I hadn't deleted the rule already!
Brilliant sir! I did the days and times a little differently, but I like your approach better for readability and order. Won't let me attach a picture yet (too new I assume) but I'll post final shots when I have it working well.
Lots of ways to skin that deer...
What about vacations? Just assume she'll sleep in?
Hopefully she won't be leaving home at those times on her day off....
You could always use a Google. Calendar and the search driver to flick a switch and include that in the required expression
The Multi-Place app might work well for doing this with just a few clicks.
Multi-Place looks amazing. I will most certainly test that out.
I didn’t see the app Life360 for Android or iOS mentioned. I can see where
my wife is, and also can see her moving.
Then the Life360 connector HE app interfaces with that if you want.
Actually, now that I think about it, your use case (notify if not arrived) is a little different than what I wrote Multi-Place for originally (notify if going to be late). But it would be super simple to modify for your purposes. If you end up wanting to use it, let me know as I wouldn't mind tweaking it for this.
Ok, I just went ahead and added that feature to Multi-Place for when you try it. I haven't really tested it yet, so will look to you for that!