Matter Door Lock in SmartThings App

Hi, @Andreas_Roedl
I replied to you in that thread to get more details, and we can continue there discussing this case.
Thanks!

2 Likes

How does that work?

Has the app presentation been updated to support the feature being added to the driver?

I didn’t find the option, where is it?


Sorry for the confusion, everyone. I asked for more info from the team, and they mentioned this feature wasn’t enabled for all devices; only those devices that support it would qualify, but it seems only one (certified) device does so far, but I don’t have information about which, sorry.

2 Likes

A “fingerprint” of a Yale lock was added with the quite large PR (#2144) for the schedule feature.

I just got a Yale Matter lock that I’m going to start testing with, the advice you provided does look helpful, so I’ll see what I can figure out and reply back here with any results.

Thanks for your help.

Since my earlier replies, several Yale locks have been explicitly added to the matter-lock driver. In the static fingerprints file, the following lock has been added:

 #Yale
  - id: "4125/33040"
    deviceLabel: Yale Lock with Matter
    vendorId: 0x101D
    productId: 0x8110
    deviceProfileName: lock-user-pin-schedule-battery

which profiles the following capabilities in that profile:

name: lock-user-pin-schedule-battery
components:
- id: main
  capabilities:
  - id: lock
    version: 1
    config:
      values:
      - key: "lock.value"
        enabledValues:
        - locked
        - unlocked
        - not fully locked
  - id: lockAlarm
    version: 1
  - id: remoteControlStatus
    version: 1
  - id: lockUsers
    version: 1
  - id: lockCredentials
    version: 1
  - id: lockSchedules
    version: 1
  - id: battery
    version: 1
  - id: firmwareUpdate
    version: 1
  - id: refresh
    version: 1
  categories:
  - name: SmartLock

Additionally, the following locks have been added to the new subdriver:

  {0x144F, 0x4002}, -- Yale, Linus Smart Lock L2
  {0x101D, 0x8110}, -- Yale, New Lock

Those locks will get a dynamically built profile based on the capabilities identified in the endpoints of the locks.

So, hopefully one of those is the lock you have. Good luck and let us know the results.

I’m not sure what to do here. The API doesn’t work. Is there a SmartThings expert who can tell us the status of the API to support Matter devices?

I have the ability to add users and credentials:

Capabilities:

────────────────────────
1 lock
2 lockAlarm
3 remoteControlStatus
4 lockUsers
5 lockCredentials
6 battery
7 firmwareUpdate
8 refresh
────────────────────────

So then I add a user:

? Enter capability index or id lockUsers

Commands:
───────────────────────────────────────
1 addUser(userName, userType<enum

  • adminMember
  • controlOnlyMember
  • guest>)

2 deleteAllUsers()

3 deleteUser(userIndex)
4 updateUser(userIndex, userName, userType<enum

  • adminMember
  • controlOnlyMember
  • guest>)
    ────────────────────────────────────────

addUser(“test_user”,”guest”)

The command is accepted, but the user is not added to the lock. Nor is there a way for me to see the user index, which is what I need in order to add a credential:

? Enter capability index or id lockCredentials

Commands:
────────────────────────────────────────────
1 updateCredential(userIndex, credentialIndex, credentialType<enum

  • pin>, credentialData)

2 deleteAllCredentials([credentialType<enum

  • pin
  • rfid
  • fingerprint
  • fingervein
  • face>])

3 addCredential(userIndex, userType<enum

  • adminMember
  • controlOnlyMember
  • guest>, credentialType<enum
  • pin>, credentialData)

4 deleteCredential(credentialIndex, credentialType<enum

  • pin
  • rfid
  • fingerprint
  • fingervein
  • face>)
    ───────────────────────────────────────

The addCredentials command requires a user index. There is no capability or command that exists that allows me to list users. The commands I issue from the CLI don’t do anything, but if I add a guest user via the ST app, it shows up in the user list.

This tells me that the published API does not match the commands the app is capable of executing. The API is not functional, as far as I can tell.

Who can I submit a request to in order to get a status of the API related to Matter devices? I assume the app is calling the API, so what unpublished commands exist that the app is using that I cannot access via the CLI?

Good night l am New here, what do u guys exactly discuss about here?

I find it helpful to use the Advanced Web App to issue the commands while having browser developer tools enabled. That allows you to see the syntax of the API calls that are being sent as well as the responses.

1 Like

I will give this a try to see if there’s a difference from that it’s doing and what I was sending.

One struggle I have is I’m not finding a way to validate a command via the API. We do subscribe to the events via the web hook, but sometimes we miss those.

With z-wave devices, the status would list out all slots on the lock, so that was the back-up method for verifying the credential was added. So far I’ve not gotten much from the API as far as a useful status showing users/credentials that was equivalent to the name/slot of z-wave devices.

I’ll continue to play with it, and see if I can get more info from the AWA. You suggest doing this and using the console in Chrome to see the API calls being issued? Is there a special option to enable or will it just show on the net tab?

Thanks,

Geoff

Developer tools in Chrome are on the Menu→More Tools menu or can be accessed via Ctrl-Shift-I. The Network tab will show you the HTTP requests and responses.

Here’s the breakdown of where I’m at with testing Matter door lock support in SmartThings:

  1. Matter locks are supported fairly well via the app itself using the “Manage Users” feature when viewing the device itself:
  2. Matter locks are not supported via the API (at least not in a usable state). See details below.

Here is the analysis I’ve been able to perform over the past week or so for you all to review.

Programming a code

The addUser and addCredential methods appear to work, but there is a lack of general support elsewhere which is required to use the methods.

addUser()

Capabilities:
────────────────────────
1 lock
2 lockAlarm
3 remoteControlStatus
4 lockUsers
5 lockCredentials
6 lockSchedules
7 battery
8 firmwareUpdate
9 refresh
────────────────────────

? Enter capability index or id lockUsers

Commands:
──────────────────────────────────────────
1 addUser(userName, userType<enum

  • adminMember
  • controlOnlyMember
  • guest>)
    2 deleteAllUsers()
    3 deleteUser(userIndex)
    4 updateUser(userIndex, userName, userType<enum
  • adminMember
  • controlOnlyMember
  • guest>)
    ──────────────────────────────────────

? Enter command addUser(“testcli6”,“guest”)
Command executed successfully

View mobile “Manage Users” to confirm guest added

Mobile app does not show the user was added:

Status API to confirm user was added:

Status API does not show all of the users from the app, but it does show our new user:

lockUsers users [
{
“userIndex”: 2,
“userType”: “adminMember”
},
{
“userIndex”: 3,
“userName”: “testcli6”,
“userType”: “guest”

}
]

Subscribe to web hook to confirm commands:

The web hook does not accept the lockUser and lockCredential capabilities, returning 422 errors when attempting to subscribe:

// Capability subscriptions
const allDefaultsCapabilitiesSubs = [
{
capability: 'lockCodes',
attribute: 'codeChanged',
subscriptionName: 'deviceCodeChanged',
},
{
capability: 'lock',
attribute: 'lock',
subscriptionName: 'lockChanged',
},
{
capability: 'lockUsers',
attribute: 'lockUser',
subscriptionName: 'lockUsersChanged',
},
{
capability: 'lockCredentials',
attribute: 'lockCredential',
subscriptionName: 'lockCredentialsChanged',
},
……

{
capability: 'temperatureMeasurement',
attribute: 'temperature',
subscriptionName: 'ambientTemperatureChanged',
},
];

Added a guest via “Manage Users”

When adding a guest via “Manage Users,” multiple guests appeared that weren’t showing before, but the user added via the CLI still doesn’t show.

Status API refresh shows additional users

After adding 1 guest “Testapp1” from the “Manage Users,” now the Status API shows multiple additional guests, none with names:

lockUsers users [
{
“userIndex”: 2,
“userType”: “adminMember”
},
{
“userIndex”: 3,
“userName”: “testcli6”,
“userType”: “guest”
},
{
“userIndex”: 4,
“userType”: “guest”
},
{
“userIndex”: 5,
“userType”: “guest”
}
]

addCredential()

? Enter capability index or id lockCredentials

Commands:
────────────────────────────────────────────────
1 updateCredential(userIndex, credentialIndex, credentialType<enum

  • pin>, credentialData)
    2 deleteAllCredentials([credentialType<enum
  • pin
  • rfid
  • fingerprint
  • fingervein
  • face>])
    3 addCredential(userIndex, userType<enum
  • adminMember
  • controlOnlyMember
  • guest>, credentialType<enum
  • pin>, credentialData)
    4 deleteCredential(credentialIndex, credentialType<enum
  • pin
  • rfid
  • fingerprint
  • fingervein
  • face>)
    ─────────────────────────────────────────────────

? Enter command addCredential(3,“guest”,“pin”,“0912”)
Command executed successfully

Added another guest to “Manage Users”

To see if you have to add a user via the “Manage Users” in order for the list to refresh, I added a second user:

Status API refresh

Shows an additional user was added, but there is no name affiliated

lockUsers users [
{
“userIndex”: 2,
“userType”: “adminMember”
},
{
“userIndex”: 3,
“userName”: “testcli6”,
“userType”: “guest”
},
{
“userIndex”: 5,
“userType”: “guest”
},
{
“userIndex”: 4,
“userType”: “guest”
},
{
“userIndex”: 6,
“userType”: “guest”
}
]

lockCredentials section shows credentials for every user, except for the user we added via the CLI:

lockCredentials credentials [
{
“credentialIndex”: 2,
“credentialType”: “pin”,
“userIndex”: 2
},
{
“credentialIndex”: 4,
“credentialType”: “pin”,
“userIndex”: 5
},
{
“credentialIndex”: 3,
“credentialType”: “pin”,
“userIndex”: 4
},
{
“credentialIndex”: 6,
“credentialType”: “pin”,
“userIndex”: 6
}
]

Test the door code for testcli6

Plugged in the code programmed via the CLI for testcli6, and the door unlocks. So even though there is no record in the Status API, there’s no record of the user in “Manage Users,” and no other way to confirm that anything worked, the code does work.

So unfortunately, while the bones are there, none of it actually works in a meaningful way that could be implemented.

@nayelyz - is it possible to get a status of where things are and a potential timeline for the web hook, status API and the app to all work correctly together?

Thanks for any information you or anyone else can provide.

Isn’t the attribute credentials?

Thanks for the tip, I’ll give it a try.

Hi, @gjanes
The plugin “Manage users” is relatively new, so we don’t know exactly the process it follows to create a user from there. Have you checked the driver logs to see which commands are sent to the device when you add a new user from the app? It might be sending multiple commands to the device.

  1. You need to set up the ST CLI and run the command below:
smartthings edge:drivers:logcat
  1. The CLI will prompt you to select from which hub and driver you want to listen for events.
  2. Then, you need to add a new user through “Manage users” and check the incoming events.

Either way, I shared your feedback with the corresponding team about this but it might take a while to get more info.