home-assistant-libs / python-matter-server

Python server to interact with Matter
Apache License 2.0
450 stars 68 forks source link

Feature request: Ability to set Binding (x/30/0) attribute from dashboard #815

Open sgryphon opened 2 months ago

sgryphon commented 2 months ago

In the dashboard UI, as well as exploring nodes and viewing (reading) attribute values, it would be good if there was a way to write attribute values, specifically to write the Binding attribute.

This could be hidden behind an Advanced mode (like Home Assistant administration) if there was worry that it could mess things up.

Example:

node_id = 6 attribute_path = "1/30/0" binding target: node = 12 group = null endpoint = 1 cluster = 0x0006 (On/Off cluster -- needs to be a client cluster) fabricIndex = 2

We know the node and endpoint, and the relevant cluster. The valid binding target struct would depend on what clusters are in the descriptor client list ("1/29/2"), and the valid nodes and endpoints in the fabric (and the server list of the target node/endpoint)

Binding is a key feature for disconnected operation, e.g. where a switch can directly interface with a device (such as a light) by binding an On/Off client cluster with On/Off server on the destination light.

I have a Zemismart switch that has 0x6 client cluster supported, and I would like to bind it to a light (which all have 0x6 server).

image

The device supports the binding attribute, but there is no way to set it in the dashboard (I can via the programming UI)

image

marcelveldt commented 2 months ago

Yes, this is all on the long list - not a priority for now due to a lack of capacity

lboue commented 6 days ago

@sgryphon Could you share the commands used to set up binding on the command line?

I would try with a Window Covering Controller:

image

image

sgryphon commented 5 days ago

Could you share the commands used to set up binding on the command line?

Sure. I have some example scripts and commands in a GitHub repository.

https://github.com/sgryphon/iot-demo-build/blob/main/matter-thread/scripts/Send-MatterCommand.ps1

This is a PowerShell script that opens a websocket connection, reads the initial details, sends a command, waits for the response, and then closes the connection.

The 5th example shows a read_attribute command, to read the current binding object.

The 6th example (in the script header) shows using write_attribute to set the binding value.

You need a device that:

sgryphon commented 5 days ago

BTW @lboue what is that UI you have screen shots of? I am using the Matter Server via Home Assistant, and some of the buttons look the same (e.g. the Interview, Update, etc along the bottom), but I don't have the same config screens (can only view nodes).

lboue commented 4 days ago

@sgryphon The first screenshot is ZAP tool used with the CHIP SDK. The second one is from Python Matter Server WebUI. You can to enable the Show in sidebar checkbox in the Matter Server addon.

Thanks for the script. I will give a try.

Apollon77 commented 4 days ago

Ok, maybe also my 5cents about bindings :-)

As summarized above:

The reality is that there are not that many real devices out there that bring client clusters with them ... and even if they are there it is unclear if they are functual ... Because of the fact that currently no ecosystem out there supports setting that up I think it was also not the highest prio for device manufacturers.

lboue commented 4 days ago

@Apollon77 I'm going to use 2 development kits to do this binding test with chip-tool.

hoppel118 commented 4 days ago

@Apollon77

and even if they are there it is unclear if they are functual ... Because of the fact that currently no ecosystem out there supports setting that up I think it was also not the highest prio for device manufacturers.

EVE launched the EVE Thermo Control some days ago. With that device you can control the temperature of up to 5 EVE Thermos. It also acts as a temperature sensor for the paired EVE Thermos.

It uses Matter bindings. You can set that up via the EVE app. So, it’s already possible, when you are an Apple Home user. 😉

Apollon77 commented 4 days ago

@hoppel118 Yes and that's the only official device I know where bindings are communicated as a feature. :-) An other device I know are Innovelli Matter switches. But that's it what I know is out there. There could be more, but when well hidden.