Delay actions until I'm away for x number of minutes

Hi all - I've been searching but cannot find an answer to this, and I know just about anything is possible with Rule Machine. I'm trying to stop a certain action (a message to my phone about certain trigger events) from happening unless any of the trigger events are true after I've been in AWAY mode for at least 5 (or x number of) minutes. I use mode manager based on presence to determine when we are all not present, which successfully puts the hub in AWAY mode. I cannot figure out how to delay the action. Any pointers? Thanks!

My current rule in RM:

A couple of ideas. Do your Flume reports triggers have the option for "And stays?". If so, you could set that to 5 minutes. Or you could remove your Required Expression and do something like this:

Trigger Events
Mode is *changed*

Actions to Run
IF (Mode is NOT Away) Exit Rule
Wait for event: --> elapsed time: 0:05:00
Wait for event: Flume reports usageLast... OR Flume reports flowStatus... OR Flume reports flowDuration...
Notify: JFMiPhone...

Note that I'm suggesting mode change and not away to end the Wait for events when you return otherwise you could get a notification when you're home. Also note that the IF is a simple condition and THEN and END-IF aren't used.

1 Like

If your intent is something like “notify water flow any time while away except in the first X minutes of being away” you might consider splitting this into two rules: one that sets a virtual switch or hub variable X minutes after being away and the other that uses this switch/variable as a required expression.

1 Like

This would also have the limitation of only firing one time and the notification would always be delayed. Think this is one case where the two rule method would be best.

I think @hubitrep is right. One rule that says

Trigger:
Mode is AWAY

Action:
Wait 5 min
Turn on virtual switch
Wait for event: Mode is #not away modes#
Turn off virtual switch

Then this rule becomes

Required Expression:
Virtual switch is on

With the rest staying the same.

4 Likes

If the "Any stays?" option is available in the trigger then it would all be in one rule but yes, delayed 5 minutes each time it's triggered.

3 Likes

This is exactly what I'm after. I want a notification of any of the trigger events at any time once I'm away, except within the first x number of minutes. For example, if I flush the toilet right before I leave, I have seen this alert shortly after I've left. I'm trying to let the tank finish filling after I've left, then being fully vigilant (and alerted) for any water flow after x number of minutes of being away. Thanks for the great ideas!

1 Like

I do have those options on the triggers, but agreed, looking to avoid the 5 min delay each time. I still appreciate all the feedback and thoughts!

That would work, for sure.

I prefer splitting rules in cases like this, in part because I like separating concerns, which means you can then use multiple ways to activate this "flow watchdog" rule without changing it, or you can use the virtual switch itself to silence it (if the triggers are such that one would get repeat notifications in the event of continuous flow).

Given the last point, from experience, I would also split out the notification part by triggering a virtual "Water is flowing" switch that reflects the detected flow state, and using the Notifications app to manage repeat notifications, etc. to avoid getting spammed (can be quite stressful!). Doing it this way also allows having a dashboard tile that shows the flow state irrespective of notifications being silenced, etc.

2 Likes

Excellent points! I have done similar for other notifications, as you're right, it adds to the stress of what can already be a very stressful situation. I ultimately intend to tie in a smart valve actuator to allow water to be shut off automagically. Of course this will all take some careful tweaking, as I will have to allow for things like the ice maker or dishwasher running while we are away. If you ever want to find out how many variations of things happen in the real world, try automating around them! LOL

2 Likes

I realized there is an underlying risk in the single rule approach that I provided. I can no longer recommend that approach and have deleted the post containing the example. @user4420 if you are using that single rule approach please delete it. I do agree that this case is better addressed with a two rule approach.

2 Likes

Thank you for your thoroughness - I did go with the two rule approach and it is working how I hoped.

3 Likes