[Depricated] Lock Code Manager

I’m experiencing an issue now when I try to update/change codes. Here is the error I’m getting from the logger:

error java.lang.NullPointerException: Cannot invoke method toInteger() on null object @ line 812

Any idea what I’m doing wrong?

Looks like you have a user in your users array that you haven’t initiated yet. Click all your users in the user settings page and make sure it saves each user settings variables. If you have more users in that page than you need, set your users number to what you’ll actually use.

This is a user solution to the problem, but I should be able to write a code solution soon. It seems that people are entering in more users than they actually intend to use, something I haven’t accounted for in the app.

I uninstalled and reinstalled the app, set the number of users as “2”, and then set both codes, but when I try to go back in to the user settings, I get the same error. Here is what is being reported in the app’s log:

1:33:35 PM: debug sendCodes fix is: [[“code1”,“1234”],[“code2”,“5678”]] Error: 1/10
1:32:49 PM: debug sendCodes fix is: [[“code1”,“1234”],[“code2”,“5678”]] Error: 1/10
1:32:47 PM: debug sendCodes fix is: [[“code1”,“1234”],[“code2”,“5678”]] Error: 1/10
1:32:04 PM: debug state: [lastUser:2, userState2:[enabled:true, usage:0], userState1:[enabled:true, usage:0], lock3:[error_loop:false], lock2:[error_loop:false], lock1:[error_loop:false], error_loop_count:0]
1:32:03 PM: debug Updating ‘Locks’ with settings: [locks:[Back Door Schlage Z-Wave Lock, Front Door Schlage Z-Wave Lock, Laundry/Garage Schlage Keypad Handle], burnCode2:false, userHomePhrases2:[I’m Back!], userCode2:5678, userEnabled1:true, userSlot2:2, userNoRunPresence1:[Ryan’s Droid Turbo, Ryan’s Virtual Presence Sensor, Stephanie’s Note 4, Stephanie’s Virtual Presence Sensor], userCode1:1234, userEnabled2:true, manualUnlock:false, noRunPresence:[Ryan’s Droid Turbo, Ryan’s Virtual Presence Sensor, Stephanie’s Note 4, Stephanie’s Virtual Presence Sensor], userSlot1:1, userNoRunPresence2:[Ryan’s Droid Turbo, Ryan’s Virtual Presence Sensor, Stephanie’s Note 4, Stephanie’s Virtual Presence Sensor], userHomePhrases1:[I’m Back!], burnCode1:false, userName2:Temporary Access, userName1:Main, maxUsers:2, homePhrases:[I’m Back!]]
1:29:41 PM: debug state: [error_loop_count:0, lock1:[error_loop:false], lock2:[error_loop:false], lock3:[error_loop:false]]
1:29:41 PM: debug Installing ‘Locks’ with settings: [locks:[Back Door Schlage Z-Wave Lock, Front Door Schlage Z-Wave Lock, Laundry/Garage Schlage Keypad Handle]]

Those logs look fine. Does it continue to loop like that for awhile before setting the codes?

If it continues until reaching 10, It could be possible that you have those codes on other slots, and the locks can’t accept the codes in slot1 or slot2 because they exist in other slots already. That error loop is something I wrote to prevent invalid codes to plague your lock with poll events.

I’m planning on making a discover section of the app… but until then…

set your users to 30… then:
painstakingly click each one, leaving the user disabled but part of the app. After you’re done… you should have 30 users, all disabled. click done and let the app delete all of the codes on your locks.

wait about 5-10 minutes… might be longer/shorter depending on your network

After this is done, return the number of users to just 2 and set the codes that you actually want.

Well, that didn’t work either. Ultimately, I had to uninstall the app, manually clear all the codes at each lock, and then reinstalled the app, but it does seem to be working correctly now. I can enable and disable the Temporary Access code, and it only takes a minute or so to update the locks. But it is a good note to only set the number of users to the total number of user codes you plan to use.

I’ve been playing around with @garyd9 custom user device type that he updated yesterday with your device type code. It works beautifully with your Lock Code Manager app, and allows for even more control of the device! It allows me to toggle between the four different alarm modes (off, entry alert, tamper, and forced entry), adjust the sensitivity of the alarm for each mode, toggle the 30-second auto-lock feature on and off, and toggle the lock & leave feature on and off. I would HIGHLY recommend this version of the device type for anyone using a Schlage BE468 or BE469 touchscreen deadbolt. My poor, old FE599 handle doesn’t have a built-in alarm, so I simply left it with your customized device type instead.

Now all we need is to find out if there is a way to have the lock alarms trigger the Fortrezz Siren Strobe alarm (or possibly the other way around, or, even better, both!), and I feel like the Smart Alarm app from @geko would be the perfect place to have this implemented. @tslagle13 helped Rboy to track down the “alarm event” in his code, and hopefully he wouldn’t mind helping out again. I’ll toss this over to them, and cross my fingers that this is something that can be included in a future release of Smart Alarm!

Well, I’m still having issues with being unable to go back in and enable/disable lock codes. I still have the number of users set for 2, the main unlock code enabled, and (currently) the temporary access code disabled. I haven’t added, removed, or changed the total number of users whatsoever since clearing the locks manually and reinstalling the app. Whenever I go to the user settings and select either the main or temporary access codes, I get the “sorry, but there was an unexpected error” message. Any ideas what might be going on?

If memory serves, I lost access to the main code right off the bat (no schedules set, but it is set not to run when one of four devices is present), but I did have access to the temporary access code UNTIL I added the setting not to run when the devices are present. Could there be an error in this feature?

I answered my own question. There IS an error with setting up the “Don’t Run If These People are Present” function under the specific user settings. It causes the app to lock up when trying to go back in and adjust the settings to any user that has been enabled with these settings.

I had to uninstall the app, reinstall it, and resetup the two user codes WITHOUT this setting. However, the “Don’t Run” function does seem to be working in the Global Hello Home settings, so it isn’t that big of a deal for me, but I can see how it might be for some people. Just wanted to let you know that I identified the error.

Schlage Connect Touchscreen Deadbolt with Alarm can use codes which are 4 digits or 8 digits but not a combination of both.

1 Like

I have a schlage century lock and I get errors when trying to add the smart app. In the app instructions it says that I should copy the code from the .groovy file, however, there are two of these files, the “zwave-lock.groovy”. I tried to install the zwave since my device has this radio, but I get this message: “org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
script14353666656871230277593.groovy: 279: expecting EOF, found ‘,’ @ line 279, column 135.
$cmd.alarmLevel is duplicate”, isStateC
^"

I am not a coder, so I have little tools to fix this for myself. Help please.

1 error

See if this helps any:

Ethan,

I have a Scalage in a vacation apartment. I loaded the app (admittidly with some help). I didn’t want to start programming using the app until I was “with the lock” in the case something went wrong. I drove the 2 hours to do it yesterday. The difficulty is that there really are no “instructions” Like, should I first manually delete all the numbers that I previously programmed? If I add new codes will the over write the code in that slot. Once I add all the codes into the app what is the process to ensure the lock has the command. Do I refresh?

I did my best with no instruction but there was no sure fire way to tell what the app was doing. No newly entered codes (using the app as the code entry mode) worked. Most of the previously entered codes continued to work and at least 1, mine, was corrupted.

I abandoned the the app and programed the lock per Scalage programming instruction.

What is the suggestion to help please. I so love what this is designed to do, a great solution.

Karen

Greetings Karen,

The reason I recommend deleting all of your codes to start off, is that a lot of people don’t know what codes are assigned to which slots. You might know that code 1234 is assigned to the lock, but not to which slot… which might be a problem for users when they start using the lock.

There are some rules to codes that we have discovered along the way, for instance there are some validation rules which follow that no two slots can have the same code, and the algorithm for ‘same code’ can sometimes be flawed… for instance, the code: 1234 is effectively the same as 2143, because on some locks [1,2] and [3,4] share one key respectively. Even for locks that have separate keys for all numbers, still have the same validation rules. Probably from a result of the lock manufacturers using one code base for handling the lock behaviors across all of their locks.

Your particular lock only supports 4 digit codes. Remember to use only 4 digit codes.

If you’re not already using the custom device type, please install it and use it along side this app. The reliability of the functions in the app is pretty much 10% reliability to 100% reliability while using the custom device type in my experience… as long as there are no user errors like the validation issues above.

I’m not sure what pain points you are having while using the app, so it’s hard for me to dive in and give you pointers. Being born in the late 80’s, I’ve been around computers all of my life, and the user interface of smart things is often self explanatory to me… which makes it hard for me to give instruction.

Maybe start by answering these questions:

  1. Why do you want to use this app? What problem are you trying to solve?
  2. What are the steps you’ve taken so far, from start to finish? this may include information like:
    a. What have you tried, that you’ve expected to work, but have not?
    b. Did you install my custom device handler?
    c. While not giving specific codes per se, what codes have you tried to program? How many of them?

Erik,

Hi - I want to use this app to remotely control the codes on a lock for a vacation rental. I hope to add and delete codes based on the rental needs without having to be co-located with the lock as I live 2 hours away from the location.

About a month ago I got some help from one of the ST help staff to load your code.

This past weekend I went down to try and test the app. I opened the app and connected my lock to it and went about programing. At that point I didn’t realize I should have manually (using my programming code on the lock) deleted the old codes, however I did notate what codes were set at each slot when I set up the first set of codes and I re-entered in the same order. New codes, entered from the app, were not recognized when I tried them and my code, which was entered in slot 3 the first time and the second time, stopped working.

I selected 16 users and under user settings, I set about naming and adding the new codes. When I tried to check the entry, new codes didn’t work and my codes stopped working. At that point I de-selected the lock on the app and deleted and added the new codes manually.

I do not know if I have the “custom device handler” installed.
I do not have any codes using the same 4 numbers in different order.

Thank you so much!

This is a great app. Thanks @ethayer for making my Yale lock more useful.

I had a related question.

What are the events Zwave locks report? Do they include wrong pin entry, lockout and so on?

Is there a way to have the app tell me when the door is locked?

Erik,

Not sure you saw my response, I don’t see it in the thread.

Why do you want to use this app? What problem are you trying to solve?
I want to use the app to remotely (2 hours from the lock) add and delete codes for a vacation rental.

What are the steps you’ve taken so far, from start to finish? this may include information like:
a. What have you tried, that you’ve expected to work, but have not?
b. Did you install my custom device handler?
c. While not giving specific codes per se, what codes have you tried to program? How many of them?

I installed the app on my phone. Tried to enter/reenter the codes that were manually added to the lock on the app. Some worked some didn’t.
I don’t know about "custom device handler"
I tried to enter ~16 codes, the two factory set code, one for me and one for my partner, the cleaner and the rest would have been upcoming renters (weekly).

Still holding out hope I can get this to work…

Thanks!!!

I’m sorry for being slow to respond! It’s pretty important that you use the custom device driver. It will make the app a lot more dependable.

Install that in your custom device here:

Add Device Driver:

  1. Navigate to: 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: https://raw.githubusercontent.com/ethayer/user-lock-manager/master/zwave-lock.groovy
  5. Click ‘Create’
  6. Click ‘Save’
  7. Click ‘Publish’ > ‘For Me’

Change lock device driver to new code:

  1. Navigate to ‘My Devices’: 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’
  5. Click ‘Update’ to save changes

After completing these steps, try to use the app again.

Since you don’t know what codes are in what slots, set all codes in the app first, and then set them all to DISABLED. Click save on the app and then let the app delete all the codes.

After the codes are all deleted, set all the codes to ENABLED and let the app program the lock(s).

Remember the rule that there are only really 5 unique keys. [1,2][3,4][5,6][7,8][9,0]

Allow 5 - 10 minutes for the app to delete the codes, and another 5-10 minutes for the app to program the codes into the lock.

Hope this helps.

Best,
Erik

1 Like

@Ben, @April

Is there any chance to include my custom report hook into the official SmartThings device type (or an event hook that is similar to the hook I provide)?

https://github.com/ethayer/user-lock-manager/commit/17b9922c06d04394369c700de743d7bf7c575623#diff-073bfcb72eac3bd38d2c060c4998e299R678

This simple change would allow me to drop the requirement for a custom device driver and allow me to submit the app to ST to be offered as an app proper. I think the community would appreciate this being an official SmartThings offering.

4 Likes

@Tyler how do we get this considered?

2 Likes

I have a similar request… ie, a SmartApp or two, but that should be simultaneously submitted / accepted with a Device Type Handler update.

I guess in many cases the Device Type Handler update could be submitted first as a prerequisite. But Device Types must be a bit harder to get certified. Ideally I’d start with just an incremental change to the existing Type, to help ensure approval.

Overall point… Device Type Handler approval is nearly as important as SmartApp approvals.

And… Ideally there should be a mechanism for Customers to select from a (short) list of multiple choices of Certified Handlers once a signature matches… @Tyler?

1 Like