Zigbee Lock User Code addition

So the code I have has no issues deleting or setting codes. Also it pulls the user and pin length settings from attributes on the lock. The problem I have is how to retrieve a pin. I am not sure if there is something different I need to do to retrieve data from a command versus an attribute. I am executing

zigbee.command(CLUSTER_DOORLOCK, DOORLOCK_CMD_USER_CODE_GET, "${zigbee.convertToHexString(codeNumber.toInteger(),2)}00")

     trace parse() --- description: catchall: 0104 0101 01 01 0140 00 4554 00 00 0000 0B 01 0681
     cmds: [st cmd 0x4554 1 257 6 {0300}, delay 200]

where codeNumber is the user slot number. The response returned is the same for all users no matter if a PIN is set or not (only the last digit is a 0 if I send an invalid user format). Unfortunately that data does not contain the set PIN so I donā€™t know how to retrieve it. As I have never worked with groovy or ZigBee before Iā€™ve been fighting with a lot of trial and error.

Perhaps someone in the user community can point me to how to retrieve the data returned from a command.

1 Like

Itā€™s not uncommon for locks not to return pin code data due to security reasons. If you look at the z wave lock implementation youā€™ll notice the same thing.

Well that would make sense. Iā€™m trying my best to implement lock codes but as I donā€™t have documentation on that capability, Iā€™m just guessing the inputs and outputs of the commands.

I would guess requestCode should return a code, so that is what I was trying to implement. Do you then have the DTH encrypt and store the pins somehow or just return that the function is not available?

Unfortunately it appears that I canā€™t even run the command to tell if a PIN is set or not. That at least would be something.

Edit: Iā€™ve found that to get this to work an Attribute needs to be enabled. The Yale locks set this attribute to read only so it canā€™t be changed.

Actually what I would recommend to have a consistent performance across the DH types and compatibility with existing smart apps, copy the user Pin MGMT code from the z wave handler and just implement the pin code reporting configuration and pin code setting / deleting commands and you should be done. We have done this in our lab with @tpmanley help just havenā€™t finished it up yet but that would be simplest way forward with maximum reuse and compatibility.

Have you configured the lock reporting?

Depends on what needs to be reported. Iā€™ll take a look at the PIN management code.

Everything that needs to be reported is done automatically (no binding needed). You just have to know how to parse the responses. Iā€™ll work on that.

1 Like

Iā€™m hoping to have a mostly working version by next week at the latest. Is there someone who can test this with a kwikset ZigBee lock? I can PM them with the code when Iā€™m done.

I have finished my initial version of this DTH

Have you had any luck with your ZigBee DTH? @tpmanley @RBoy. This works for me but it is not perfect. Trying to make some enhancements and clean things up.

1 Like

Hey congrats and fabulous work, our DTH is still in progress, weā€™ve had to put it on backburner for a while due to other priorities but we want it get it done by EOY with additional features hopefully.

I just installed your DH on my zigbee Kwikset lock . It works great but there is one addition that I wish you could make. I noticed that my zwave lock reports user codes to CoRE but yours does not. The advantage is that i can program specific events in CoRE when a certain lock code is entered. As it is now with the zigbee lock I can only program events if that specific door is opened with anyoneā€™s code. I like the zigbee locks better because for some reason they work more consistently with my network.

I do report the user code used as based on specification but it may be different than what you are expecting. Could you show me the CoRE Piston you are using?

Well i never actually finished the piston because i stalled out when i got to the user screen and all that it had there was the ā€œnoneā€ option. I could back up and change to my zwave lock and i have a list of numbers on that page that i assume represent users even though the users and codes are not listed with the numbers. I never finished the piston with either one so it could be that neither one of them work. I started with
Basic Piston
Condition 1
Garage Man Door

Attribute
Lock

Comparison
Changes to

Value
Unlocked

Interaction
Any

By user code (s)
Tap to set

When i press tap to set here the screen has no numbers to select from but it does when I use the z wave lock. I am using lock manager from ethayer along with his DH for zwave and your for zigbee. Also with the interaction function i have tried all three options there.

Ok. Let me take a look at this. Iā€™ve never tried this functionality so Iā€™ll have to see how CoRE is setting the by user code. Iā€™m busy this upcoming week so I might not get to it immediately.

I do return when a code is used so it just has to do with how CoRE determines the list.

Ok, cool. No rush. In the mean time it will give me some time to play with some other ideas for automation. If i was a bit younger i might just start a business installing smart house technology.

FYI, i tested a simple core piston with the zwave lock last night and it worked like a charm. I will play with it more later to see if i can get the zigbee to play along.

Thanks for waiting. I should be available today to take a look at this. Iā€™ll let you know what I find.

Great, you can do a lot of cool things if you can pull out individual lock codes. I am still learning CoRE but it seems that you can do just about anything if you can figure out the weird way the logic works. I am used to PLC logic and CoRE works quite a bit differently. Thanks for looking at this.

@Bhaynes This should be fixed with the latest 1.5 release I just uploaded to GitHub. Let me know how it goes.

Wow, that was fast ! I will check it out later today.