Auto-Lock Door Only

Hey everyone,

Another simple but useful SmartApp.

Enhanced Auto Door Lock is a silly SmartApp since it requires a contact sensor to unlock the door. Really silly if you ask me.

I’ve gone ahead and stripped all that from this Auto Door Lock SmartApp.

Go ahead and give it try!


Hi there… I’m new to this and not sure how to take advantage of the script. Can you please help me out?

This should help. :sunglasses:

1 Like

JDRoberts post is perfect on how to setup custom SmartApps.

1 Like

First off: great work!

Question though.

I do use the contact sensor because sometimes i have my door open and unlocked (screen door).

Is there a way to add the contact sensor back in for when the door is closed.

Let me explain my situation. I was using the Enhanced Auto Door Lock app but it would unlock the door when opened which makes no sense because in order to open the door, it must be unlocked… so the lock would sometimes unlock itself. I guess it would get confused with the sensors.

So i would like to add back in just the “Automatically lock the door when closed” section and leave out the unlock section. Is that something that’s possible? I’m not a dev but i understand some coding basics.

I’ve added a screenshot.

Thank you!

I recently installed the “Enhanced Auto Door Lock” app and have found this one mandatory feature extremely upsetting. What the heck would I want an opened door to unlock for? This app is assuming that everyone has deadbolts. The most obvious problem with this design is that if my contact sensor falls off somehow… the door will unlock! Super faulty design.

I’ve already found the delays with communication to the hub causing a lot of issues when opening/closing the door because of this app. For some reason, my particular sensors occasionally don’t register right either and may show open, even though the door is closed. This causes the app to automatically unlock my door! Extreme security issue. Sure… “fix your door switches”… but that’s just part of the whole issue here.

And another issue I found is that the app currently only has minute options for auto lock… whereas unlock is seconds.

Thanks for the code… unfortunately it didn’t work for me… will have to check and see if I did anything wrong. I set the settings for 1 minute and waited 2… nothing locked. I think the option for a door sensor is needed here.

I agree with you… there should still be an option for auto locking based on the state of a sensor. I found this app to have this function Club Steve's AutoLock

For my situation, I have a door which gets used by different people throughout the day at the shop. At the end of the work day, we don’t necessarily go and check the door in the back to make sure it’s locked. It would be nice to have the door sensor automatically send the lock command when the door is shut.

Or check out webCore where you can set things up any way you want.

My simple lock after 10 minutes closed piston as an example, which uses a contact sensor.

If you want your door to unlock (or lock) on events, or time of day, or whatever, you can create a piston to do so with or without a contact sensor involved, your choice.