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

Zigbee HA Atrribute Reporting

Hi, I'm trying to setup attribute reporting on zigbee HA, the device role is ZB_ZCL_CLUSTER_SERVER_ROLE, I want to configure reporting for cluster 0x0006, so each time I flip a switch it send clusters current state to the coordinator, none of the examples seemed to be configured for reporting.

Does it has to be explicitly configured/enabled on the node?

Thanks in advance.

Parents
  • Found this in internal FAQ page:

    Do we have a ZCL attribute reporting example

    We do not have an example created specifically to demonstrate attribute reporting, although:

    • From server/advertiser site: for every cluster there is a set of attributes, that shall have attribute reporting implemented and available. As a result, a simple light bulb example may be used as reporting ZCL server.
    • From client/subscriber site: all commands required to configure reporting and logic to parse reports were added to the CLI Agent Router example.

    Combination of those two gives a complete "reporting" example.

    Additionally, the CLI uses a "raw" technique of intercepting ZCL reports. There is also a dedicated ZBOSS callback, that may be used to get ZCL attribute reports, but it was not used, as there might be only one reporting-callback defined.

    Steps to test ZCL reporting:

    1. Flash light bub example to one board
    2. Flash CLI example (Zigbee CLI Agent example) to another board.
    3. Use CLI as the coordinator:
      1. bdb role zc
      2. bdb start
    4. Find the light bulb's endpoint, short and long addresses:
      1. zdo match_desc 0xFFFD 0xFFFD 0x0104 1 0x0006 0
      2. zdo ieee_addr <returned_short_address>
    5. Create binding FROM the light bulb TO the CLI ON the light bulb:
      1. zcl bind <bulb_long_addr> <bulb_ep_from_match_desc> <CLI_long_addr> <CLI_endpoint, defaults to 64> 0x0006 <bulb_short_addr>
    6. Subscribe for attribute's changes:
      1. zcl subscribe <bulb_long_addr> <bulb_ep_from_match_desc> 0x0006 0x0104 0x0000 16


    Magic numbers:

    0xFFFD - broadcast address, all devices with RxOnWhenIdle == 1
    0x0104 - Home Automation profile ID
    0x0006 - On/Off cluster ID
    0x0000 - On/Off attribute ID

    Hope this helps!

    Best regards

    Bjørn

  • Hi , can you clarify step 5? there is no sign of this command in the documentation: zcl bind or zcl_bind.

    Thanks in advance!

  • HI inv4, 

    I think thats a typo and it should be zdo bind on  and not zcl bind. 

    Best regards

    Bjørn 

  • Is there a way to create the binding from the router to coordinator? In the example that you mention this is done via CLI but In reality it would be more like Light node to Zigbee coordinator/gateway.

  • I guess you should be able to do that using the  ZCL API and ZDO API of the Zigbee stack.

  • I am in a good mood =) 

        zb_buf_t* p_buf = ZB_BUF_FROM_REF(param);
        zb_buf_t*                tb  = ZB_BUF_FROM_REF(test);
        send_command__req_t* cmd = (send_command__req_t*)ZB_BUF_BEGIN(tb);
        zb_zdo_bind_req_param_t* req;
        req = ZB_GET_BUF_PARAM(p_buf, zb_zdo_bind_req_param_t);

        zb_address_ieee_by_short(cmd->addr, req->src_address);
        req->req_dst_addr   = cmd->addr;
        req->src_endp       = cmd->endpoint;
        zb_get_long_address(req->dst_address.addr_long);   
        req->dst_addr_mode          = ZB_APS_ADDR_MODE_64_ENDP_PRESENT;
        req->dst_endp               = ZIGBEE_CLI_ENDPOINT;
        req->cluster_id     = cmd->cluster_id;   
        zb_uint8_t tsn = zb_zdo_bind_req(ZB_REF_FROM_BUF(p_buf), bind_acked_cb);
        ZB_FREE_BUF_BY_REF(test);
        LOG("Binding %d\n", tsn );
  • Hi, where are you getting param and test from?

Reply Children
Related