Best way to automate door locks

I use this app also, works great. Just a heads up, The mode settings are not currently working with the latest hubitat update (2.2.3.118)

1 Like

Thank you @lewis.heidrick . That trick with pressure sensor is really neat.
Although, i do not have any pressure sensors at the moment but i will look into it soon.
In my current setup i have a door sensor and a zwave lock and i want it to remain unlocked if the door contact sensor is open. But if the door sensor is closed, i want HE to lock the door after a minute or two.

The auto lock app wont lock the lock if the door is open. It checks for closed state first.

def lockDoor()
{
log.debug "Locking Door if Closed"
if((openSensor.latestValue("contact") == "closed")){
log.debug "Door Closed"
lock1.lock()
} else {
if ((openSensor.latestValue("contact") == "open")) {
def delay = minutesLater * 60
log.debug "Door open will try again in $minutesLater minutes"
runIn( delay, lockDoor )
}
}
}

Yea, saw that too but I just use rules for modes anyways. Helps me keep my rules simple.

image
image

ohhh i just cut and paste the code under apps code. i did not know this was an app.

Copy paste the code in this link.
https://community.hubitat.com/t/help-automatically-locking-back-door/34998/6

It goes in apps code and then hit save. Add user app on the apps tab and then set your setting for lock time.

3 Likes

Thank you @lewis.heidrick that apps works exactly how i wanted.

1 Like

Hello everyone... I am migrating over from Smarthings. And the first things I am doing is getting my contacts and locks set up. I have them all ready to go, and for the last few days I have been trying to get the autolocking going. I have tried many different methods. Webcore, RM, and now I stumbled accross this app, which seems simple.

On Smarthings I used Webcore, and doors locked pretty much 99% of the time, after the door being closed.

Thus far on Hubitat, I have found RM not reliable, as I keep finding the doors unlocked. This morning I am trying this app, and still over the past few hours am finding some doors unlocked. Is everyone here getting pretty solid results?
Do you guys have a backup rule going by any chance? I have my doors locking after being closed for 1 minute. But if it somehow doesnt lock, perhaps I put a second code in to check again in two minutes?

Have you used the app mentioned above by @lewis.heidrick?

Yes that is the one I am using now, figured it would be the simplest. Yet, this morning I went to a lock, and it was unlocked. So it must not of fired?

Just tested it again, went out the door, waited till it locked. It did. Then I came back in the house, and then it never relocked. It is like it doesnt want to do it after one time, unless there is a lot of time in between

@lewis.heidrick - agreed, Auto Lock is a reliable and simple app, works great for me w/my Schlage lock. In fact, you probably pointed it out to me as well. :slight_smile:

It seems to be working correctly for a lot of us. Are you using correct lock driver ? Have you checked your automation rules to see if the lock is in any other rule ?

This is an important point...some of my worst results are when I have inadvertently put a device into multiple competing automations. Looking at the devices page in the Device list to see what automations/apps it's being used in is a key troubleshooting step for dummies like me. :slight_smile:

So can u elaborate a bit more on this? Should the lock not be in any other automations whatsoever?

If the lock is in another rule, it could be conflicting. Depending on what the rule is. I don't know what rules you’ve set!

Edit:
Also check for any HSM rules.

First question id ask is does the lock work 100% from the device page?

Yes it's there. I never see it missing or anything.

I'm going to double check. But to me it seems like if it is done in quick succession at times.. that's when I may not lock.

Sounds like zwave radio issues to me

1 Like

Check your logs for image
Also, put a delay of like 5 minutes at least so it isn't constantly firing when you're bringing in the groceries and such.

1 Like