This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ZIGBEE SEND Simple ON/OFF Command to coordinator

Hello,

I am trying to accomplish sending a simple ON or OFF command to the coordinator. Is this possible to do?

I have a router device with these Clusters:

Basic Cluster
Identify Cluster
Groups Cluster
Scenes Cluster
Window Covering Cluster
Power Config Cluster

It is simple device that acts as Window Covering and is controlled by coordinator and reports Battery Remaining Percentage attribute.

Now I want to add simple button that will send a Command to the coordinator whenever pressed. Toggle or just ON/OFF  commands.

But I am completely lost on how to do this. I have looked into the Zigbee Light Switch example, but there is some dimmer device, not an ON/OFF switch device. Zigbee Light Switch example also send the command straight to the paired bulb (if I understand correctly), but I want to send the command to my Coordinator to be able to process it later (and i.e. control other devices with it, even some outside zigbee network).

I am trying to send the command by this piece of code:

          zb_uint8_t cmd_id;
          zb_uint16_t coordinator_address = 0x0000;
          zb_uint8_t coordinator_endpoint = 10;
          cmd_id = ZB_ZCL_CMD_ON_OFF_ON_ID;
          ZB_ZCL_ON_OFF_SEND_REQ(bufid,
                                 coordinator_address,
                                 ZB_APS_ADDR_MODE_16_ENDP_PRESENT,
                                 coordinator_endpoint,
                                 HA_WINDOW_COVERING_ENDPOINT,
                                 ZB_AF_HA_PROFILE_ID,
                                 ZB_ZCL_DISABLE_DEFAULT_RESPONSE,
                                 cmd_id,
                                 NULL);

But in Wireshark with NRF52840 Dongle sniffer I get nothing - nothing is sent.

Do I have to do something extra for enabling the ON/OFF switch functionality? 

Thanks in advance!

Best regards,

Krystof Vydra

Related