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.
Goal
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.
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.
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.
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.
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.
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.