# \[Depricated\] Lock Code Manager

**URL:** <https://community.smartthings.com/t/depricated-lock-code-manager/12280>\
**Category:** Community Created SmartApps\
**Created:** [March 5, 2015, 5:59pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280 "2015-03-05T17:59:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethayer](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ethayer/32/14852_2.png) [@ethayer](https://community.smartthings.com/u/ethayer)\
**Post date:** [March 5, 2015, 5:59pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/1 "2015-03-05T17:59:34Z")

</div>

# There’s a new app!

Please go to [this thread](https://community.smartthings.com/t/release-lock-manager/63022/) for the new Lock Manager App, which is in active development.

##Legacy App:  
This app is no longer being maintained. Support and bug fixes are no longer being provided.

# Welcome to Lock Manager!

### Now with custom device type!

- Use the attached device type zwave-lock.groovy for added functionality.
- Minimal changes to SmartThings code.
- More reliable code set/delete.
- Codes will be reconciled on each poll() event.
- App will function without custom device type, but not as well.

### Features:

- Assign Codes to Multiple Users.
- Manage Multiple Locks.
- See what codes are active.
- See how many times a code is used (reset usage manually)
- Be notified when a user uses their code.
- Delete codes after they are used\*.
- Optionally Schedule Users so that they only have access during certain times, modes, days of the week, or a calendar range.
- Decide which notifications to receive in the event that the locks are too chatty.
- When a code is entered, perform Hello Home Actions.

\* Code is burned when a user enters it at any selected lock. Code will not become active again until code usage for that user is reset.

# How to use:

## How to…Install App

1. _Go to_ **[Apps](https://graph.api.smartthings.com/ide/apps)** in IDE
2. _Click_ “New App +”
3. _Click_ “From Code”
4. _Copy_ from **[github](https://raw.githubusercontent.com/ethayer/user-lock-manager/master/smartapps/ethayer/user-lock-manager.src/user-lock-manager.groovy)**
5. _Paste_ into textarea on SmartThings
6. _Click_ Publish \> For Me

## How to…Add Device Handler:

1. Navigate to: [https://graph.api.smartthings.com/ide/devices](https://graph.api.smartthings.com/ide/devices)
2. Click **‘New SmartDevice’** in the upper right.
3. Click **‘From Code’**
4. Paste the code from the link (github) above into the text area:

- if you have a _schlage_ lock, use @garyd9’s handler: [here](https://raw.githubusercontent.com/garyd9/SmartThingsPublic/master/devicetypes/garyd9/zwave-schlage-touchscreen-lock.src/zwave-schlage-touchscreen-lock.groovy)
- all other locks: [here](https://raw.githubusercontent.com/ethayer/user-lock-manager/master/devicetypes/smartthings/zwave-lock-reporting.src/zwave-lock-reporting.groovy)

1. Click **‘Create’**
2. Click **‘Save’**
3. Click **‘Publish’** \> **‘For Me’**

## Change lock device handler to new code:

1. Navigate to **‘My Devices’** : [https://graph.api.smartthings.com/device/list](https://graph.api.smartthings.com/device/list)
2. Locate your lock and click on the **name** in the _first column_
3. Click **‘Edit’** on the bottom of the page view
4. In the **‘Type’** drop-down scroll to the bottom and select **‘Z-Wave Lock Reporting’** or **_’Z-Wave Schlage Touchscreen Lock’_**
5. Click **‘Update’** to save changes

#### Then continued on your smart device…

1. _Tap_ Marketplace
2. _Tap_ SmartApps
3. Scroll down to ‘My Apps’ / _Tap_
4. _Tap_ User Lock Manager
5. Fill out app options.

## NOTE:

Please use only the included device type or the default device type provided by SmartThings, or the schelage device type created by @garyd9 here:

## Confirmed Locks:

- Kwikset 910, 914
- Yale Security YRL-220-ZW-619
- Others?

## USE AT YOUR OWN RISK

It is possible that a user code deletion could fail. Do not give door codes to people that you don’t want access to your home or office, and watch notifications carefully.

### Donations

If this made your life easier, please consider donating. Donation links are in the readme on [github](https://github.com/ethayer/user-lock-manager).

---

<div class="post-metadata">

**Author:** ![Mbhforum](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/mbhforum/32/93879_2.png) [@Mbhforum](https://community.smartthings.com/u/Mbhforum)\
**Post date:** [March 5, 2015, 6:49pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/2 "2015-03-05T18:49:25Z")

</div>

Really cool! I just tested it on my Kwikset 914 and it worked perfect with the built in device type. Previously there was a custom device type that didn’t report battery properly. Now everything just works 😄

One suggestion would be to allow multiple User’s in the same app (in case people don’t need to break out schedules). It would be nice to see in one place all of your users too. One thing to note on the Kwiksets, there are 2 codes that can be used which are local codes only and cannot be programmed via zWave. The 1-30 codes are on top of the 2 local codes. This was very confusing to me when I first got the locks. So in reality, codes 1-2 are local, and 3-32 are zwave. Not sure about other locks.

---

<div class="post-metadata">

**Author:** ![brianlees](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/brianlees/32/267_2.png) [@brianlees](https://community.smartthings.com/u/brianlees)\
**Post date:** [March 5, 2015, 6:56pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/3 "2015-03-05T18:56:00Z")

</div>

Nice - please consider adding Hello Home actions (both unlock and lock) based on code entered.

---

<div class="post-metadata">

**Author:** ![brianlees](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/brianlees/32/267_2.png) [@brianlees](https://community.smartthings.com/u/brianlees)\
**Post date:** [March 5, 2015, 6:57pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/4 "2015-03-05T18:57:16Z")

</div>

@ethayer - does this support multiple locks at the same time?

---

<div class="post-metadata">

**Author:** ![Mbhforum](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/mbhforum/32/93879_2.png) [@Mbhforum](https://community.smartthings.com/u/Mbhforum)\
**Post date:** [March 5, 2015, 6:59pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/5 "2015-03-05T18:59:00Z")

</div>

Yes, I can answer that. Really cool app.

---

<div class="post-metadata">

**Author:** ![ethayer](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ethayer/32/14852_2.png) [@ethayer](https://community.smartthings.com/u/ethayer)\
**Post date:** [March 5, 2015, 7:01pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/6 "2015-03-05T19:01:43Z")

</div>

You can use multiple locks, yes.

> [@Mbhforum](#):
>
> One suggestion would be to allow multiple User’s in the same app

This adds a bit of complexity, but I think it can be done. Users would then just need to use multiple installs for different sets of rules such as scheduling.

> [@brianlees](#):
>
> Nice - please consider adding Hello Home actions (both unlock and lock) based on code entered.

For sure, I think this feature falls under my plan to do user actions after a code is entered. We should be seeing that integrated into this app soon.

I’m not sure how the LOCK part of that would come into play since I wouldn’t be able to retrieved who locked the door in most cases, so it would be difficult to wrap that into this app. That might work well as a stand-alone app where it just deals with actions when the door is manually locked.

---

<div class="post-metadata">

**Author:** ![brianlees](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/brianlees/32/267_2.png) [@brianlees](https://community.smartthings.com/u/brianlees)\
**Post date:** [March 5, 2015, 7:05pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/7 "2015-03-05T19:05:15Z")

</div>

I saw you mention actions, but it didn’t specifically say Hello, Home…so I thought I would put my two cents in. 😄 Many times, I see apps that add “actions” but not hello, home actions.

Going to load this up and take a look!

---

<div class="post-metadata">

**Author:** ![brianlees](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/brianlees/32/267_2.png) [@brianlees](https://community.smartthings.com/u/brianlees)\
**Post date:** [March 5, 2015, 7:06pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/8 "2015-03-05T19:06:05Z")

</div>

For the LOCK, it would just be a single mode when someone locks it.

Also, can you capture when someone uses a key (manual unlock)?

---

<div class="post-metadata">

**Author:** ![ethayer](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ethayer/32/14852_2.png) [@ethayer](https://community.smartthings.com/u/ethayer)\
**Post date:** [March 5, 2015, 7:13pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/9 "2015-03-05T19:13:33Z")

</div>

I wasn’t really thinking of that as a feature since I was only really thinking about actions of adding access and revoking access. Obviously the key will always be able to open the door.

Responding to non-code actions on the lock wasn’t in my original thoughts, but it might be a good idea to incorporate that once actions are added.

Thanks for the suggestions!

---

<div class="post-metadata">

**Author:** ![brianlees](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/brianlees/32/267_2.png) [@brianlees](https://community.smartthings.com/u/brianlees)\
**Post date:** [March 5, 2015, 7:33pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/10 "2015-03-05T19:33:22Z")

</div>

No problem. I figured once you have all the actions in place, why not just “flip the switch” to support the manual action. That would then make everything related to the lock in one complete SmartApp.

---

<div class="post-metadata">

**Author:** ![ethayer](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ethayer/32/14852_2.png) [@ethayer](https://community.smartthings.com/u/ethayer)\
**Post date:** [March 5, 2015, 7:44pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/11 "2015-03-05T19:44:27Z")

</div>

> [@brianlees](#):
>
> why not just “flip the switch”

My wife says that all of programming is a bunch of if/then statements. When I’m having an issue with a project, sometimes I have trouble sleeping because it’s running through my head on repeat.

So she says… Honey, just use an if/then statement.

It’s funny [almost] every time.

---

<div class="post-metadata">

**Author:** ![chrisharrigan](https://avatars.discourse-cdn.com/v4/letter/c/3da27b/32.png) [@chrisharrigan](https://community.smartthings.com/u/chrisharrigan)\
**Post date:** [March 7, 2015, 4:44pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/12 "2015-03-07T16:44:54Z")

</div>

This looks awesome. Does this work with any of the Schlage Digital Touchscreen locks?

---

<div class="post-metadata">

**Author:** ![ethayer](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ethayer/32/14852_2.png) [@ethayer](https://community.smartthings.com/u/ethayer)\
**Post date:** [March 8, 2015, 2:19am UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/13 "2015-03-08T02:19:41Z")

</div>

I have added the ability to enter multiple users per install. This should make it easier for people to keep track of their codes easier.

I also added the ability to run Hello Home actions on user unlock code, with the ability to also apply this setting to manual unlocks as well.

Enjoy, and let me know what you think! Did this help you out? Is it broken?

I added a list of locks that people said have worked with this app. If you have a lock not on this list and it seems like everything working, let us know so we can add it to the list.

Thanks!

---

<div class="post-metadata">

**Author:** ![brianlees](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/brianlees/32/267_2.png) [@brianlees](https://community.smartthings.com/u/brianlees)\
**Post date:** [March 8, 2015, 2:47am UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/14 "2015-03-08T02:47:51Z")

</div>

Thanks @ethayer! Might I make one suggestion - put a version number or minor bit of version history in the app code itself so when you update it, we know what version we are currently on.

---

<div class="post-metadata">

**Author:** ![ethayer](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ethayer/32/14852_2.png) [@ethayer](https://community.smartthings.com/u/ethayer)\
**Post date:** [March 8, 2015, 3:57am UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/15 "2015-03-08T03:57:28Z")

</div>

Good suggestion. I’ll start tagging the releases.

---

<div class="post-metadata">

**Author:** ![BokehJosh](https://avatars.discourse-cdn.com/v4/letter/b/9de0a6/32.png) [@BokehJosh](https://community.smartthings.com/u/BokehJosh)\
**Post date:** [March 8, 2015, 4:52am UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/16 "2015-03-08T04:52:54Z")

</div>

Complete newbie here…when I add my codes it does not show the 0’s in the smartapp. Are the 0’s still programmed into the lock, but just don’t show in the app?

This is a great app. Thank you!

---

<div class="post-metadata">

**Author:** ![ethayer](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/ethayer/32/14852_2.png) [@ethayer](https://community.smartthings.com/u/ethayer)\
**Post date:** [March 8, 2015, 5:13am UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/17 "2015-03-08T05:13:39Z")

</div>

I just tried out zeros and here’s what I found:

###Usable codes with zeros:###  
1-2-3- **0**  
1-2- **0** -3

###Zeros are removed if they’re the first digit of the number:###

**0** -1-2-3

Is this what you mean? I can see how that could be a problem. I’m not sure how to fix it for an integer variable type. I may have to change it to a string input type, but I’m not 100% sure that will even solve the problem. I’ll do more experiments with zeros when I have the time.

If you have a lock with shared numbers, just use the other number for now. For instance on my Kwikset 910, Zero is equal to 9… so…  
0-1-2-3  
is the same as  
9-1-2-3

Sorry, that’s not very helpful but that’s what i’ve had to do in the past with other Lock Apps. I’ll look into solving this in a more thoughtful manner.

EDIT: This problem has been solved.

---

<div class="post-metadata">

**Author:** ![Nagui\_Anis](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/nagui_anis/32/109455_2.png) [@Nagui\_Anis](https://community.smartthings.com/u/Nagui_Anis)\
**Post date:** [March 8, 2015, 6:33pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/18 "2015-03-08T18:33:06Z")

</div>

## Very nice update, but I have a problem in my Yale lock. I entered 5 codes for the first 5 users, only 3 users were updated, and it seems it executed twice, here is the log:

09118c68-c292-41ad-9a60-f235e3e8eb4f 8:23:39 PM: debug "zw device: 02, command: 9881, payload: 00 63 03 03 01 39 39 38 38 " parsed to [[‘name’:‘codeReport’, ‘value’:3, ‘data’:[‘code’:‘9988’], ‘descriptionText’:Floor 1 Lock code 3 is set, ‘displayed’:true, ‘isStateChange’:false, ‘linkText’:‘Floor 1 Lock’]]  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:23:39 PM: debug code report parsed to [[‘name’:‘codeReport’, ‘value’:3, ‘data’:[‘code’:‘9988’], ‘descriptionText’:Floor 1 Lock code 3 is set, ‘displayed’:true, ‘isStateChange’:false, ‘linkText’:‘Floor 1 Lock’]]  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:23:31 PM: debug "zw device: 02, command: 9881, payload: 00 63 03 02 01 31 39 35 36 " parsed to [[‘name’:‘codeReport’, ‘value’:2, ‘data’:[‘code’:‘1956’], ‘descriptionText’:Floor 1 Lock code 2 is set, ‘displayed’:true, ‘isStateChange’:false, ‘linkText’:‘Floor 1 Lock’]]  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:23:31 PM: debug code report parsed to [[‘name’:‘codeReport’, ‘value’:2, ‘data’:[‘code’:‘1956’], ‘descriptionText’:Floor 1 Lock code 2 is set, ‘displayed’:true, ‘isStateChange’:false, ‘linkText’:‘Floor 1 Lock’]]  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:23:21 PM: debug "zw device: 02, command: 9881, payload: 00 63 03 03 01 39 39 38 38 " parsed to [[‘name’:‘codeReport’, ‘value’:3, ‘data’:[‘code’:‘9988’], ‘descriptionText’:Floor 1 Lock code 3 is set, ‘displayed’:true, ‘isStateChange’:false, ‘linkText’:‘Floor 1 Lock’]]  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:23:21 PM: debug code report parsed to [[‘name’:‘codeReport’, ‘value’:3, ‘data’:[‘code’:‘9988’], ‘descriptionText’:Floor 1 Lock code 3 is set, ‘displayed’:true, ‘isStateChange’:false, ‘linkText’:‘Floor 1 Lock’]]

09118c68-c292-41ad-9a60-f235e3e8eb4f 8:22:33 PM: debug "zw device: 02, command: 9881, payload: 00 71 05 70 03 " parsed to [[‘name’:‘codeChanged’, ‘value’:3, ‘descriptionText’:Floor 1 Lock code 3 changed, ‘displayed’:true, ‘isStateChange’:true, ‘linkText’:‘Floor 1 Lock’], 988100630203]  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:22:23 PM: debug "zw device: 02, command: 9881, payload: 00 71 05 70 01 " parsed to [[‘name’:‘codeChanged’, ‘value’:1, ‘descriptionText’:Floor 1 Lock code 1 changed, ‘displayed’:true, ‘isStateChange’:true, ‘linkText’:‘Floor 1 Lock’], 988100630201]  
29517029-6785-4ab0-9b3c-a427ce4c50d2 8:22:19 PM: trace getPhrases(), state.welcomeIssue = null  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:22:14 PM: debug "zw device: 02, command: 9881, payload: 00 71 05 70 02 " parsed to [[‘name’:‘codeChanged’, ‘value’:2, ‘descriptionText’:Floor 1 Lock code 2 changed, ‘displayed’:true, ‘isStateChange’:true, ‘linkText’:‘Floor 1 Lock’], 988100630202]  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:22:04 PM: debug "zw device: 02, command: 9881, payload: 00 71 05 70 03 " parsed to [[‘name’:‘codeChanged’, ‘value’:3, ‘descriptionText’:Floor 1 Lock code 3 changed, ‘displayed’:true, ‘isStateChange’:true, ‘linkText’:‘Floor 1 Lock’], 988100630203]  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:21:55 PM: debug "zw device: 02, command: 9881, payload: 00 71 05 70 01 " parsed to [[‘name’:‘codeChanged’, ‘value’:1, ‘descriptionText’:Floor 1 Lock code 1 changed, ‘displayed’:true, ‘isStateChange’:true, ‘linkText’:‘Floor 1 Lock’], 988100630201]  
6fa5f69e-1a12-4489-8cc2-4d75e1b4d3bd 8:21:51 PM: error groovy.lang.MissingMethodException: No signature of method: static java.lang.Integer.toString() is applicable for argument types: (java.lang.String) values: [3570]  
Possible solutions: toString(), toString(), toString(), toString(int), toString(int, int), toHexString(int) @ line 359  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:21:51 PM: debug setting code 3 to 9988  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:21:51 PM: debug setting code 2 to 1956  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:21:51 PM: debug setting code 1 to 71956  
6fa5f69e-1a12-4489-8cc2-4d75e1b4d3bd 8:21:51 PM: error groovy.lang.MissingMethodException: No signature of method: static java.lang.Integer.toString() is applicable for argument types: (java.lang.String) values: [3570]  
Possible solutions: toString(), toString(), toString(), toString(int), toString(int, int), toHexString(int) @ line 359  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:21:51 PM: debug setting code 3 to 9988  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:21:50 PM: debug setting code 1 to 71956  
6fa5f69e-1a12-4489-8cc2-4d75e1b4d3bd 8:21:50 PM: error groovy.lang.MissingMethodException: No signature of method: static java.lang.Integer.toString() is applicable for argument types: (java.lang.String) values: [3570]  
Possible solutions: toString(), toString(), toString(), toString(int), toString(int, int), toHexString(int) @ line 359  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:21:50 PM: debug setting code 3 to 9988  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:21:50 PM: debug setting code 2 to 1956  
09118c68-c292-41ad-9a60-f235e3e8eb4f 8:21:50 PM: debug setting code 1 to 71956

---

<div class="post-metadata">

**Author:** ![Nagui\_Anis](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/nagui_anis/32/109455_2.png) [@Nagui\_Anis](https://community.smartthings.com/u/Nagui_Anis)\
**Post date:** [March 8, 2015, 7:44pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/19 "2015-03-08T19:44:35Z")

</div>

I always get this error:  
9:42:34 PM:error groovy.lang.MissingMethodException: No signature of  
method: static java.lang.Integer.toString() is applicable for argument  
types: (java.lang.String) values: [3570]  
Possible solutions: toString(), toString(), toString(), toString(int), toString(int, int), toHexString(int) @ line 359

---

<div class="post-metadata">

**Author:** ![mcvoss](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mcvoss](https://community.smartthings.com/u/mcvoss)\
**Post date:** [March 8, 2015, 8:25pm UTC](https://community.smartthings.com/t/depricated-lock-code-manager/12280/20 "2015-03-08T20:25:00Z")

</div>

Unfortunately it doesn’t appear to work with Schlage FE zwave locks. I didn’t try it on my Schlage deadbolt, BE series, because I am using a modified device type.

Michael

[Next page](https://community.smartthings.com/t/depricated-lock-code-manager/12280.md?page=2)
