Schlage Connect Smart Deadbolt (ZigBee): anyone have any luck getting user codes to work?

I am trying to figure out a way to set and get user codes for Schlage locks.
I am using the Conbee II in ZHA.

From what I can tell, this feature may not be directly available in ZHA, as there is a feature request for user codes:

And there appears to be no code in the associated code:

I was playing around with “Manage Clusters” in the “Devices” tab for the lock, and I can find Cluster Commands to send and get lock codes in the Cluster
DoorLock (Endpoint id: 1, Id: 0x0101, Type: in)
For some reason comes to get or send codes do not work, however, I can use the cluster commands here to lock or unlock the deadbolt.
I also get a response when I select “Get Zigbee Attribute” under “Cluster Attributes”.

I suspect there is a way to get the data I am looking for, I just don’t know where to go next. I’m also wondering if this would be easier to figure out using Zigbee2MQTT?

Any help would be appreciated.

P.S. This is my first topic, so please let me know if I am posting this in the wrong place or doing something else wrong.

So I was able to receive the user code in a bit of a backwards way (I am assuming setting user codes will work in the same way if I can figure out the data to pass as args). I found the following link to zigbee cluster commands when I was reading the documentation on zigbee2mqtt:


line 10192 has the cluster commands needed to get pin codes

Under “Developer Tools”, “Services”, I selected:

zha.issue_zigbee_cluster_command

and then I issued the following command:

ieee: '00:00:00:00:00:00:00:00'
endpoint_id: 1
cluster_id: 257
cluster_type: in
command: 6
command_type: server
args:
  - 1

(device ieee changed to sanitize command)

unfortunately I did not get a response in the “Developer Tools”, “Events” tab when listening to *

I went to “Configuration”, “Integrations”, under ZHA I went to “Configure”, clicked the plus button in the bottom right, and then clicked “Show Logs”. I saw the following response:

Issued command for: cluster_id: [257] cluster_type: [in] endpoint_id: [1] command: [6] command_type: [server] args: [1] manufacturer: [None] response: [1, <UserStatus.Enabled: 1>, <UserType.Unrestricted: 0>, '1234']

Where “1234” is the lock code (sanitized).

My current problem is I don’t know how to find that response in a usable place in home assistant. Anyone have any ideas?

EDIT:
I turned on debug and found the following in my logs (only when I am trying to add zigbee devices):

2020-10-10 11:24:08 DEBUG (MainThread) [homeassistant.components.zha.api] Issued command for: cluster_id: [257] cluster_type: [in] endpoint_id: [1] command: [6] command_type: [server] args: [1] manufacturer: [None] response: [1, <UserStatus.Enabled: 1>, <UserType.Unrestricted: 0>, '1234']

(where 1234 is the correct sanitized code)

anyone know where I can find or access homeassistant.components.zha.api and if it is possible to access the response from there in home assistant?

I was able to successfully set a user code in “Developer Tools”, “Services”:

zha.issue_zigbee_cluster_command

with the following:

ieee: '00:00:00:00:00:00:00:00'
endpoint_id: 1
cluster_id: 257
cluster_type: in
command: 5
command_type: server
args: 
  - 3
  - 1
  - 0
  - 1234

Where the args are:
the user id (3 sets the code for the 4th user)
the user status (0 = available; 1 = occupied/enabled; 3 = occupied/disabled)
the user type (0 = Unrestricted User, 1 = Year day schedule user; 2 = Week Day Schedule User; 3 = Master User; 4 = Non Access User)
the pin (1234, or any other 4 digit number)

I suspect this would work for other zigbee locks as it is using the cluster commands.

I still have not figured out how to read the pin codes when I request them from the lock, but if I could figure that out, I could probably get everything working in some form…

This is great commentary and will prove to be helpful when I start tinkering.

I’m about to order a Schlage Connect but have a couple questions for you. Are you getting proper lock/unlock control? Has the status updated properly as well?

I am getting proper lock and unlock control. it works with both ZHA and Zigbee2mqtt (though its been working better with the ZHA integration). The battery updates have been working with ZHA as well.

I’m using them with the Conbee II stick if that helps at all.

I’m planning on doing some sort of code management automation at some point, I just havent gotten time yet.

1 Like

Trying to test this out on my yale lock, but where did you get the following parts from?

endpoint_id:
cluster_id:
command:

I used 2 things.
First, I used page 459 of this document for the command and the arguments:


the document probably has the rest of the information, but I found it a different way.

To get the rest of the information:

  1. You will need to have access to the “Developer Tools” (I think you get this by clicking on your name at the bottom left of the home assistant menu bar, and then toggling “Advanced Mode” to on).
  2. You will need to open 2 home assistant windows
  3. In Window 1: Developer Tools --> Events. Under “Listen to events” type * in “Event to subscribe to” then click “START LISTENING”
  4. In window 2: Configuration --> Devices --> (Select your Lock).
  5. Under “Device Info” select “Manage Clusters”.
  6. In the “Clusters” drop down select “DoorLock (Endpoint id: 1, Id: 0x0101, Type: in)”.
  7. In the “Commands of the selected cluster” select the command you want. For example try “set_pin_code (id: 0x0005)” (the command will fail due to no arguments, but will still show up in the events)
  8. Look in window 1 for the ZigBee event

the above should work assuming you are using ZHA and your lock is using the normal zigbee DoorLock.

Let me know if that works

1 Like

@cdevl thanks for the documentation links and success stories using the clusters page, it was enough to motivate me to write something.
This is only tested on Kwikset so far, and still needs documentation and test cases, but it’s nearly done.

3 Likes

This is so awesome. Thank you so much!

FYI It appears this has been merged but I am still not getting zha_event in my logs and I don’t know why

Early versions of the Schlage Connect zwave locks were notorious for not sending notifications back to the hub when unlocked/locked. It doesn’t surprise me this is a problem for Zigbee too. My only recommendation would be to somehow try to get an updated zigbee module and hope it works better…