Deadbolt relock with delay not working the way I want

Happy Thanksgiving everyone! I've been playing around with Rule Machine for about a month and I can't seem to solve one particular rule i've been trying to create. I'm sure this will be simple for some of you vets, but as a beginner- this one has me stumped. Basically, I have a front door, a Schlage deadbolt, and a contact sensor for that door. I'd like for the deadbolt to relock but after the door has been closed for 7 minutes. I'd also like the delay to restart if the door has been opened again within that 7 minutes. What i've managed to create is a rule that will lock the door after its been closed for 7 minutes- regardless if the door has been reopened within that time. With lots of people at our house this holiday- i've actually run into the issue where the deadbolt would happen to relock while the door is still open. I'd also like to take into account- that the deadbolt would relock itself in the rare case where someone would unlocked it, but then never opened the door. I have 2 doors with deadbolts so once I get this figured out, I'll do the same with the other door. Thanks in advance!!

In this case you would need to add lock status changed to your trigger.

Try this out.

The above will certainly also work, but if you're curious why your rule isn't working and just wanted to learn specifically, there are three things:

  1. The "cancelable" flag you (correctly) set doesn't do anything without a "Cancel Delayed Actions" action. To make your existing rule work if you're otherwise happy with the logic, adding one at the beginning could help.
  2. A "standalone" Delay action and a delay on an action behave differently. Your lock action above will be delayed by 7 minutes, but RM just schedules that for 7 minutes into the future and then moves on, so you'll get the notification right away. A plain Delay action, like "Delay 0:07:00 (cancelable)" before your lock and notification are what you want.
  3. Partly as a consequence of the above (but even as-is), you'll need a "full" conditional and not a "simple" conditional. A simple conditional "IF" applies only to the single action (that's why it's simple) on which it is placed, not anything after it. So as written, you'll get a notification any time the door contact sensor opens or closes, regardless of whether it was really locked or not, and you'll get it immediately, not after 7 minutes. This is the difference between:

IF (x is true) Do Y


IF (X is true) THEN
  Do Y

(so you can put multiple actions inside the scope of a "full" conditional)

Thanks for your help guys. I'll get on it as soon as I can. As I side note: I WAS getting notifications each time the door opened and it was driving me nuts. With a family a 4, none of this was really noticed before today. With a house full of guests (and the door opening and closing many many times), my original recipe proved to be a disaster. Can wait give it another shot.


I am just having a similar issue.
Just can't get my head around RM4

I want my door to unlock if there has been motion at it for more than 1 minute.
If the motion stops within the 1 minute then cancel the rule.
I have conditions set that the motion sensor must be active. (I tried Not inactive as well)

I have tried a cancelable delay on the unlock action and before the actions.
Not sure why it is not cancelling the action.

The rule condition says motion active true then goes false as expected.
But it still fires the action after going false.

Seams pretty straight forward

Trigger: Motion *changed*


IF (Motion active) THEN
  Delay 0:01:00 (cancelable)
  Unlock Door
  Cancel Delayed Actions

I'm not sure what you're trying, but something like the above should work. I don't think I need to say that I would not recommend this unless your motion sensor is indoors and you're positive it will not stay active for more than one minute under undesirable circumstances (and that its "reset" interval is less than 60 seconds, otherwise this will happen every time--nothing RM can do about how your sensor reports activity). :slight_smile:

1 Like

thank you
yes that did it
my scenario was a bit simplified I am using multiple motion sensors inside and outside which all must be in a certain state.
I have a lot of motion sensors in my house and some over lap.

Being a beginner with RM4, I've managed to follow your layout up until "Lock: front door Lock--> delayed: 0:0700 (cancelable). From there is where I get lost. I know how to send a notification to the phone, but a delayed one is where I get lost.. as well as the "else" cancel delayed actions. Where is that? I see "cancel rule timers" but not "cancel delayed actions".. ugh.. I'll need to play around with RM a bit more.

There is a toggle at the bottom of each action called "delay"

After you've created your first conditional action "If (condition) Then", the Else and Else IF appears under conditional actions

Cancel delayed actions is under the "delay or repeat actions, wait" section of actions.

You rock! Thanks for spelling everything out for me. The recipe works now just as I had envisioned it to work. This is as deep into RM that I've gotten so far and this was definitely a great learning experience for me.

1 Like

Thank you for the explanation. These are little nuances that would have taken lots of trial and error to figure out and your breakdown just saved me from alot of frustration.


1 Like