Delay broken?

Hi there,
I'm having some trouble with Rules Machine and delays. Here's my rule:


and here's a log excerpt:
app:2442021-11-07 01:25:16.681 pm infoDelay Over: Delay 0:01:00

app:2442021-11-07 01:25:11.612 pm infoAction: Delay 0:01:00

I'm confused at why it registers the command for the 1-minute delay, and then before one minute is up, it registers delay over. I'm sure this is user error in some fashion - what am I doing wrong?

Thanks
Kris

Is it possible that the rule was triggered more than once? It will run concurrently if this is the case.

I don’t believe I have concurrent instances of the rule running. In this test, I manually set the variable to 2, then the rule triggered. It should wait a minute, increment the variable down one step (ie 2-1 =1), and fire a message to me. When it changes the variable,I do expect it to fire a new instance of the rule, wait another minute, and do the same.

But what I’m seeing is that it doesn’t delay a minute. Just steps down immediately. Is it possible the wait amount is misaligned, and I thought I put in a delay of one minute but it is actually waiting only one second?

As a next step, I would recommend turning on all logging and posting a screenshot of the log. That might help identify the culprit for the issue…

From what I see, you do have it set to 1 minute out.

Thanks so much for helping me. Was traveling for work this week - sorry for my delay in responding. I enabled logging on the app for all events, triggers, and actions. Is that what you meant by all logging?

Here's the output:

Here's the full story of what's going on: the end goal is to create a "manual override" for my motion switch. I devised a three-rule solution. I created a rule (#1 of 3) that, upon a physical off press of the switch, sets a global variable to the value "2". This rule (#2 of 3, see first post of this thread) is triggered when that variable is nonzero, and it should take the variable integer number of minutes to return to the value of zero. The rule (#3 of 3) to fire the motion switch has a predicate that checks if the variable is zero before allowing the motion sensor to turn the switch on. It's probably wildly inefficient, and I'll take any advice on accomplishing a time-limited motion switch override, but now I'm terribly interested in why the delay isn't working as desired.

Thanks!

1 Like

A multiple rule solution can make things much less complex and is often a good approach.

Those are the right logs. I can see that the first time it ran, the 1 minute delay took only 2 seconds. However, the 2nd lasted the correct time. Very odd!

Have you tried re-creating the rule from scratch to see if that one would work correctly? Also, try using wait for event - elapsed time - 1 minute to see if it would work better.

I deleted and created the same rule but with a different name. Here's the log:


Appears to be no improvement in behavior of the delay function. You mentioned above that one time it looked to have waited a full minute-can you elaborate? I don't see it having waited more than a second or two.

I then paused that rule, and created a new one with wait for event, time elapsed, 1 minute. It works as intended! Here's the log:

Also, having now learned that I can wait for time elapsed, I don't need to decrement it by 1 each time...should save some cycles on the processor!

Would love to help get to the bottom of that delay not working properly. Let me know if I can be useful.

Thanks,
Kris

1 Like

I just tried a 1 minute delay in the latest beta version and it worked as expected. It might be a bug that will be fixed in the next version…. It might be worthwhile to test it once the next version is out to see if it starts working…