[Matter][EdgeDriver] How to implement unsupported Matter Cluster in EdgeDriver?

Hi, all.

Recently I want to integrate a Matter Light to Smartthings platform.
One of the most important features of my device is “Scene”.

The supported scene list is retrieved by the Matter Actions cluster
But this cluster has not been supported in Smartthings Matter Libraries.

My first question is:
How could I implement unsupported Mater cluster in EdgeDriver ?

For Zigbee Device, I could use cluster_base.build_manufacturer_specific_command and cluster_base.write_manufacturer_specific_attribute to implement unsupported zigbee cluster or attribute.
But I didn’t find any similar APIs in Matter Libraries.

My second question is:
Does the Smartthings App support dynamic UI page changes ?

As I said before, I will retrieve a scene list by operating Action Cluster
The scene list contains multiple scenes (up to 99), each scene should have corresponding control component.

The number of scenes will change because the device supports user customize scene.

A simple flow chart is like this
User customize scene in Third-party App -----> Update Scene List -----> EdgeDriver retrieves Scene List -----> Update Scene List in Smartthings App UI.

I know it’s a bit complicated so I want to confirm if this idea is feasible at the moment : )

Thank you so much !

tagging @AlejandroPadilla

You could probably start by looking at the Matter Switch driver. Eve has implemented custom cluster support for their energy report cluster in it

2 Likes

Ahh, got it.

Thank you ~

Just curious if you digged deeper into the Matter driver. There are indeed missing clusters in the SmartThings API like Identify or Scenes. The subscriptions are also kind of hidden from the driver.

Regarding dynamic lists, I guess you already know there’s a proposed capability called scenes, which receives an array of strings with the scene names. I’ve not tested it however so don’t even know if they’ve implemented the UI or not.

Hi @mocelet

Just curious if you digged deeper into the Matter driver.

No, I have not developed any Matter driver yet. I spent a lot of time on Zigbee and Lan Driver.

There are indeed missing clusters in the SmartThings API like Identify or Scenes

Yes

The subscriptions are also kind of hidden from the driver.

If you want to know the details of “subscribe” api. I think you could check the Lua api
lua_api/lua_libs-api_v9/st/matter/device.lua

I guess you already know there’s a proposed capability

Proposed capability are not available. We can’t use them.

Hope it helps ~

2 Likes

Looks like they’ve already added to the libs the APIs for Identify, Group and Scene clusters among others from Matter 1.2 devices: Generated Matter Code — SmartThings Edge Device Drivers documentation

The documentation is updated but the lua libraries v10 are not yet on github Releases. For the current v9 they’ve been adding the cluster definitions directly on the drivers checking if the API version is less than 10.

Still no binding support and OnOff Client commands.

Edit: By the way, how could a developer know the minimum API version available across all the SmartThings Matter compatible hubs? As in being sure v9 is no longer around and can use the new clusters in the API without embedding definitions in the driver. Tagging @nayelyz , I’m sure she knows :slight_smile:

3 Likes

Hi, @mocelet
I’m unsure if I understand your question, so I wanted to confirm before asking the engineering team.
Do you mean in case a developer wants to use Matter clusters supported in the newest versions but not in the other ones, to avoid issues in Hubs that don’t support them yet?

1 Like

Hi @nayelyz ,

It was actually a more generic question about what is the oldest library version that a developer has to support in the driver.

The Matter clusters example was quite convenient because the answer to support old libraries is what stock drivers do: they embed the cluster definitions of the v10 library in the driver and check if the hub is running version less than v10 to load them. Or if there’s a bug in a default v9 handler you can easily override it.

Let’s say all Matter compatible hubs eventually update to v10, those workarounds for v9 won’t be needed anymore. If that happened, how could a developer know?

The engineering team mentioned that there’s not a rule to know exactly but:

  1. The different Hub types are not too far apart from each other’s version as it was in the past with the Wi-Fi Hub that was in v38 (I think) and other hubs had a higher version, it seems now all have v52.
  2. It is suggested that your driver can handle the last few versions of the Lua libraries (API) and
  3. The engineering team cares about backward compatibility so the kind of workaround you mentioned is only when certain functionalities are not supported in all hubs yet
1 Like

Perfect, thanks @nayelyz !

Does it help that they are publishing the matterSoftwareComponentVersion in the AWA as of the latest releases?

This is for my fridge hub running 53.20.

1 Like

For Matter it’s probably a better indicator than the Lua Library version, although they’re probably related right now.

It looks like they’re indeed updating more hubs than announced to the new libraries so most users are probably on the latest version already.

And they just posted APIv10 Hub Release 0.53.X about two hours ago.

1 Like

Thanks! I was about to ask about it, I’m curious if they’ve improved the default handlers or if there’s any sign of other features like binding or subscription interval configuration.

Judging from the file sizes, I wouldn’t guess there was any substantive changes to the default handlers. In fact, the init.lua is the exact same size and date as in the v9 library.

1 Like

That’s correct, looks like the focus has been in adding cluster definitions and I’m glad they added Scenes even if devices won’t get support for them until Matter 1.3.

At least thanks to this “transition period” between libraries v9 and v10 we learned how to add unsupported Matter clusters to drivers, which is what OP asked in the first place, and even deal with custom clusters (see the Eve Energy).

The only missing part is support for binding, but looks like that Matter feature will take time to arrive to the market.

Sorry for my question but how I can apply this druver to smarthings…it looks like script and I can not find a place in smarthings to write a script