[RELEASE] Auto Lock

I am not in any rush. I appreciate you just attempting to figure this out. Please take your time. It sounds like you have lots going on with work and kiddos. Get some sleep.

Ambien told me to go to bed so to bee I go. I'll get it fixed up tomorrow.

1 Like

Thanks Lewis!!!!!! That fix done the trick, working like a charm now. 4 kids? Where do you get the time to have an uninterrupted thought man? Hats off to you!

Give this one a try and let me know how it works for you. Gonna get some sleep now. I'll follow up tomorrow.

https://pastebin.com/raw/pDAXzUYP

@KurtSanders Can you try these settings with the version linked below?

https://pastebin.com/raw/pDAXzUYP


1 Like

@lewis.heidrick I will give it a try this weekend when we return home. Thanks so much!

In my initial testing this looks good. I will continue to play with it and set up both my front and back porch locks. I just wanted to confirm with you that I understand the logic so I can set the times correctly. It appears that the main lock delay time is postponed until the motion delay completes and each time the motion goes active the lock delay is also reset and will wait for the motion delay after it goes inactive to begin the lock countdown. Am I understanding the logic correctly?

You have built a very powerful app here. I need to play with some of the options you have also. Thanks!

Yea, I had to do it that way because I don't have a good way to track the scheduled events right now and selectively block actions. There are several ways to go about it but this way was the easiest to code for. For things like this I'm still a fan of using a secondary method to cover cases such as a light switch or fan while out on the patio. Unexpected triggers from bugs or whatever could cause unexpected actions and leave you wondering what is going on. I personally use bptworlds combined presence in combination with my app for some powerful combinations. Combining the motion sensors into a single virtual sensor for example would cause less motion inactive triggers and less chances for it to relock on you. You'd have to rearrange the settings in the app but it works well. I use that same app for unlocking and locking the door when we come and go. I also use it for detecting when me and the wife are both in bed and trigger my app to lock up the house, turn off all the lights, and set the alarm.

@MikeSas I use the built in Zone Motion Controllers app for this. Allows you specify multiple motion sensors and different settings to determine if that β€œzone” is active or inactive. It creates a child mZone device you can then use in rules and apps. Might be worth pursuing.

Thanks! I understand and the logic is fine for me. I just wanted to confirm I was understanding what was happening so I can set the times correctly. That will work just fine for what I need.

I am in a very urban environment and bit more cautious about keeping doors locked than I would be living in the suburbs. They are covered porches on an old 1911 home where we leave lights on all night whether we are on the porch or not for security. So my wife is used to going out there without turning on any switches and same thing during the day. The way I have the motion sensors positioned, I get very infrequent false activity. So that has not been a problem for us. I like your app as it will simplify a complex set of rules I have been maintaining to accomplish the same thing.

Let me know if you are still interested in looking at that August Home Lock and Door Sense driver that seems to be the cause of that null pointer exception?

Thanks again!

Yea, shoot me over the driver in a message. A log of the error using the latest Auto Lock version would be helpful. Also, include a screenshot of the variables from settings icon using the gear icon on the child app.

I installed this with HPM and it includes an app and drivers for the August Lock

Here is the raw link to the diver I am using:
https://raw.githubusercontent.com/thecloudtaylor/hubitat-augustlock/main/drivers/august_lock_doorsense.groovy

Here is the error message from the latest version:

app:7172021-07-30 11:57:12.596 pm errorjava.lang.NullPointerException: Cannot invoke method contains() on null object on line 473 (method lock1UnlockHandler)
app:7172021-07-30 11:57:12.551 pm debugTest Auto Lock: null

Screenshot:

Let me know if you need something else. Thanks!

Code line 473 is referencing the physical unlock notifications. Looking at the driver it doesn't look like it provides this capability. To support this I would expect the driver to contain some sendEvent along with some descriptionText or a sendEvent along with a map of possible variables but this driver has none of that.. I'd just disable the notifications or maybe add the events to the driver. They do have notifications for the door opening and closing though.

void dooropened()
{
LogDebug("DoorOpenedCalled");

sendEvent(name:"contact", value: "open", isStateChange: true, descriptionText: "Door Opened");
}

void doorclosed()
{
LogDebug("DoorClosedCalled");

sendEvent(name:"contact", value: "closed", isStateChange: true, descriptionText: "Door Closed");
}

@lewis.heidrick First, thanks for the great app. I feel like a complete idiot. I built a whole set of rules around presence, HSM status, Envisalink sensors, and even fire alert to do all the stuff your app does. Took months to get it all right. I've now ripped it all out and switched to your app.

I do have two enhancement requests. Unlike your installation, my smoke and CO detectors are not all one zone... rather 8 different zones. Could you perhaps modify the fire/medical sensor to be multiple choice check boxes? I have built a virtual smoke/co detector and some logic in RM but I would rather just use your fantastic app natively. Second (and this one is really all about me) could you perhaps give folks the option to invert the switch to enable and disable the app (in other words, disable with switch on or off)? I have a virtual switch set up that basically says "disable lock and HSM automation" but ON means disabled. I know, I could easily fix my logic and use the app the way it is, but if this is something simple maybe others would use it also.

Both should be easy to implement. I'll work on it when the kids take their nap.

Awesome! Now I have to figure out how to test :). Maybe I will just keep a virtual smoke detector in the mix and use that. Last time a real one went off the fire department showed up at 2am in turnout gear on my 2nd floor landing. Thank goodness we had accidentally left the door unlocked. I'd never be able to replace the door - it's 130 years old!

I like the Envisalink board... a couple folks had to contribute to fixing it since the developer moved on but now that it's working it's pretty cool.

BTW I'm using Geofency and iBeacons as my presence sensors. iBeacons are nice because they have adjustable ranges. I have one out on the porch that I combine with a geofencing app. It unlocks the front door as I climb up the steps. Usually. I'm still debugging the Geofency part.

Thanks for looking into the driver for me. I just tested it with all the notifications disabled and still got the same null pointer exception on line 473. Is there something else I need to do there. I checked the the settings and all the NotifyOn variables are false.

Did you remove your phone from the notification devices?

Yes, I both removed my phone and disabled the switch.

I also just went in an unchecked the events types for the notifications that I realized I had left checked. And still got the same error.

@MikeSas Can you confirm that all three notification locations are empty?

Try this and see if it clears the error. Paste the code over the child app.

https://pastebin.com/raw/9N1Uau59