Notify me when something left open

Hi. I am pretty new here - migrating over from ST. I am trying to have a contact sensor, when left open, notify me after 2 minutes and the keep notifying until closed (maybe every 20 seconds). ST had a smart app under "Energy Management" category called: "Something Left Open" by jim@concipio-solutions.com.


Would love to create some thing like the attached screenshot. However I am not sure if was able to keep notifying/reminding me until closed. Thank you.

Rule machine

2 Likes

There's a native notifier app that you can install that will do what you want. Not sure you can get it to notify every 20 seconds, but it's worth a shot. I have it notify me every 60 minutes after a certain door is open more than 30 minutes.

Thanks all. I appreciate all the responses. I followed napalmcsr post but am having some issues. Regardless if the sensor being open or closed, the rule continuously fires off notifications. I had set up 20 seconds for testing (for repeat messages). I appreciate the responses and input. Thanks! Please see my attachment.

Change the trigger to changed, I forgot to show that.

1 Like

Thanks so much. That was it! I appreciate the quick response. I'm up and runnin.

1 Like

Is this the notification app that built into HE or are you referring to another app?

Yes.

@napalmcsr using your logic below, when the Front Door closes, a second instance of this rule will execute and hit the 'Stop Repeat Actions' and 'Cancel Delayed Actions' which will terminate the Delay and Repeat from the first instance?

My understanding is that each instance of the rule executes independently. Where is it documented that a 'Stop Repeat Actions' and 'Cancel Delayed Actions' applies to all currently running instances of a rule?

rm should only create one repeat for each rule, so there should not be multiple instances running.

The Repeat Action documentation (quoted below) makes no mention about a limitation of only one Repeat per rule.

    Repeat Actions

Portions of, or all of the script of an Action can be repeated periodically, but you must specify the time interval for the repetition. Be careful not to make this interval too short, as you can consume your hub CPU resources by repeating too quickly. You can select any number of iterations if desired, but some method to stop the repetition is required. When a Repeat Actions is introduced to the script, any action before END-REP will be repeated. Only the Actions between Repeat Actions and END-REP will be repeated. Actions following END-REP will run only once the repetition has stopped. There is an optional Stop for a Repeat Action choice and if selected, then Stop Repeating Actions will stop this repetition. Using Stop Rule Actions from either the current rule or another rule, will stop all Repeat Actions, irrespective of which Stop selection is used.

Repeat Actions
     some actions...
END-REP

A Repeat Actions, like any action, can have a condition specified. If the condition is False, the Repeat Actions block will not be executed. If the condition becomes False during repetition, the repetition will be stopped (with the exception of when Repeat N Times is selected). This provides three features well known to computer programmers.

    While-loop - The while-loop runs only if the condition is true, and stops if it is false.
    For-loop - A for-loop runs for a fixed number of times, but if a condition exists, it will only start that iteration if the condition is true; The condition is not retested during iteration.
    Repeat-until loop - A repeat-until loop runs until a condition becomes true, running at least once.

Examples:

While loop - repeat while the condition is True:

IF (condition) Repeat Actions
     some actions...
END-REP

For loop (repeat n times):

Repeat Actions n times
     some actions...
END-REP

Conditional For loop (repeat n times if condition is True):

IF (condition) Repeat Actions n times
     some actions...
END-REP

Repeat-Until loop:

Repeat Actions with Stop selected
     some actions
    IF (condition) Stop Repeating Actions
END-REP

Repeat Actions cannot be nested. END-REP is optional, and if omitted, all actions after Repeat Actions will be repeated.

    Note: The END-REP does not have anything to do with the when a Repeated Action will stop repeating, it merely marks the end of the list of actions to be repeated. If you use Repeat These Actions without specifying N Times (for loop), and without a Condition (while loop), and also without a Conditional Stop or a Stop on Truth Change (for rules only), that means it should repeat forever, and that is probably not what you want to have happen. In that case, some other rule would need to cause the repetition to stop.

@bravenel is the expert.

You can have multiple repeats. You cannot have nested repeats.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.