New "Home on Code Unlock Too"

Perfect… Thank you for getting back so quick. That works like a charm. That lead to my next question though. Why have the code in there at all?

One other issue/question if I may. When I first set it up there was options relating to push notification. The 1st, Push Notification Only (I set it to on). the 2nd was regarding SMS notification which I elected to leave blank. Now with everything setup I no longer have the 2nd option available. How do I get this back???

Again, thanks for all your efforts. This is an extremely valuable addition to my door lock functionality.

Barry @storageanarchy,
First off, thanks for writing and sharing this. I bought my Schlage Camelot Deadbolt about 6 months ago in anticipation of getting a ST hub. It finally happened at Christmas. After including the lock I was a little disappointed that the only info I got was that the lock had been locked or unlocked. I stumbled upon your SmartApp in another thread and decided to give it a try.
My lock was completely set up with 6 user codes and Auto-lock turned on prior to installing the SmartApp. I set the six codes up in the app to match the ones I had already (manually) entered into the lock. After installing and configuring the app four of my six codes would no longer work. When I went to the log I saw six instances of “Set Home Mode When Door Unlocked sent setCode”. I thought maybe there was a communication problem so I verified the setup and hit the next button again. No luck. Same result. The app was working though because when I would unlock the door with the working codes it would say “Front Door Lock lock was unlocked with code 8 (or 9 or 10)” - even though I was only supposed to have six codes. So, I deleted ALL user codes from the keypad and configured the app again. No luck. No codes. I re-entered all six codes from the keypad to make them match the list and now everything functions properly.
Based on your previous entry you said that ST isn’t setting codes in the lock, but any idea why some of the codes in the lock became corrupted or removed? It seems like it’s doing something.

Because my lock is set to auto-lock, I don’t think the AWAY phrase use will work for me because the lock always auto-locks after 30 seconds.

Thanks again!

P.S. I also noticed that there is a new “(Enhanced) Z-Wave Schlage Touchscreen Lock” device type available. Have you tried that out with your app yet?

Thanks for this app! I have a suggestion or request…your app is pretty close to exactly what I’m looking for. I have a house cleaner and pet sitter that come to the house while I’m gone. There are two challenges I’m trying to work around, and maybe you know how to incorporate into your app. They are related actually.

Of course these people don’t have presence sensors, so I can’t detect when they leave. I also use an app that auto-locks my two locks after X minutes. The garage locks after 15 minutes, and the front door after 5. I haven’t had a chance to really test this, but I assume if I were not here, and one of the locks auto-locked, it would return the mode to my selected away mode. Would it be possible to add a feature to allow us to define a period after which the mode goes to away, rather than immediately upon door lock? For instance, the pet sitter stays from 20-45 minutes and the house cleaners are usually gone within an hour. If I could define the number of minutes after which the mode switches, that would probably be ideal, since I can’t rely on the door lock option (I definitely don’t want to remove the auto-lock feature I’ve implemented). I’d be happy with a single mode-switch delay to apply to all user codes, but if it could be even further configurable based on which code was used, that would be AWESOME!!

Second question is that I actually have two home modes and two away modes that could be relevant, because I use the Magic Home app. It is safe to assume that my cleaners are always here during the day, but I don’t think I can make that assumption for a pet sitter. If the pet sitter is coming here, it means I’m away longer than just a few hours, and I’d want to trigger the Magic Home assessment just like it would if I actually left the house with a presence sensor. That way when the mode changes, it would also respect whether or not it was before or after sunset when the new mode is determined. I wouldn’t want to house to be swapped to a day mode if the switch happened after sunset. That would leave the house totally dark for the period through the following day’s sunrise, and that’s not ideal if I’m not planning to be home myself in that period of time.

Thanks in advance for considering these ideas!

Hi @storageanarchy

Great App. Thanks for all your hard work.

I have one minor problem when setting up the app. If I create a user and set an unlock code that starts with a “0” the “0” will get deleted when I hit done. So a unlock code like 0847 becomes 847.

Any idea what might be causing that?

I thought I asked this before, but I can’t find my post about it. Is it possible to modify this app to control two locks? We have two Kiwksets and I would like to use it on both without having to have the app installed and configured twice.

Thanks for the code @storageanarchy. I modified it for me to do user code verification for the locking of the door as well. I didn’t want it to run the away action if it was manually locked (or schlage outside button press). Now it will only run the away action just when a user code is entered to lock the door. This works out great if you want to leave your presence/keys/phone but still arm/disarm the home. Maybe on a future release you would want to incorporate that if other locks report codes on locking. I just tested this with the schlage touchscreen.

Love this!!! Thanks!
I have a quick question-- would it be possible to build in an announcement message to a Sonos “Welcome Home Person!” when a specific user code is used to unlock? I do this now using presence sensors, but our cleaning people and dog sitter do not have presence sensors, just a specific lock code.

Thanks again.

Chris -

This is definitely possible, but I’m not sure if/when I could get to this.

Although relatively simple to add, I first have to figure out and fix my own SONOS implementation (I have issues with groups, such that ST announcements sometimes come on ONE speaker, and sometimes on ALL of them…I think I have to delete and re-installed with one SONOS Connect device for each SONOS speaker, or something.)

Hi, my Schlage lock throws errors when I set the codes in the app, thought you might want to see…

10:03:08 AM: error groovy.lang.MissingMethodException: No signature of method: java.lang.Integer.size() is applicable for argument types: () values: []
Possible solutions: is(java.lang.Object), find(), find(groovy.lang.Closure), times(groovy.lang.Closure), div(java.lang.Number), use([Ljava.lang.Object;) @ line 524

So, I’ve been trying this app for the last couple of days but I’m not being succesful.

I’m a little confused about the purpose of the Code List. What am I supposed to put in the code itself? the Slot location or the code that the person uses to open the door (the 6 to 8 digit code)?

I have tried both, adding while there are no codes in the Schalge touchscreen lock, adding them manually after adding them to the app, adding them to the app after reseting the codes in the lock. I have also tried to add the slot number instead of the door opening code…The result is always the same: The codes stop working and the door doesn’t open.

Any idea?

e[quote=“Ibai, post:82, topic:4451”]
What am I supposed to put in the code itself? the Slot location or the code that the person uses to open the door

That is correct. At least that is what I used (succesfully) when I first installed my Schlage lock. I just tried to add new codes via the app and it no longer works. In fact, the existing codes disappeared and I had to manually reprogram the lock. Once I did physically (using the same codes I used in the app) add the codes, the app would report back to me who unlocked the door depending on which code was used.

is it possible to have instances of this both controlling the same locks or will this create an issue…
I use presence sensors to unlock open garage etc.

I want to use this app to set codes for neighbors or if kids come home with normal code to unlock and disarm.

I want another instance on the same locks with no disarm etc. just to notify me when the lock is manually unlocked.

The app can do all this but can there be two instances both on the same set of locks. thanks

Anybody use this code to change modes from Away to Home get it to work with the new Smart Home Monitor. It doesn’t seem to change the mode quick enough on unlock and I get an intruder alert.

Nope, there’s no delay in SHM so it’s essentially useless until it gets a delay. Use SmartAlarm by @geko instead.

I use Home on Code Unlock with that and it works very nicely.

Same problem for now in tell.people O give out code to …to wait 5 secs before opening door. That gives it time to disarm.

Hi @storageanarchy & @hdonis

I can also confirm that this is indeed an issue. Any code starting with a leading 0 ie. 0555 becomes 555.

After reading through the entire thread I could not see a) that this was answered or b) addressed anywhere.


This smartapp appears to be perfect for my application with one tweak…Is it possible to only change mode when the selected pin is entered? If I understand correctly, the smartapp combines code entry and lock or manual entry. Is this change possible in the code?

I use this device type with my quickset locks… all this functionality is built in, including running a routine.

1 Like

Most locks have an issue with leading 0

The locks themselves have no issue with leading zeroes. To the lock, a zero is just one of ten available button presses. The issue is in the program you’re using to control the lock.

This occurs all the time in Excel and other systems.
Either the number field has to be specified to display a certain quantity of digits, or the field type has to be changed to Text.

Hope that helps.