light switch binding with light bulb questions

  

        Hello, I can commission bulb and switch pass, then I refer this link(acl and bind) to write ACL and binding both, eventually I can use switch to control bulb!

        But I have some questions and I have not found answer in this link:

        Q1: Can I unbind the bulb and switch that has been bound before?

        Q2: I want to check multi-dev case:

                 e.g., one switch to multi bulbsabove link has mentioned below:

  • If you are using more than one light bulb device, connect all devices to the multicast group by running the following command for each device, including the light switch:

               chip-tool tests TestGroupDemoConfig --nodeId <node_ID>

  • For groupcast binding to bind the light switch with multiple light bulbs:

               chip-tool binding write binding '[{"fabricIndex": 1, "group": 257}]' <light_switch_node_ID> 1

        But how can I test one bulb to multi switches? Besides, does one switch can control different bulb? e.g. press button1 in switch control bulb A, press button2 in the same switch control bulb B

             

Parents
  • Hi,

            Q1: Can I unbind the bulb and switch that has been bound before?

    You can remove bindings by updating the binding attribute in the binding cluster.

    But how can I test one bulb to multi switches? Besides, does one switch can control different bulb? e.g. press button1 in switch control bulb A, press button2 in the same switch control bulb B

    If you want multiple light switches to control the same light bulb, you can add access control and binding for each light switch individually, just as you would for a unicast binding.

    If you want the light switch to control two different light bulbs independently, i.e., button 1 for bulb A and button 2 for bulb B, you can add access control and binding for the light switch on both light bulbs and modify the code to send the command to the different bulbs depending on which button is pressed.

    Best regards,
    Marte

  •   

            Thanks for your response!

            As you said:

            "You can remove bindings by updating the binding attribute in the binding cluster."

    •         May I know how to update the the binding attribute in the binding cluster?

            Besides, when I execute command: chip-tool tests TestGroupDemoConfig --nodeId <node_ID>

            CHIP tool popup error: Unknown cluster or command set: test

    •         How can I fix it?


              
  • Hi,

    susepc said:

    "You can remove bindings by updating the binding attribute in the binding cluster."

    •         May I know how to update the the binding attribute in the binding cluster?

    You can do so by sending a write binding request to the light switch with an empty attribute value, i.e. just '[]', like this:

    chip-tool binding write binding '[]' <light switch node id> 1

    I should also specify that when you want one light switch to control multiple light bulbs independently, you need to write to the binding table in the same write command, as when you send a write binding request, you overwrite whatever is already in the binding attribute.

    In other words, to control multiple light bulbs, you must add {"fabricIndex": 1, "node": <light bulb node id>, "endpoint": 1, "cluster": 6} and {"fabricIndex": 1, "node": <light bulb node id>, "endpoint": 1, "cluster": 8} for each bulb in the chip-tool command, like this:

    chip-tool binding write binding '[{"fabricIndex": 1, "node": <light bulb A node id>, "endpoint": 1, "cluster": 6}, {"fabricIndex": 1, "node": <light bulb A node id>, "endpoint": 1, "cluster": 8}, {"fabricIndex": 1, "node": <light bulb B node id>, "endpoint": 1, "cluster": 6}, {"fabricIndex": 1, "node": <light bulb B node id>, "endpoint": 1, "cluster": 8}]' <light switch node id> 1

    susepc said:

          Besides, when I execute command: chip-tool tests TestGroupDemoConfig --nodeId <node_ID>

            CHIP tool popup error: Unknown cluster or command set: test

    •         How can I fix it?

    I checked with the developers, and the documentation for this step is incorrect. The tests command set is no longer used in chip-tool.
    Instead, you need to add ACLs separately for each light bulb.

    Best regards,
    Marte

  •   

            Ok, thanks for your response!

            As you said, I can use the command you suggest to bind 2 or more bulbs, but I only find write binding command, how can I modify write acl command? The single bulb with single switch write acl command as below:

    chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [<light_switch_node_ID>], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 1, "deviceType": null}]}]' <light_bulb_node_ID> 0

            Besides, can I use this command to get my purpose?

    Usage:
    ./chip-tool groups command_name [param1 param2 ...]

    +-------------------------------------------------------------------------------------+
    | Commands: |
    +-------------------------------------------------------------------------------------+
    | * add-group |
    | * add-group-if-identifying |
    | * get-group-membership |
    | * remove-all-groups |
    | * remove-group |
    | * view-group |
    | * discover |
    | * read |
    +-------------------------------------------------------------------------------------+

            If yes, is there any introduction about it in nrf web?

  • Hi,

    susepc said:
    As you said, I can use the command you suggest to bind 2 or more bulbs, but I only find write binding command, how can I modify write acl command?

    The write ACL command is sent to the light bulb, so you must send the command separately to each light bulb, replacing <light_bulb_node_ID> with the node ID of the light bulb you are sending the command to.

    chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [<light_switch_node_ID>], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 1, "deviceType": null}]}]' <light_bulb_node_ID> 0

    Best regards,
    Marte

  •  

            Thanks for your prompt response!

            May I know this answer?

            

            Besides, can I use this command to get my purpose?

    Usage:
    ./chip-tool groups command_name [param1 param2 ...]

    +-------------------------------------------------------------------------------------+
    | Commands: |
    +-------------------------------------------------------------------------------------+
    | * add-group |
    | * add-group-if-identifying |
    | * get-group-membership |
    | * remove-all-groups |
    | * remove-group |
    | * view-group |
    | * discover |
    | * read |
    +-------------------------------------------------------------------------------------+

            If yes, is there any introduction about it in nrf web?

Reply
  •  

            Thanks for your prompt response!

            May I know this answer?

            

            Besides, can I use this command to get my purpose?

    Usage:
    ./chip-tool groups command_name [param1 param2 ...]

    +-------------------------------------------------------------------------------------+
    | Commands: |
    +-------------------------------------------------------------------------------------+
    | * add-group |
    | * add-group-if-identifying |
    | * get-group-membership |
    | * remove-all-groups |
    | * remove-group |
    | * view-group |
    | * discover |
    | * read |
    +-------------------------------------------------------------------------------------+

            If yes, is there any introduction about it in nrf web?

Children
  • Hi,

    You can use groups to send groupcast commands. For that, you send an AddGroup command to each device you want to add to the group:

    chip-tool groups add-group <group_id> <group_name> <light_bulb_node_id> <endpoint_id>

    After this, commands can be sent using the group ID instead of the individual device's node IDs.

    To send commands to groups using chip-tool, you send the command as usual, replacing the node ID with the group ID and omitting the endpoint ID from the command, for example:

    chip-tool onoff on <group_id>

    The light switch sample is implemented to use the binding table and not groups, so you must change the code if you want it to send commands using groups instead of bindings.

    You can find information about the Groups cluster in the Matter Application Clusters specification, which can be downloaded from CSA's website: https://csa-iot.org/developer-resource/specifications-download-request/.

    Best regards,
    Marte

  •   

            Thanks, I'll have a try!

            May I know how to do this?(Hope you can give a demo)

            "so you must change the code if you want it to send commands using groups instead of bindings."

Related