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

Zigbee cluster on/off callbacks not working with payload

Dear Nordic team,

I am currently building a Zigbee dimmable light and connect it to my home system (Philips bridge).

The bulb connects fine and receives the "dimming" commands perfectly.

The issue I am encountering is that my bulb receives the cluster ON event and goes in the defined callback functions, but the OFF events do not trigger any sort of callback !

These OFF events are indeed sent by the bridge, here a wireshark recording:

Here the ON event:

The difference I see here is that OFF events have a payload ! 

This payload is probably not handled properly as I configured the cluster like in the SDK example:

/* On/Off cluster attributes additions data */
ZB_ZCL_DECLARE_ON_OFF_ATTRIB_LIST_EXT(on_off_attr_list,
                                      &m_dev_ctx.on_off_attr.on_off,
                                      &m_dev_ctx.on_off_attr.global_scene_ctrl,
                                      &m_dev_ctx.on_off_attr.on_time,
                                      &m_dev_ctx.on_off_attr.off_wait_time);

Could you please detail how to handle this on the bulb side ?

Configuration:

nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b

  • Hello,

    I am so sorry for the late reply. I started looking into this, but I have was out of office the last week. 

    The "Off With Effect" events are not handled in the ZCL callbacks, as they are optional. What you would need to do is to use the endpoint handler instead.

    When an endpoint handler callback is registered, it is called for each ZCL command. So for the light bulb to handle the "Off With Effect" events, you need to parse the zcl command. It is stored in the buffer given as a function argument. Just check if the event is the "Off With Effect" event. The rest of the events should be handled as usual in the ZCL handler. 

    Best regards,
    Edvin

  • Hi Edvin,

    I'm also trying to add the Off with Effect command to the Zigbee Light Bulb example, but I couldn't understand the advice you gave to Vincent. What do I need to do?

    I'm using SDK 2.3.0

    My Zigbee sniffer through Wireshark is showing that my coordinator is sending the correct command.

    ZigBee Application Support Layer Data, Dst Endpt: 10, Src Endpt: 1
        Frame Control Field: Data (0x00)
        Destination Endpoint: 10
        Cluster: On/Off (0x0006)
        Profile: Home Automation (0x0104)
        Source Endpoint: 1
        Counter: 27
    ZigBee Cluster Library Frame
        Frame Control Field: Cluster-specific (0x01)
            .... ..01 = Frame Type: Cluster-specific (0x1)
            .... .0.. = Manufacturer Specific: False
            .... 0... = Direction: Client to Server
            ...0 .... = Disable Default Response: False
        Sequence Number: 103
        Command: Off with effect (0x40)
        Payload
            Effect Identifier: Delayed All Off (0x00)
            Effect Variant: Fade to off in 0.8 seconds (0x00)
    

    But the Light Bulb sample responds with "Invalid Field (0x85)

    ZigBee Application Support Layer Data, Dst Endpt: 1, Src Endpt: 10
        Frame Control Field: Data (0x40)
        Destination Endpoint: 1
        Cluster: On/Off (0x0006)
        Profile: Home Automation (0x0104)
        Source Endpoint: 10
        Counter: 192
    ZigBee Cluster Library Frame, Command: Default Response, Seq: 103
        Frame Control Field: Profile-wide (0x18)
            .... ..00 = Frame Type: Profile-wide (0x0)
            .... .0.. = Manufacturer Specific: False
            .... 1... = Direction: Server to Client
            ...1 .... = Disable Default Response: True
        Sequence Number: 103
        Command: Default Response (0x0b)
        Response to Command: 0x40
        Status: Invalid Field (0x85)

    The VS Code NRF Terminal shows "Unimplemented signal"

    I: Unimplemented signal (signal: 50, status: 0)

    I can see in SDK/v2.3.0/nrfxlib/zboss/production/src/zcl/zcl_on_off_commands.c that Off with Effect is listed on line 535.

  • Hello,

    If you have follow up questions, please create a new ticket, as this is more than 3y old, and for a different kind of SDK (nRF5 SDK, and not the nRF Connect SDK). 

    Yes, I see that there is a handler for the zb_zcl_process_on_off_off_with_effect_handler, but this is not handled in the zigbee_default_signal_handler() handler. So either, you need to add this event to an endpoint handler that is registered, and handle it there. Alternatively, you can try to add the zb_zcl_process_on_off_off_with_effect_handler to your project. Look at where it is called from, and see if you can figure out how to include it.

    I have not tested, but perhaps adding zb_zcl_on_off_init_server() helps, as it will enable the zb_zcl_process_on_off_specific_commands_srv() handler, which will call zb_zcl_process_on_off_specific_commands(), which will handle the ZB_ZCL_CMD_ON_OFF_OFF_WITH_EFFECT_ID event.

    BR,
    Edvin

Related