[Solved] User needs help understanding delays

I added the Delay action below and set it for 5 minutes. However, I keep getting notifications on my phone in like 2 or 3 minutes. This checks for the Kasa doorbell person detection being active. Can someone explain to me why it's not at least 5 minutes before I receive a notification?

-Thanks

A Delay command is just saying "Stop right here in the rule for [designated time], then continue on to next action".

In your case, there is no next action.

In plain english, what are you trying to do here with this 5-minute angle?

ETA - the explanation of delays and waits starts here in the Documentation.

2 Likes

If you move the delay in front (above) the notify, you will get a 5 minute delay as you want.

Have a look at the events log for device "Front Doorbell". Are there inactive-to-active transitions every 2-3 minutes? That would cause your rule to re-trigger within the five minute delay period. If that is the case, then all your delay is doing is setting up the rule to be instantiated multiple times.

1 Like

Just curious, is that how the Kasa integration works? I use a different camera and driver that also has person/face detection. That one uses "active" for generic motion and "present" for person detection. If you look at the device commands page, do you have a presence and a motion in the states portion on the right?

Screenshot of states with both motion and person detection

Could it be that it is just picking up motion (false positives) and notifying you for that?

Also, I do not use any delay for person detection at any of my cameras (If my camera detects a face at any of my cameras when I have them armed, I want to know right then, not 5 minutes later). If you are trying to limit repeats, then that sort of points to the fact that the "active" you are selecting is more for generic motion than face detection. I have never needed a delay since I started using the actual face detection as opposed to motion (which went off every time a leaf blew in front of the camer).

1 Like

Here is my rule. I created a virtual motion sensor so that I could use it in Hubitat Safety Monitor. The virtual sensor has a 15 second timeout (it will reset back to inactive 15 seconds after no activity)

The trigger is face dected (Camera "arrives"). The first action sets the virtual presence to active.

If my current mode is "Home" or "Yard Work" then it notifies my and my wife's phones, and also plays a message on speakers throughout my house.

If we are not at home, or in our night mode, then Hubitat Safety Monitor will sense the activity on the virtual motion sensor and trigger an intrusion (which has more drastic notifications than the above).

I read that section. It says "...then resume with the next action when the time is up.". So, I added an "Exit Rule" action thinking that the delay would wait 5 minutes until it exited the rule. But the phone notification still occurred after only 3 minutes.

How can I add a 5 minute delay to this rule? It doesn't seem like it should be this difficult.

Why yes they are. How did you know?

Ah, so you are setting the delay in the virtual motion sensor. Can you show me an example of that?

-Thanks

Check out this thread. I asked about integrating the Kasa doorbell with Kasa. and digutheinz completed his integration.

Is logging on for the rule? Show the logs from an occurence where the motion gets retriggered/active again at the 2-3 minute point (causing that <5' notification).

The logs should be revealing as to what's happening.

You told us :smiley: (I guessed from your description of the issue)

Something to know about Rule Machine: multiple parallel executions of the same rule are possible. Every one of the motion active events will trigger your rule - as long as the required expression remains true. The delay does nothing to stop that from happening; on the contrary, you've run into this issue because the delay is longer than the time between active events.

There are ways to prevent multiple executions, the most common is to use the rule's private boolean. In this case you would for example set private boolean to false as the first action, and set it back to true as the last action. Then add a condition "private boolean true" to your trigger.

4 Likes

Nailed it.

2 Likes

Thanks, I've used the private Boolean in some of my other rules. But I thought this would be simple! I still don't understand -- Regardless of whether there are multiple executions, I would think a 5 minute delay would be 5 minute delay, regardless.

Your log saw something too - you would likely find it helpful.

2 Likes

Thanks, I added the Boolean. I'll test it tomorrow, it's past my bedtime! :slight_smile:

Because the first command your rule executes after being triggered by the front doorbell becoming active, is to send a notification to your phone. Then your rule waits for 5 minutes (doing nothing) before it stops running and terminates. In other words you should have zero delay, and not the 2-3 minutes you are describing.

What you don't seem to understand, is while this instance of the rule will continue running for 5 minutes (once again doing nothing), any additional changes in the doorbell status will create additional instances of the rule, with each of them running for 5 minutes.

2 Likes

If you want to prevent repeat notifications for a single person detection event, then add a delay while setting the PB to be true. Something like this:

1 Like

Friendly reminder, again, to follow the guidelines and keep the forum tidy. Thanks!

2 Likes

And another reminder to look at the logs for your rules anytime they aren’t behaving as you intended.

Why is it that you are seemingly so resistant to doing that every time you have a new question about a rule?

Apologies if this sounds rude or harsh, but Robert has been unfailingly polite on this point over and over again and you don’t seem to get it.

You are creating more work for other people by not helping yourself, and us, with log screenshots, up front, every time something like this comes up.

5 Likes