Re-Lock After A Certain Time If Lock is Unlocked

I am having some trouble wrapping my mind around how to do this. I have a simple rule that locks my August door locks at 9pm. I want to create a rule the re-locks the doors if they become unlocked between the hours of 9pm and 9am. Maybe delay them for a minute after they become unlocked.

Welcome to the community!
This rule was created in Rule Machine. It is set to lock the door if conditions are met. The doors need to be closed via contact sensors. If the door opens, then the lock will cancel the timer.. Otherwise it locks after two minutes.
I hope this helps you.

There are other recommendations because this rule isnt set up to the new way, and I'm not good at it. I suggest checking out the video on the youtube channel about keeping your rules simple, but feel free to use this rule until you get your feet under you. I don't use this rule any more, but it's worked for over two years flawlessly. Unless I ran into communication issues. I just tested it and it's rock solid, but just not in the simple way that's recommended now.
you would just need to add a condition to the bottom part for the time restriction. And the time is between _and _ then lock delayed 2 minutes


@mitch - welcome to Hubitat!

So I think this would be a simplified rule to run your automation that is only triggered when the lock is unlocked.

Screen Shot 2020-05-22 at 9.46.04 PM

Caveat emptor - I'm not a rule machine expert.

Also, this is the episode of Hubitat Live! that @april.brandt referred to, in which @bravenel demonstrated how to simplify rule machine automations. My take home message from that episode is that a trigger value of *changed* is not the best choice in most cases. And to coalesce conditions to minimize the overall number of conditions.


I have a contact sensor on my front door which is rarely delivery/package pickups...this is the rule I use

Thanks everyone. I will check into these.