[RELEASE] Auto Lock Door

https://github.com/csader/AutoLockDoor/blob/master/AutoLockDoor.groovy

Auto Lock Door app

A simple app that allows you to 1) select a door lock, 2) specify a number of minutes after being unclocked, after which the door should lock, 3) optionally select a contact sensor that must be closed for the auto lock to fire. Edit: the app gives the option to select modes, but it is not part of my app code and does not appear to work properly****

Installation

The best way to install this code is by using Hubitat Package Manager.

However, if you need to install manually:

  1. On the Hubitat hub, go to the "Apps Code" page
  2. Click "+ New App"
  3. Copy in the contents of AutoLockDoor.groovy
  4. Click "Save"
  5. Click "+ New App" again
  6. Copy in the contents of SwitchBindingInstance.groovy
  7. Click "Save"
  8. Go to the "Apps" page
  9. Click "Add User App"
  10. Click on Auto Lock Door
  11. Click "Done"
  12. Click on Auto Lock Door in your apps list
  13. Choose your door lock
  14. Set a number of minutes
  15. (Optional) choose a contact sensor
  16. Mode selection does not appear to be working, so I don't recommend using it
  17. Click "Done"

Changelog

v1.01 - Fixed null bug, removed "optional" from contact sensor (thanks @SoundersDude and @chipworkz )
v1.02- added toggle for debug logging (thanks for the idea @lewis.heidrick), and option to set to Seconds instead of Minutes (thanks for the idea @kampto)
v1.03 - @lewis.heidrick fixed the debug toggle

9 Likes

Thanks to @danabw for pointing out that I had written this app back in my ST days, and nudging me to release it to the HE community.

2 Likes

If anyone knows why searching for "auto lock" on HPM isn't brining up my app, but Browse By Tags with "Locks" selected finds it, let me know.

Worked for me using "lock" or "auto lock." Maybe HPM just needed a moment or two to catch up to the addition.

Nice to see it there! :slight_smile:

FYI, I tried a "Match Up" in HPM and it didn't find the installed version of your app, so it may be that the few of us who have it installed will need to install from HPM and move any automations over to the HPM version. No biggie for me, as I only have one lock/automation. :slight_smile:

2 Likes

This is pretty simple to do in RM or does this app offer something I'm missing? I'm doing this with RM:

Then again options are always good to have. :smiley:

1 Like

Agreed. I just know some folks have had good success with this app not slowing down their hubs, so I figured I'd share.

3 Likes

We sure have a different definition of simple. :wink:

I really appreciate this little app as it was one of my first "wins" with HE getting something to do what I wanted it to do.

Simple apps are great, and the more there are, the wider the Hubitat appeal. IMHO

3 Likes

Like I said it's good to have options. But ya simple compared to other rules I have in place.

1 Like

Not having to use RM. :wink:

6 Likes

It seems like there is a post every week about creating an automatic door lock RM, so it will be nice to point people in this direction instead of trying to fix their RM rule. I know this was one of the first things I setup, and this app makes it effortless.

Thanks @chris.sader

1 Like

Agreed, this is awesome! Thank you for sharing and putting this on HPM.
I do have a request though @chris.sader.

Any chance you could turn this into a Parent/Child app?

Specifically I have two locks and would love to have this set for both.

Naive me is thinking it would be easier to treat each Child app just like the app you have right now v.s. turning this app into having multi-lock support.

Edit: I also noticed a bug. When I select what modes I want it to work in, when I go back they are un-selected, as if it forgot.

Not sure if that is a preference bug, or if perhaps modes haven't been implemented?

you could always add two copies of the app, one for each lock.

2 Likes

I've always done it like @672southmain mentioned (multiple copies of the app), but I'll have to look into how to set it up as a Parent/Child app.

I'll look into the mode issue. If anyone has any ideas, let me know.

And so it begins... :smiley:

At some point I'm worried you're going to ask me to apologize for reminding you about your app. :wink:

Yea, and then open up all the testing issues, maintenance of a more complex app, etc. I vote for leaving it as it is, reliable and small and working.

2 Likes

Which works perfectly...

image

I like you.

4 Likes

Fair, my suggestion is more for those who go the HPM route, as it doesn't really let them do that like most the other apps. Anyhow, just a suggestion.

Personally I care more about the modes issue as I'm not sure it's working.

It's interesting, because my app code doesn't actually have anything in it that has anything to do with modes, so I'm not sure why that mode selector is even showing on the app setup page.

1 Like

Ah interesting. You have modes listed in your description (#4) so I assumed the support was explicit. Sorry about that.

Download the Hubitat app