Best way to automate door locks

I've been debating on what the best trigger would be for automating locking and unlocking doors. HSM status? Mode? Presence?

At first I figured I would automate around presence, but then remembered I would like to have door unlock notifications from HSM and I don't want notifications because I came home and my presence unlocks before HSM disarms via mode manager. Then I figured I would trigger based on HSM status but also realized I don't want doors unlocking when disarming from night to day. So I guess triggering on when Not Away is best?

I'm curious to know how other people automate their locks.

I do not automate unlocking. Presence is just too unreliable for me to trust it. I don't even let Alexa unlock my doors. All I need is for someone to yell "Alexa, unlock the front door" through the window. I usually have my phone with me, and I can unlock it via the dashboard if need be.

For locking, I do automate. I have a rule that notifies me every 2 minutes that the door is unlocked. After 10 minutes it locks the door. I also lock the doors when the house goes into asleep mode.

1 Like

For me unlocking automatically is way to much of a security risk. But for automatic locking I was worried that it would lock my mom's doors when she was just working in the back yard. So what I did was use a "long" delay on after my sensors determined the home was unoccupied and then locked the doors. I do override this for the evening. So if the house shows occupied and the door has been unlocked for a period of time and it's evening lock the doors. In sleep mode, which is manually triggered by her, then lock the doors.

1 Like

I automate my door lock with the door sensor. If the door sensor is closed wait 3 mins and lock door.

I use to automate unlocking door with presence but was not reliable.

I use presence to unlock, but automatically re-lock it after 5 minutes. That way, if something goes wrong and it unlocks when I'm not home, it will only stay unlocked for a few minutes.

2 Likes

That can't happen as Alexa requires a 4 digit pin to unlock any lock by voice. Now, if someone has your pin, that's another story that should be addressed first.

3 Likes

I use both automated unlocking and locking. Unlocking is done by presence with both the Alexa app and Life360 for both me and my wife (both have been rock solid) with an automatic re-lock after 3 minutes if the door hasn't been opened. I can also unlock via dashboard and the Alexa app.

As for automatic locking, I have contact sensors on each door and when it closes, the door locks. I also have each door lock to lock/lock out after 2 wrong pins.

1 Like

Could you by chance share your auto lock rule? I have one that's working but like the way you described yours. Thanks in advance!

I use a combination of wifi and iBeacon ( Bluetooth ) to auto unlock my door. It is also used to figure out if the house is occupied or not. I have iBeacons placed both inside and outside. As soon as I approach the front door, it unlocks- and all the other desired things happen. When talking about auto lock, I use a combination of motion, time and a door sensor.

1 Like

This is my auto-lock in case the lock unlocks and the door doesn't open:

This is my auto lock anytime the door closes:

3 Likes

Hello, would you be willing to share a step-by-step guide to replicate this Rule ? i am trying to do the same with this rule but i am trying my best to learn hubitat rule machine.
Thank you in advance.

I use this for automatically locking the doors. Help. Automatically locking back door

Doors locked is the default mode for my house and unlock with presence when I get home. Alarm disarms when we get out of bed with a pressure sensor and arms at night when we go to bed with the same pressure sensor. Also arms when everyone is away.

2 Likes

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?