[RELEASE] Auto Lock Door

Version number should be updated to avoid confusion.

Both the version number in the comment AND the state.version value. :+1:

1 Like

lol yes I caught that after I saved it the first time and then saw your edit after I saved it the second time. :slight_smile:

@672southmain Should be no confusion now. See the updated screenshot.

1 Like

Is anyone else seeing Door null in their logs?
I'm trying to figure out why I'm seeing that, and if it's causing any negative effects or not for me.

Any idea?
image

It looks like that would be your Door Sensor latestValue is null.

log.debug "Door ${openSensor.latestValue}"
log.debug "Lock ${evt.name} is ${evt.value}."

What's weird though is I have a lot of consecutive events there that show "Door Closed" then "Door null".

I'm wondering, should that log item be openSensor.latestValue("contact") instead?

Edit: Confirmed, updating that debug log to the above fixes the null problem for me.

1 Like

Oh yes good catch, I updated my temp fix above but @chris.sader will need to fix his code when he is free.

1 Like

Changes merged. Tested and it works on my end. Update the app and let me know if you're still getting any errors.

2 Likes

Great. Hope your move is going well, nice of you to check in when you're so busy... [eek!]

Thanks...moving back in to our house that we were renting and tenants left us a nice disaster. Fun times. This was a nice little reprieve from all of that. Now to figure out which switches to put in the house - I want to go Lutron throughout, but thinking about the cost makes me want to cry.

1 Like

Renters can be a real PITA. My mom rented a house for a few years, and when they moved back in the place was just a mess. Their cleaning deposit was way short of the mess they made. Worst was the ceiling over a chair in the living room. Not only did they smoke (said didn't) but they smoked cigars. The ceiling was just black from the cigar smoke.

I feel you comment about Lutron, really well done/designed/reliable, but man they are not cheap.

Would it be possible to have the timer enter a time frame like the example below?

image
Maybe just have minutes and seconds.

Let me look into it.

Just another suggestion, you removed the "Optional" comment but if you still do not define a sensor, it will still throw the error on Line 118 and so on. I suggest adding the required: true, and multiple: false comments below to make each one of these selections mandatory before saving since they are all actually required for the app to work.

{
    section("When a door unlocks...") {
        input "lock1", "capability.lock",
		required: true,
        multiple: false    
    }
    section("Lock it how many seconds later?") {
        input "secondsLater", "number", title: "Enter # Seconds",
		required: true,
        multiple: false 
    }
    section("Lock it only when this door is closed. (Required)") {
        input "openSensor", "capability.contactSensor", title: "Choose Door Contact Sensor (Required)",
		required: true,
        multiple: false 
    }
}
3 Likes

Ha, I'm a dummy. Sorry about that, I'll get this addressed tomorrow.

1 Like

Could you add a toggle to disable debug logging?

2 Likes

And an option for Seconds if one wants it to lock in less than a minute

Edit this line and delete the " * 60" and it will use seconds for a quick fix.

image

I used this in SmartThings. Took me forever to get RM to do it.

It's nice because it does the check to see if door is closed before locking and it's super simple. Also has auto relock incase locking fails.

2 Likes

Probably a dumb question, but I have 2 doors. I can only pick one or the other. Is there a way to use this app for multiple locks? Thanks, -Joel