Rule Machine "Cool Down Period"

Background: I have a rule that notifies me if the kids move around after going to bed. I also have a set of actions that trigger devices for bedtime (nightlights, fans, etc)

My intent is to have the notification only come out after they're in bed (could leverage overhead light being off as a condition for example) and then get notified if they get out of bed.

My gripe is that the way I have it written (crude, I know) notifies me like crazy and over and over.

I am curious if anyone has ideas for either angle of:

  • Only notify 'new' or 'recent' activity so in other words a "hot period" vs "cool period" (sorry I'm stealing terminology from Tasker
  • Have a cascade condition such as "bedroom door opens then motion = hudson move"; bedroom motion then hallway motion = Addi move"

Current rule setup:

Private boolean would work here. Something like this:

Required Expression:
   Private Boolean is True

Trigger:
   Door contact change or motion (what you have now)

Actions:
   Set Private Boolean False
   If (Mode in [Evening, Night, Early Bird] AND
   Time between 21:15 and 06:00) THEN
      Notify...
   End-If
   Wait for Event --> Elapsed Time (however long you want the timeout to be)
   Set Private Boolean True

Setting PB to False as the first statement will keep the rule from running again until you set PB back to true. Just put however long you want the cool down period to be in the wait statement.

Don't forget the End-If !!! It's best practice to always end and IF with an END-IF. (Except the simple IFs that are only one statement.)

2 Likes

I like @jabecker's solution better, but you could also use the Notification app and set this parameter:

The problem is, you couldn't have your "start" trigger be anything other than a time window (e.g. only notify between 9:15pm and 6am), that's why I don't actually like my suggestion as much, but just offering it up as a very simple solution.

Also, for me personally, I wouldn't include the time range in the If statement, I'd include it as a required expression. Just avoids unnecessary hub processing/logging by limiting the number of times the rule is triggered.

1 Like

For me I just have 2 rules for my youngest room

One keeps the light off even if he tries to turn it on, and the other sends a message with a specific alert if he opens his door. When my GSD hears it, he takes off in search of my youngest to pin him to the ground... (the bonus is our other dog joins in this festivity so they both keep him down till one of us can get to him)

Sunrise surprised me - that's a big range over the course of the year!

Depends on your latitude.

I've lived where he lives but didn't feel like throwing it in the public forum. What I said is true for him.
:slight_smile:

I like @jabecker approach with the exception that the rule could trigger at 21:14 and you won't get the notification but the rule will be in the "cool down period" at the beginning of the time window because the first action sets the PB to false even though the IF-THEN condition wasn't met. I would either move the PB to inside the IF-THEN or do this

Required Expression:
Mode in [Evening, Night, Early Bird]
AND
Time between 21:15 and 06:00
AND
Private Boolean is True

Trigger Events:
Hudsons Door contact *changed*
OR
... Motion any motion active

Actions to Run:
Set Private Boolean False
Notify Pushover....
Wait for event: --> elapsed time: ....
Set Private Boolean True
1 Like

Well I'm in Pittsburgh, no secret. That said Even when I'm awake at 5am. I like knowing when my youngest gets up. Conversely I have a rule on my 11 year old's door that if it doesn't open by 7:10 on weekdays then I get reminded to go and wake his arse up...lol...

1 Like

Surely we can automate that for ya!

1 Like

I already turn on his light at 7am and turn on alarms on is echo.... Still ends up with me or my wife waking him up...lol Kids are lazy AF..

2 Likes

I'm thinkin along these lines.... just tell em you're adding storage for his stuff !
:grin:

2 Likes

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