Cancelable Rule Not Working?

I have a simple rule that turns on an outside light whenever the door opens and leaves it on for 30 minutes. However, if in that 30 minute period should the door open again, the 30 minutes is supposed to reset. I thought it had been working correctly but the last couple of days I noticed it not resetting the 30 minute wait if the door opens.

Here is my rule:

Here are some logs:

Here is the Scheduled Jobs in the Rule that correspond to the above logs:

The lights turned off at 7:55 pm as indicated in the Scheduled Jobs but it should not have until 8:13 pm as it would have been 30 minutes passed the last time the door had been opened....

It appears that each time the door opens, the 30 minute rule delay is not resetting. @bravenel is this a bug or do I not have something set correctly?

Your rule is not set up correctly. You want "Cancel Delayed Actions" instead of "Exit Rule" (I also prefer to structure the time restriction separately but I think what you have should work). "Exit Rule" stops at the current action and doesn't execute any more future actions but doesn't unschedule anything you've already caused.

There are several examples of cancelation in the docs, which I recommend reading.

2 Likes

I have changed the rule as you said. However, if I Cancel Delayed Actions, it appears it is not setting the 30 minute delay to turn off the light.. I will give it 30 minutes to see if it turns off or not.

Also the docs link you reference, I get that I am not authorized to access the page.

Scott

Try changing from 30 to 5 minutes, you will save time! Then if works, change it to 30

LOL. I didn't think of that :smile:

I think you want the “off with delay cancellable” in the ELSE section. The Cancel Delayed Actions should be in the IF section.

2 Likes

That too! Or at least this is probably what you want: turning the lights off a certain amount of time after the door is closed, not a certain amount of time after it opens. (I was caught up on the other issue and didn't think about this aspect of the logic.)

That's odd--I just linked to a forum thread. You can view the same thing on the "real" docs site: https://docs.hubitat.com/index.php?title=Rule-4.0

1 Like

I think you linked to the Beta users only section. The public thread for RM 4.0 can be found below

1 Like

I tried it this way and so far, it appears to be working as it should be. Thanks for the help!

1 Like