[Depricated] Lock Code Manager

I don’t believe this to be a solution. The way that the params are passed into the page is {params:{number:n}}, not {params:{params:{number:n}}}, which is what you’re suggesting.

Unless Android indeed has this error, and is throwing params in another params object. Why would it be doing that?
I also have never seen the User 3 repeat across settings…

I’ll look into this on my android phone when I have the time.

I uninstalled copied the code from Git and went to re-install, this is a screenshot of the Users page.

I also added “log.debug params” to line 68 right under “def userPage(params) {” which resulted in:

{“nextPage”:“userPage”,“settings”:{“maxUsers”:{“name”:“maxUsers”,“value”:“3”,“type”:“number”}},“state”:“INCOMPLETE”,“label”:“Tap to set”,“params”:{“number”:3}}

Also, I reviewed your code history, this has to be an issue with the latest Android client since I know I was using the 3.3 version prior to the Android upgrade. Hopefully you are able to reproduce this…

I will try from some other devices this evening.

They must have changed the way parameters are sent to dynamic pages in the last update. Seems like I’ll have to make a function to check what the params object looks like before assigning values since the android version now works differently than the iPhone version (until Samsung *cough*… I mean ST releases the update for iPhone)

Thanks for your insight on this.

1 Like

The same params object on L68 iOS is:
[id:ID_REMOVED, name:userPage, number:1]

Wow, okay I will confirm this on another Android tonight and I have an iPad I can attempt from. If confirmed I will submit a ticket to the ST devs.

Though with the API being so dynamic I am not sure if this will fall under silent deprecation or bug. Personally, I believe the way you were doing this was very clean and should be mirrored by others. Even with the parameters passing correctly the menu was not drawing properly so I am pretty confident this is a bug.

Confirmed. There is a major difference in the way “params” is passed in the newest Android SmartThings app compared the to way the iOS app is currently handling this. I will submit a ticket. Again, not sure if this is intentional or not but this would have the potential to break a lot of more advanced SmartApps.

I have verified on Android 4.4.4 and 5.1 against iOS.

1 Like

@ethayer take a look at this thread: Android App (1.7)

Looks like the params issue is corrected but I am still having issues with the dynamic drawn menus.

@ethayer

Just put in a pull request on git that resolves this issue. I have detailed it on the “Android App (1.7)” thread and given a brief synopsis on the pull request. Have a great weekend, and thank you for this great application!

Help me. I am not a programmer and I am new to home automation. I am building a home and trying to decide which hub to use. My most important aspect I want control over is my locks. My doors will have 2 Schlage Camelot keyless locks. These are the only ones with ANSI 1 security ratings–they can’t be picked. (I have to have 1 up high on the door so really little kids don’t get out and drown in the river, but I need one low so bigger kids can reach it to enter the house by typing the code). I need the upper lock to unlock when the lower lock key code is entered from the outside, but I don’t want it to unlock when it is manually opened from inside.

from reading this thread it looks like that probably isn’t possible, am I right?

Is my first wish possible, though?: automatically unlock upper lock when lower lock is opened by keycode?

And is my second wish possible? that this chain of events only happens when the lower lock is opened by keycode from outside (In other words, if a little kid turns the deadbolt inside, the upper lock remains locked?)

And this brings me to another question:

Can this app or anywhere in smartthings tell all my house locks to unlock in the case of the fire alarm going off, if it is an integrated smart fire alarm, of course.??

And finally, this all sounds very technical and I am wondering if I will have to do programming to get what I want. I have never programmed and I might be capable of learning and copying and pasting, but I don’t have much time for that right now. So I am wondering even if some of these things are possible, how difficult will they be to manage for the average iphone user like me?

Lots of questions, sorry!

Use Cases:

  1. Automatically unlock upper lock when lower lock is opened by keycode? - Yes this can be automated by either coding it yourself to subscribe to the door’s unlock event and fire the unlock event on another lock, or you could use something like: Simplerulebuilder - now private to generate a rule.

  2. that this chain of events only happens when the lower lock is opened by keycode from outside - Yes, that should be possible though you may need to alter the Lock Code Manager code to do this rather than using the rules engine simply because you are listening for specific codes/users to unlock.

  3. Can this app or anywhere in smartthings tell all my house locks to unlock in the case of the fire alarm going off, if it is an integrated smart fire alarm, of course. - SmartAlarm can do this.

I am not going to try to sway you in any Hub direction, I came from HomeSeer which is not a route I would recommend any longer. Personally I love my ST hub because I am a tinkerer and enjoy the ability to create anything I can imagine. The code structure is easy to learn and manipulate and all device types/smart apps are editable.

I would say the major pitfalls I have seen is cloud performance, and documentation. By cloud performance I specifically mean the delays that have occurred on and off over the past few weeks where it may take a few seconds or minutes for a command to process but I believe these are being addressed. Documentation for programming is done but there are many advanced features available that are not documented properly yet.

If you do go the ST route and need some help coding, just reach out, will work for beer if you want me to code it up for you :stuck_out_tongue:

Or there are plenty of people here including myself that will step you through coding it yourself.

Lock Code Manager should be able to do this without any need to do additional coding.

Just use a single install for the app that runs a Hello Home action when the code is entered. Create a Hello Home action that unlocks the desired lock - presto.

1 Like

Looks good, Just have to test it on my two phones and then I’ll click the button.

I’ve just successfully installed this app and look forward to playing around with it over the weekend. I don’t quite understand how to take advantage of the zwave-lock.groovy code though. You mention that it’s not required but reliability is a lot better with it…can you please explain how to install/use this additional piece? Thanks!

The step process is a lot like what you did to install the app, except you have to change the device type the locks are using from the ‘My Device’ menu within the IDE. Follow the steps bellow.

Add the SmartDevice

  1. Navigate to https://graph.api.smartthings.com/ide/devices.
  2. Click on the green ‘New SmartDevice’ button.
  3. Click on the tab that says ‘From Template’.
  4. Delete anything that’s currently in that window and replace it with the code from github.
  5. Click ‘create’.
  6. Click ‘Publish’ > ‘For me’.

Activate the SmartDevice for all locks

  1. Click ‘My Devices’ from the IDE main menu: https://graph.api.smartthings.com/
  2. Look for your lock in the list. By the name you gave it, or the device type ‘Zwave Lock’.
  3. Click on the link in the ‘Device Name’ column.
  4. On the next screen, click ‘Edit’
  5. Within the ‘Type’ dropdown, scroll to the bottom of the list and select ‘Zwave Lock Reporting’.
  6. Click ‘Update’.
    a. Repeat these steps for each lock until all locks are on the custom device type.

This will ensure that the app is able to make sure that the codes are set sucessfully. Without the custom device type, the app isn’t able to do any error checking.

-Enjoy

2 Likes

I’m having a strange issue. Just copied the code from git, installed the app, setup the locks. I set the number if users to 2. When trying to click each individual user, it just shows a spinner then the spinner goes away and im still sitting on the same page. I’ve tried reinstalling, copying the app, logging out, etc.

Any troubleshooting ideas?

I just looped through the code a bit and noticed a weird bug -

def userPage(params) {
dynamicPage(name:"setupPage", title:"User Settings") {

This currently just sends the user back to the setupPage. I changed “setupPage” to “userPage” and the bug disappeared.

Thoughts?

I have just installed the app also - I get the same issue as idealerror:

the users are inaccessable

I am unable to setup any user, and also not able to see any codes on my 910. It does however, unlock and lock from the app setup webpage when testing

Make the code change like I mentioned and save/publish for yourself.

Works fine after that small change.

Did not work for me…

I got the following error in the logs:
‎2‎:‎06‎:‎38‎ ‎PM: error java.lang.RuntimeException: Metadata Error: Missing required page parameter ‘name’

FYI: I changed the entry in Line 54
Maybe there is more than one change??

Thanks