Zigbee brightness cluster attribute and cluster

Hello,

Using v1.9.1 nrfConnect and the Coordinator example on a nrf52840 -DK.

From Nordic docs:


I think I may be miss interpreting Zigbee Cluster spec...

Below is example of an RGB light bulb I'm trying to change brightness on but can't get it to change.
(I tried many different ways too long to list)

#1  Based on below cluster info etc. can you give example of ZCL commend format to set brightness to 50%?
We can use "move to level" to 50%. I believe range is 0x000 - 0xfe if I read it right?

I can turn same bulb on/off by sending on/off command. 
zcl cmd 0xcf3e 01 0x0006 0x01 --- ON, as example.

But I can't read the attribute showing on/off status? Am i missing some setting in Kconfig?
I tried including profile id 0x0104 also since my default is HA.

#2  Can you me show ZCL command example of how to read this?


From Nordic doc: 
zcl attr read h:dst_addr d:ep h:cluster [-c] h:profile h:attr_id


PS: I looked at other tickets but looks like my issue is much simpler.

Thank you, Jorgen

Parents
  • Hi Jorgen,

    Is the light bulb application based on a sample application or is the firmware written from scratch? And is the RGB bulb a specific device, or just a bulb that is ZigBee-compatible?

    #1  Based on below cluster info etc. can you give example of ZCL commend format to set brightness to 50%?

    If you have not seen the zigbee samples already I believe the light bulb sample is a dimmable ZigBee device which might contain the functionality you are looking for. And I will take a look and see if I have a sample available tomorrow morning

    #2  Can you me show ZCL command example of how to read this?

    I believe I also have a sample for this, but I will need to find it first

    Kind regards,
    Andreas

  • Hi Andreas, It's just a generic Zigbee HA1.2 RGB light bulb with dimming and color control. 
    The Nordic zigbee light bulb controller example is a eval board "light switch" so it doesn't show actual codes that are sent. 
    At least I could not find it...?
    I think I'm not sending the correct attr_id 
    In fact I'm not sure where I can find the att_id , for "level" (dimming) as example.

    I assume it's not the same as "level" cluster which is 0x0800 as per below.


    An example of the just the command would be great.

    Thanks!
    Jorgen

  • Hi,

    I see you have the ZigBee Cluster Specification available, so I will also be using some snippets from the ZCL Spec V7 in my example below. I am also making an assumption that you know your devices ID and how to find their addresses and the correct end point values, so if I am assuming wrong on this, please correct me!

    JorgenM said:
    Nordic zigbee light bulb controller example

    By this, do you mean the the light switch sample?

    JorgenM said:
    I assume it's not the same as "level" cluster which is 0x0800 as per below.

    The level control attribute id is correct (0x0800) as per ZigBee Cluster Library Specification 7 states, but the command to change the value of the light is another command

    #1  Based on below cluster info etc. can you give example of ZCL commend format to set brightness to 50%?

    Here is a few examples of how to "mock" a light switch with commands:

    Off command with example: 

    • zcl cmd [-d] <h:dst_addr> <d:ep> <h:cluster> [-p h:profile] <cmd_ID> [-l h:payload]
    • zcl cmd -d 0x8041 10 0x0006 0x00

    Step command (dimmer function):

    • zcl cmd [-d] <h:dst_addr> <d:ep> <h:cluster> [-p h:profile] <cmd_ID> [-l h:payload]
      • for clarity: "-l" in [-l h:payload] = lower case L
    • zcl cmd 0x8041 10 0x0008 0x02 -l 00A01400

    This example is sent to the device at address 0x8041,  at the endpoint 10 (light bulb), and utilizes the ZigBee Home Automation Profile (0x0104) by default. When it is recived by the bulb, it should gradually increase the value of CurrentLevel attribute by 160 over 2 seconds

     

    We can use "move to level" to 50%. I believe range is 0x000 - 0xfe if I read it right?

    So to do this, you need to replace the cmd_ID in the example above from step (0x02) to "move to level 0x00. I am not 100% certain about the range, but my current best guess is that it is a long hexadecimal number. I will see if I can find someone who can verify this for me, but try with the same range you were trying the previous command with

    #2  Can you me show ZCL command example of how to read this?


    From Nordic doc: 
    zcl attr read h:dst_addr d:ep h:cluster [-c] h:profile h:attr_id

    In my sample, sending the command "zcl attr_read 0x8041 10 0x0006 0x0104 0x0000" returns ID: 0 Type: 10 Value: True, so I  think you just misinput the order of the parameters based on your screen shot.

    Let me know if this clarifies things for you or answers your questions!

    Kind regards,
    Andreas

  • Thanks Andreas!
    Yes looks like I missed the payload format. I will have to decipher this a bit.

    • zcl cmd 0x8041 10 0x0008 0x02 -l 00A01400

    I will try this.

    Thanks, Jorgen

  • Continued..
    Yes I meant the "light switch" example you are referring to above.
    You assume correct. I can retrieve node ID's, clusters number of endpoints etc. as per screenshot I sent.
    Thanks for your help!

    Jorgen

Reply Children
  • Hi Jorgen,

    How is the progress going? Did the commands I posted work, and can we close this ticket? If not, please let me know if you have any additional questions regarding this specific ticket! 

    Kind regards,
    Andreas

  • Hi Andreas,
    Yes your command worked but haven't been able to get others to work like "step up" or "move to level".
    Is it possible for you to elaborate on the payload in your example 

    • zcl cmd 0x8041 10 0x0008 0x02 -l 00A01400

    "currentLevel" being "160" ? What is the range of current level attribute?
    How is 160 level represented in the payload?
    What table is this defined in in the Cluster doc?

    If I use "move to Level" command 0x00 what is the range? An example on this would be great.

    I think I'm entering the wrong payload parameters.

    Thanks, Jorgen

  • Hi Jorgen,

    I will see if I can test this myself either tomorrow or on Monday. The commands were fetched from an internal course a way back and they might have changed in newer SDKs

    JorgenM said:
    How is 160 level represented in the payload?

    160 should be represented by A0 in the payload, but I see now that it is not as clear as it might have been. However, there are a part of that payload that has data that are not 160. I will have to look into what the other bytes in the long payload is.

    JorgenM said:
    What table is this defined in in the Cluster doc?

    I will also find this again and supply it to you

    Kind regards,
    Andreas

  • Thanks Andreas!

    Examples would be great on the payload format for lighting in general with short explanation of range parameters.
    It would save a lot of dev time....:)

    Since lighting control is such a common requirement an appnote with examples on this topic would be extremely useful or even a "real" lighting controller design example. 
    There are many ways to dim a light and change color etc.
    Some implementations (step vs. move to level as example) has impact on real-time response as well as flooding network with messages and instead using broadcast group etc. depending on how many lightbulbs are on the network.
    Just some food for thought...

    Cheers, Jorgen

  • Hi again Jorgen,

    I took another look into the ZigBee Cluster Library (version 7) and found something that I hope will clarify how to use the command

    For the step command: zcl cmd 0x8041 10 0x0008 0x02 -l 00A01400

    we have that the long payload 00A01400 is formated as 0x00 0xA0 0x14 0x00.

    • Here 0x00 = "step mode" which says to step up

    • 0xA0 = "step size", which is to be changed by 160 (0xA0 = 160)
    • 0x14 = "transition time", which is stated as "The Transition time field specifies the time that SHALL be taken to perform the step, in tenths of a seconds
    • 0x00 = "option", which is just 0 since its not used

    These can be seen in chapter 5.2.2.3.6 in the specification

    I hope this clarifies this command for you! 

    Kind regards,
    Andreas

Related