[OBSOLETE] Lock User Management (LUM)

I am perhaps being thick, but I can’t figure out how to get this code to run. I have created the smartapp based on both the code in this thread and the shared smartapp. Once published, I can get the setup screen that creates a specific smartapp with a specified slot # to add/update or delete, but nowhere do I see where or how codes get set or viewed. Can someone help me figure out what dumb thing I’m doing? I’ve tried playing with it in the IDE and both iOS and Android… sadly at a loss.

They are two separate apps @oilerfan21. The one you are using that’s published here only allows you to set and delete codes not view them (no memory). The app on the server (paid access) has a memory. Read the description in the first post for details

Thanks for responding.

I’ve seen that and I really don’t need the extra functionality. I’m still getting my head wrapped around how this all works in the weeds of it and I’m sure I’m just doing something stupid, but I’m not seeing any of the code in the source actually execute. Once published, I can see that app in the My Apps list. I click on that app and I can set it up to add a named smartapp tile that allows me to add/update or delete, but once that tile is created, I get nothing out of it in Android and iOS gives me an error message, “you are not authorized to perform the requested operation”

Are you getting the same error when using any other apps or just this app?
Two other users had the same problem. One was isolated to an issue with his hub (he tried changing which messed up something, he reset and started over to fix it).

Can you post the output you see for the app when trying to configure it as it logs from your live debugger

This is the only app that I’ve had any problems with, although I’m not doing much that’s very advanced. I can see how helpful the live logging could be when trying to work with this stuff, so that’s cool.

I’ve got 2 locks selected as I go through the configuration and in the live log I get:

4:29:42 PM: error java.lang.NullPointerException

The first time I saw that it actually pointed to line 73, although I don’t see that anymore for some reason. I do get a poll of one of the locks about 20 seconds after the error like this:

debug poll is sending [], state: [‘code22’:’’, ‘code21’:’’, ‘code24’:’’, ‘code23’:’’, ‘fw’:‘3.37’, ‘code20’:’’, ‘lastbatt’:1425852558068, ‘code29’:’’, ‘code25’:’’, ‘code26’:’’, ‘code27’:’’, ‘MSR’:‘0090-0001-0001’, ‘lastPoll’:1425851953341, ‘code28’:’’, ‘code13’:’’, ‘code12’:’’, ‘code11’:’’, ‘assoc’:1, ‘code10’:’’, ‘code9’:’’, ‘code6’:’’, ‘code5’:’’, ‘sec’:‘72 86 98 80 85 70 75 62 63 4E 4C 71 8B 20 5D ‘, ‘code8’:’’, ‘code7’:’’, ‘code2’:‘’, ‘code1’:'’, ‘codes’:30, ‘code30’:’’, ‘code4’:’’, ‘code18’:’’, ‘code3’:’’, ‘code19’:’’, ‘code16’:’’, ‘code17’:’’, ‘code14’:’’, ‘code15’:’’]

I’ll post more information shortly. I’ve come across a couple of interesting bits that may be important. I’m getting different results going through it on my iPad and my android phone. Much more logging appears with the android device and part of it might be the device type for one of my locks. I have a kwikset 910 and 914 and the 910 is using the custom lock device type. It appears to be choking on the setcode command. Even without that lock selected though, I have some null pointer errors.

I’ve now got both locks using the ‘zwave lock’ device type and I’ve done tests to both locks from both iOS and Android. The only meaningful logs come going through it on the Android device. the iPad logs are generic nullpointer errors and they happen as soon as ‘add user/update’ is selected. Android lets you complete all fields and at ‘done’ give the errors. Here are the relevant logs:

Back Door Slot 8

fa078ea3-a89e-4bfc-9f70-e3b2b05ea625 10:16:08 PM: debug "zw device: 04, command: 9881, payload: 00 80 03 5A " parsed to [‘name’:‘battery’, ‘unit’:’%’, ‘value’:90, ‘isStateChange’:true, ‘displayed’:true, ‘linkText’:‘Back Door’, ‘descriptionText’:Back Door battery is 90%]
fa078ea3-a89e-4bfc-9f70-e3b2b05ea625 10:16:04 PM: debug poll is sending [‘9881008002’, ‘delay 6000’], state: [‘code22’:’’, ‘code21’:’’, ‘code24’:’’, ‘code23’:’’, ‘fw’:‘3.37’, ‘code20’:’’, ‘lastbatt’:1409394678953, ‘code29’:’’, ‘code25’:’’, ‘code26’:’’, ‘code27’:’’, ‘lastPoll’:1425874159192, ‘MSR’:‘0090-0001-0001’, ‘code28’:’’, ‘code13’:’’, ‘code12’:’’, ‘code11’:’’, ‘assoc’:1, ‘code10’:’’, ‘code9’:’’, ‘code6’:’’, ‘code5’:’’, ‘sec’:‘72 86 98 80 85 70 75 62 63 4E 4C 71 8B 20 5D ‘, ‘code8’:’’, ‘code7’:’’, ‘code2’:‘’, ‘code1’:'’, ‘codes’:30, ‘code4’:’’, ‘code18’:’’, ‘code30’:’’, ‘code3’:’’, ‘code19’:’’, ‘code16’:’’, ‘code17’:’’, ‘code14’:’’, ‘code15’:’’]
25355877-445b-419d-ba35-b7c11a909cfd 10:16:03 PM: error java.lang.NullPointerException
25355877-445b-419d-ba35-b7c11a909cfd 10:15:58 PM: error java.lang.NullPointerException
25355877-445b-419d-ba35-b7c11a909cfd 10:15:37 PM: info Back Door added user: 8, code: null
fa078ea3-a89e-4bfc-9f70-e3b2b05ea625 10:15:37 PM: error java.lang.NullPointerException: Cannot invoke method size() on null object @ line 524
fa078ea3-a89e-4bfc-9f70-e3b2b05ea625 10:15:37 PM: debug setting code 8 to null
25355877-445b-419d-ba35-b7c11a909cfd 10:15:36 PM: trace Scheduling ‘expireCodeCheck’ for InstalledSmartApp: 25355877-445b-419d-ba35-b7c11a909cfd
25355877-445b-419d-ba35-b7c11a909cfd 10:15:35 PM: trace Deleting all scheduled jobs for InstalledSmartApp: 25355877-445b-419d-ba35-b7c11a909cfd
25355877-445b-419d-ba35-b7c11a909cfd 10:15:35 PM: debug Update Settings: [user:8, action:Add/Update, locks:[Back Door]]
25355877-445b-419d-ba35-b7c11a909cfd 10:15:34 PM: trace Scheduling ‘expireCodeCheck’ for InstalledSmartApp: 25355877-445b-419d-ba35-b7c11a909cfd
25355877-445b-419d-ba35-b7c11a909cfd 10:15:34 PM: trace Deleting all scheduled jobs for InstalledSmartApp: 25355877-445b-419d-ba35-b7c11a909cfd
25355877-445b-419d-ba35-b7c11a909cfd 10:15:34 PM: debug Install Settings: [user:8, action:Add/Update, locks:[Back Door]]

Front Door - slot 9

639d4a71-16ae-48b4-bc32-99f4ef9877a2 10:20:03 PM: error java.lang.NullPointerException
639d4a71-16ae-48b4-bc32-99f4ef9877a2 10:20:00 PM: error java.lang.NullPointerException
639d4a71-16ae-48b4-bc32-99f4ef9877a2 10:19:45 PM: info Front Door Lock added user: 9, code: null
da0bf4e4-1116-497b-82d0-3f8e82ab0fad 10:19:45 PM: error java.lang.NullPointerException: Cannot invoke method size() on null object @ line 524
da0bf4e4-1116-497b-82d0-3f8e82ab0fad 10:19:45 PM: debug setting code 9 to null
639d4a71-16ae-48b4-bc32-99f4ef9877a2 10:19:44 PM: info Front Door Lock added user: 9, code: null
da0bf4e4-1116-497b-82d0-3f8e82ab0fad 10:19:44 PM: error java.lang.NullPointerException: Cannot invoke method size() on null object @ line 524
da0bf4e4-1116-497b-82d0-3f8e82ab0fad 10:19:44 PM: debug setting code 9 to null
639d4a71-16ae-48b4-bc32-99f4ef9877a2 10:19:44 PM: trace Scheduling ‘expireCodeCheck’ for InstalledSmartApp: 639d4a71-16ae-48b4-bc32-99f4ef9877a2
639d4a71-16ae-48b4-bc32-99f4ef9877a2 10:19:44 PM: trace Deleting all scheduled jobs for InstalledSmartApp: 639d4a71-16ae-48b4-bc32-99f4ef9877a2
639d4a71-16ae-48b4-bc32-99f4ef9877a2 10:19:44 PM: debug Update Settings: [user:9, action:Add/Update, locks:[Front Door Lock]]
639d4a71-16ae-48b4-bc32-99f4ef9877a2 10:19:43 PM: trace Scheduling ‘expireCodeCheck’ for InstalledSmartApp: 639d4a71-16ae-48b4-bc32-99f4ef9877a2
639d4a71-16ae-48b4-bc32-99f4ef9877a2 10:19:42 PM: trace Deleting all scheduled jobs for InstalledSmartApp: 639d4a71-16ae-48b4-bc32-99f4ef9877a2
639d4a71-16ae-48b4-bc32-99f4ef9877a2 10:19:42 PM: debug Install Settings: [user:9, action:Add/Update, locks:[Front Door Lock]]

@oilerfan21 if I look at the above logs it looks like debug code from the lock device type rather than the app. Reason I think so

  1. The first line (codes) are definitely device type log for the lock
  2. null pointer on line 524 - the smart app doesn’t have that many lines, so it’s probably device type

I’m trying to figure out whether it’s a device type issue or a smart app issue. In the live debugger on top it allows you to select the source of the live logs, can you please separate out the logs from the lock and the smart app and then post them both separately.That’ll help me get to the root of the null pointer. This is very helpful though.

Going back to the original issue, It also appears that you’re able to set the delete codes, so are you no longer facing the permission issue? If so, when does it happen and also you try to create another custom app (anything else doesn’t matter) and see if you’re able to install and use that one.

I’m wondering if these are 2 separate issues.

Okay another thing I noticed why you might be facing the null pointer exception, you’re Adding user 8 and NOT entering any code (null), so it’s setting code 8 to null is probably the cause of the null pointer exception. This is definitely from the lock, line 524 in the lock device type code is:

secureSequence([
zwave.userCodeV1.userCodeSet(userIdentifier:codeNumber, userIdStatus:1, user:code),
zwave.userCodeV1.userCodeGet(userIdentifier:codeNumber)
], 7000)

Which is the source of then null pointer - the non existent user code.

I’ll put a check for the user not entering any code when setting to add but essentially if you enter a code it’ll solve your issue.

This though is still different from the permission issue you originally reported. Are you still facing that, if so can you explain when/where and if you’re getting it with other custom apps also

Sorry… Just to keep communication in this thread and searchable, I’ve copied my email to you below. I can also confirm that I’m no longer getting the permission error.

earlier email reply:

Thanks again for taking the time to look at it.

Ultimately, the root problem likely is the fact that I never see the page or prompts to add a user code. This is most obvious in iOS when that program code, I think, is supposed to execute that the interface hangs. It’s as soon as I select add/update (which if I read the code correctly is when the new options ?page? should appear) that it becomes non-responsive. In Android it seems to wait until I’ve filled all the fields I can and selected ‘done’ with no indication that the if statement for add/update doesn’t run correctly when it should. I can filter the logs if that’s helpful, bit it’ll just be the null pointer errors without any good info. Also, I had a look at the zwave lock device type code and at line 520 appears to be the code set routine, so perhaps again just choking on the lack of a lock code to set.

Sorry, I read your note in email, not on the thread and didn’t realize you copied in that code, so you knew that already.

Just another little update…

I was just playing around with the code and I could get the user passcode information to show up on the screen without the if statement or to show up on a second page, but for some reason it looks like the refresh or dynamic portion of the page changing isn’t working. I think I can hack it together to work for me, but given my limited coding skills it’ll take some time. If nothing else, it’s a good way to learn how it all works.

Thanks for your time with it.

@RBoy . . . what is the UN and PW for the server http://smartthings.ramitbhalla.com/ so I can install the App?

Once I pay to get access, how do you install these? Can it be done on Apple Iphone too?

I’ve put an instructions file on the server which explains in detail how to install the apps and device types.
Also please read the functionality of each of the device types and apps before using them. There is a readme that explains that in detail as well.

I keep having codes missed when I send the update. Where in the code can I add more delay between code sends?

@enwewn not sure if I closed the loop on this with you, there is a call to startTimer with a timeout, you can change the value there (in seconds) to increase the delay.

I tried using the single user app. I am new at this. I cut and pasted your code into my smartapps and published. When I go into the smarthings app, the lock app appears twice. Anything I try and do results in a not authorized warning. I did some reading and set the home location, but I still cannot delete it, or do anything else with it. Any suggestions?

Try force deleting the SmartApp from the IDE and start over.

I’m not sure what a force delete is, but I did try deleting it from IDE and it tells me it is in use and cannot be deleted.