LED Calculator for LZW31-SN dimmers

It’s more than just “RGB codes”–the LED notification parameter crams four things into one parameter: color, level, duration, and effect. The parameter is 4 bytes wide and each of these aspects occupies one of the bytes. Since that doesn’t line up nicely with human-friendly base-10 numbers most English speakers (and most of the world) are used to using, the calculator is the easiest way to convert your desired settings into this friendly form.

That being said, this conversion is the same for both the switch and dimmer according to their ST and Hubitat DTH/driver code. The only difference is that it’s set on parameter 8 for the switches or 16 for the dimmers. In either case, the calculation in decimal form is this:

color*1 + level*256 + duration*65536 + effect*16777216

Here, color is 0-255 (scaled from the conventional 0-360 hue values where both extremes are red), level is 1-10 (LED brightness), duration is 1-255 (desired duration in number of seconds 1-254 or 255 for indefinite), and effect is 0-5 (for off, solid, chase, fast blink, slow blink, and pulse, respectively; chase is not available on the switches).

3 Likes