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

Zigbee Cluster Library (Zcl) issues

Hello,

I would like someone to explain to me payload for Zigbee cluster library (Zcl)

i was following this guide to control my lights:

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.0.0%2Fzigbee_example_cli_agent.html

For now i have two issues:

1- How do I control my lights colors using the 'zcl cmd' and what is the payload for 'x,y' color parameter?

code according to Zcl cli reference for temperature:

'zcl cmd 000b57fffebb86b8 1 0x0300 -p 0x0104 0x0a -l af000000'

format according to Zigbee Cli refernce of Nordic (https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.0.0%2Fzigbee_example_cli_agent.html), The format is:

'zcl cmd [-d] <h:dst_addr> <d:ep> <h:cluster> [-p h:profile] <h:cmd_ID> [-l h:payload]'

according to the zigbee cluster library the parameters should be the same instead '0x0a' -> '0x07' to change color. And payload 

which i didn't find any documentation to explain the payload and how it should be written the only thing i found it is that (x,y,transitiontime) are the parameters and they are 48-bits in total (16 bit each).

How should I write them?

the only thing i was able to do was change my hue and saturation which i don't find very accurate i would prefer to use the x,y color spectrum.

2- My lights were successfully discovered and changed my hue levels for all 3 philips hue products ('Hue Go', 'Hue striplight', 'Hue Colored lightbulb'). But after reseting my system and coming back to search for the lights using 'zdo match_desc' they don't appear anymore.

How can I make my lights discoverable again? ( I did factory reset multiple times still didn't work)

  • Hi,

    Question1. Color control cluster has cluster ID 0x0300 and command ID 0x07 Move to Color is describe in section 5.2.2.3.10 of the ZCL spec.

    Since the payload consists for 3 x 16 bits then you should write a total of 12 characters in the payload. The last four characters will be the transition time.

    There is also some information about the CurrentX and CurrentY color values in the specification, and both values have a range of 0000-feff

    CurrentX Attribute
    The CurrentX attribute contains the current value of the normalized chromaticity value x, as defined in the CIE xyY Color Space. It is updated as fast as practical during commands that change the color.
    The value of x SHALL be related to the CurrentX attribute by the relationship
    x = CurrentX / 65536 (CurrentX in the range 0 to 65279 inclusive)


    CurrentY Attribute
    The CurrentY attribute contains the current value of the normalized chromaticity value y, as defined in the CIE xyY Color Space. It is updated as fast as practical during commands that change the color.
    The value of y SHALL be related to the CurrentY attribute by the relationship
    y = CurrentY / 65536 (CurrentY in the range 0 to 65279 inclusive)

    Question2. If you are using the CLI agent example you should now that this example erased the zigbee network data after reset by default, since it's mean to be used as a developing tool. You will need to commission the lights again after reseting the example. If you want to store the network data in NVRAM you need to set ERASE_PERSISTENT_CONFIG to ZB_FALSE in the source code. For a product that is going to be release to the market you will usually want to make a custom coordinator, so the thought is that you can use the CLI example as a developing tool to see which commands you need to implement in your coordinator and then add them to the Light control coordinator for example.

    Best regards,

    Marjeris

Related