不辜负自己,不将就生活。

Understand level definitions for lighting in ZigBee Cluster Library v7

In ZigBee Cluster Library (ZCL) specifications, there are sometimes confusing points that developers do not quite understand, and I will try in this post to clarify a little bit about those level definitions in ZCL’s most-recent version, v7 (ZigBee document 07-5123 Revision 7).

  First of all, level is something generic. Keep that in mind. It can be light levels, which is often found in lighting systems, but it can also be anything, for example, water level, air pressure level, and etc.

However, as ZigBee is more widely adopted in home automation systems than other systems, where lighting is a key part, level cluster is more often used for connected lighting cases.  That is why starting ZCL v7,  the more general level cluster (cluster id 0x0008, chapter 3.10) derives a “level cluster for lighting” cluster, with the same cluster id 0x0008 (chapter 3.19).

    And I will clarify level definitions for lighting especially.

In level cluster, attribute id 0 specifies attribute “CurrentLevel”. CurrentLevel is in fact a unified level, 8-bit wide, in range 0x01 to 0xfe,  with defaults set to 0xff (value undefined).

On/Off cluster is a different cluster than level cluster, so generally speaking operations on On/Off cluster will not interfere with level cluster. But lighting is special. When you turn light on or off, you expect level to be changed accordingly. Thus it comes OnLevel attribute (attribute id 0x0011), and this attribute defines what the CurrentLevel of level cluster will be upon processing on or off commands in On/Off cluster.

Another attribute, StartupCurrentLevel (attribute id: 0x4000) of level cluster, in range 0x00 to 0xff, specifies what the CurrentLevel will be upon startup. Two boundary values, 0x00 and 0xff have special meanings though (Read 3.10.2.2.14). This also explains why CurrentLevel does not use value 0x00.

    After all, we need level cluster to control light levels, so we need output to the real light.  Thus we have dimming curve definitions and a group of level definitions for that real light, and that is the “Ballast Configuration Cluster” (cluster id: 0x0301).

And this is often where confusion comes,  because all those level definitions here are also 8-bit wide, same as before.

In chapter 5.3.4, “The Dimming Light Curve”,  there is a formula that converts level to the real light output percentage:

However you should be careful that “level” in this formula is not quite the unified level we have mentioned before. In fact, it is the unified level gets remapped to the range of MinLevel to MaxLevel.

What is MinLevel and MaxLevel? They are two attributes of level cluster too. So they are still unified levels.  They limit how low the CurrentLevel can be, and how high the CurrentLevel can be.

The remapping occurs to ease users, so that users do not have to remember how low or high they can set the CurrentLevel to, by using for example Move or MoveTo commands. They simply say, move to level x where x is still in range 0x01 to 0xfe.  Remember, that is why in level cluster for lighting, CurrentLevel is in range 0x01 to 0xfe (Table 3-145) instead of MinLevel to MaxLevel in the more general level cluster (Table 3-56), because for lighting, we will do remapping.

I hope it is easier to understand. We use the formula in chapter 5.3.4 to remap:

Level = (MaxLevel – MinLevel) * CurrentLevel / 253 + (254 * MinLevel – MaxLevel) / 253

Perhaps you may not understand the conversion at once. So I change the formula to a easier-to-understand version below:

Level = MinLevel + (MaxLevel – MinLevel) * CurrentLevel / 253

It is easier to understand now. This is a remap from 0x01-0xfe into MinLevel to MaxLevel.

Another to point out is,  in Table 5-36 Examples of the Dimming Light Curve, which is added by specification writers to ease the understanding, there is a typo in the fifth line, column 3, which should be 254 instead of 154.

Check the example together with the formula to get the point.

6 Comments

  1. russian bet

    I feel this is among the so much vital info for me. Michal Glodowski

  2. Loveme

    Asking questions are actually pleasant thing if you are not understanding something entirely, however this paragraph offers good understanding even. Allan Klonoski

  3. kacak bahis siteleri

    Together with the whole thing which seems to be developing within this specific area, many of your perspectives happen to be rather exciting. Even so, I appologize, because I do not subscribe to your whole strategy, all be it exhilarating none the less. It would seem to everybody that your remarks are actually not totally justified and in fact you are generally yourself not thoroughly convinced of the assertion. In any event I did take pleasure in examining it. Ray Truly

  4. russian bet

    I am saddened to not have my friend around. While we did not do a lot over last few years. he was and is in my heart. I have many fond memories of Todd. He and I did many things too many to mention here. He was a giving friend a protector and a provider for all he met. words will never e able to fill the void Todd has left on this earth. But one day we will hug again. I love Todd and I sorely miss him. I am not able to attend any of the services because some of my family members have tested positive and i do not want to add more challenges to anyone. I know Todd is in a good place and preparing busily for his sweetheart in the mansion he is not building there. and yes i imagine there will be many trees and flowers to give him solace while he waits his earthly loved ones. He is now with his mom and dad and what a joyous reunion that must have been. I love and admire all of the Burrastons they are strong solid people and have my enduring respect and with much love until we meet again my dear friend . Del Vanlinden

  5. freespin

    It clear sport sneaker is actually a fuse coach in addition to comprise of all the so-called good results enclosed in this particular that you really would most likely uncover with many other Brand new solidity fit tennis shoes. You have available some of these tennis shoes with regards to using, walking as well as nearly anything altogether different you could snapshot. Osvaldo Rom

  6. casino

    consorcio caminhao contemplado consorcio caminhoes contemplados consorcio caminhao consorcio de automovel pesados carta de credito para caminhoes contemplada carta de credito de maquinas consorcio contemplado caminhao mg consorcio maquinas e equipamentos consorcio caminhoes contemplados carta de credito para caminhao usado consorcio de onibus contemplado consorcio contemplado caminhao curitiba carta de credito de maquinas consorcio contemplado caminhao mg. Judson Goldthwait

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2025 A Life Climber

Theme by Anders NorenUp ↑

error: Content is protected !!