From 959e104f035937c05d225dbd4a79523fe47ccb83 Mon Sep 17 00:00:00 2001 From: Lukas Bezdicka Date: Wed, 22 Oct 2025 22:43:53 +0200 Subject: [PATCH 1/2] Send commands to binded groups too We also need to call sl_zigbee_af_send_multicast_to_bindings to send commands to binded groups as binding multiple devices and than sending toggle would yeld mixed results. --- src/zbminir2/app.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/zbminir2/app.c b/src/zbminir2/app.c index 2dac691..1673a2d 100644 --- a/src/zbminir2/app.c +++ b/src/zbminir2/app.c @@ -120,6 +120,8 @@ static void switch_event_handler(sl_zigbee_af_event_t *event) status = sl_zigbee_af_send_command_unicast_to_bindings(); sl_zigbee_app_debug_println("%s: 0x%X", "Send to bindings", status); + status = sl_zigbee_af_send_command_multicast_to_bindings(); + sl_zigbee_app_debug_println("%s: 0x%X", "Send to bindings", status); } } @@ -278,4 +280,4 @@ void sl_button_on_change(const sl_button_t *handle) sl_zigbee_app_debug_println("%s: switch %d\n", __func__, pressed); sl_zigbee_af_event_set_active(&switch_event); } -} \ No newline at end of file +} From 8811364b627fff4c84f49ab8abdf46f12d5b7336 Mon Sep 17 00:00:00 2001 From: Lukas Bezdicka Date: Thu, 23 Oct 2025 17:27:11 +0200 Subject: [PATCH 2/2] Move On/Off clusters to separate endpoints If we keep both On/Off cluster in same endpoint the binding to group would just result in sending toggle to our self which is most likely unwanted. By having separate endpoints for On/Off input and output cluster we allow binding them. --- src/zbminir2/app.c | 2 +- src/zbminir2/zcl_config.zap | 494 +++++++++++++++++++++--------------- 2 files changed, 287 insertions(+), 209 deletions(-) diff --git a/src/zbminir2/app.c b/src/zbminir2/app.c index 1673a2d..f9c371c 100644 --- a/src/zbminir2/app.c +++ b/src/zbminir2/app.c @@ -42,7 +42,7 @@ #endif // SL_CATALOG_LED0_PRESENT #define LED_BLINK_PERIOD_MS 2000 -#define LIGHT_ENDPOINT 1 +#define LIGHT_ENDPOINT 3 #define RESET_TIMEOUT_MS 1000 #define RESET_NUM_TOGGLES 5 #define SWITCH_DEBOUNCE_MS 35 diff --git a/src/zbminir2/zcl_config.zap b/src/zbminir2/zcl_config.zap index 6b7f17e..66f8169 100644 --- a/src/zbminir2/zcl_config.zap +++ b/src/zbminir2/zcl_config.zap @@ -800,214 +800,6 @@ } ] }, - { - "name": "On/off", - "code": 6, - "mfgCode": null, - "define": "ON_OFF_CLUSTER", - "side": "client", - "enabled": 1, - "commands": [ - { - "name": "Off", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "On", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "Toggle", - "code": 2, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "On/off", - "code": 6, - "mfgCode": null, - "define": "ON_OFF_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "Off", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "On", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "Toggle", - "code": 2, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "OffWithEffect", - "code": 64, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "OnWithRecallGlobalScene", - "code": 65, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "OnWithTimedOff", - "code": 66, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "on/off", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "global scene control", - "code": 16384, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "on time", - "code": 16385, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "off wait time", - "code": 16386, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "start up on off", - "code": 16387, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "NVM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xFF", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, { "name": "Level Control", "code": 8, @@ -1339,6 +1131,276 @@ ] } ] + }, + { + "id": 2, + "name": "Centralized", + "deviceTypeRef": { + "code": 2, + "profileId": 260, + "label": "HA-onnoffoutput", + "name": "HA-onnoffoutput", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 2, + "profileId": 260, + "label": "HA-onnoffoutput", + "name": "HA-onnoffoutput", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 2 + ], + "deviceTypeName": "HA-onnoffoutput", + "deviceTypeCode": 2, + "deviceTypeProfileId": 260, + "clusters": [ + { + "name": "On/off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OffWithEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OnWithRecallGlobalScene", + "code": 65, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OnWithTimedOff", + "code": 66, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "on/off", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "global scene control", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "on time", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "off wait time", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "start up on off", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 3, + "name": "Centralized", + "deviceTypeRef": { + "code": 2, + "profileId": 260, + "label": "HA-onnoffoutput", + "name": "HA-onnoffoutput", + "deviceTypeOrder": 0 + }, + "deviceTypes": [ + { + "code": 2, + "profileId": 260, + "label": "HA-onnoffoutput", + "name": "HA-onnoffoutput", + "deviceTypeOrder": 0 + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 2 + ], + "deviceTypeName": "HA-onnoffoutput", + "deviceTypeCode": 2, + "deviceTypeProfileId": 260, + "clusters": [ + { + "name": "On/off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] } ], "endpoints": [ @@ -1349,6 +1411,22 @@ "endpointId": 1, "networkId": 0, "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Centralized", + "endpointTypeIndex": 1, + "profileId": 260, + "endpointId": 2, + "networkId": 0, + "parentEndpointIdentifier": null + }, + { + "endpointTypeName": "Centralized", + "endpointTypeIndex": 2, + "profileId": 260, + "endpointId": 3, + "networkId": 0, + "parentEndpointIdentifier": null } ] }