Binding Matter Light bulb and Matter Light switch #978
Replies: 2 comments 3 replies
-
Hey, that's really cool. This shows the great capability of Matter as a local peer-to-peer network, where the switch can directly send commands to the light, i.e. without the controller being available. Great work! |
Beta Was this translation helpful? Give feedback.
-
Matter Home Assistant Light - Switch bindingHere is how to bind a switch and a light using a Websocket client connected to python-matter-server. Steps
Matter device pairing
Identify the Matter HomeAssistant fabric IDRead Note
{
"message_id": "1",
"command":"read_attribute",
"args":{
"node_id":[LightNodeID],
"attribute_path":"0/62/5"
}
} Response {
"message_id": "1",
"result": {
"0/62/5": 3
}
} Note In this example, the index value is: 3 Backup the light device ACLSave the ACL so that you can restore it if necessary. The easiest way is to factory reset the device. {
"message_id": "2",
"command":"read_attribute",
"args":{
"node_id":[LightNodeID],
"attribute_path":"0/31/0"
}
} Create an ACL on the light deviceYou need to modify the Access Control List (ACL) of your Matter light device. This list determines which device in the network your Matter light device will react to. Write Note
{
"message_id": "2",
"command":"write_attribute",
"args":{
"node_id":11,
"attribute_path":"0/31/0",
"value": [{"fabricIndex": [fabricID], "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": [fabricID], "privilege": 3, "authMode": 2, "subjects": [[SwitchNodeID]], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 1, "deviceType": null}]}]
}
} Response {
"message_id": "2",
"result": [
{
"Path": {
"EndpointId": 0,
"ClusterId": 31,
"AttributeId": 0
},
"Status": 0
}
]
} Create a binding in the switch deviceWrite Unicast binding to light switch Add 2 entries in the Light Switch binding table:
Note
{
"message_id": "3",
"command":"write_attribute",
"args":{
"node_id": [SwitchNodeID],
"attribute_path":"1/30/0",
"value": [
{"fabricIndex": [FabricID], "node": [LightNodeID], "endpoint": 1, "cluster": 6},
{"fabricIndex": [FabricID], "node": [LightNodeID], "endpoint": 1, "cluster": 8}
]
}
} Response {
"message_id": "3",
"result": [
{
"Path": {
"EndpointId": 1,
"ClusterId": 30,
"AttributeId": 0
},
"Status": 0
}
]
} |
Beta Was this translation helpful? Give feedback.
-
Matter Binding
I've managed to pair 2 nRF5340 development boards using a Websocket client and python-matter-server. This is called Matter binding.
Setup
I'm in the process of documenting this.
Doc
Testing
Pressing OnOff button 2 to switch On the light
Long press OnOff button 2 to dim the light
Regards
Beta Was this translation helpful? Give feedback.
All reactions