#ZHA: On Level Too High

1 messages · Page 1 of 1 (latest)

chilly isle
#

So I know not all devices support on level, but I know these do. For the longest time I couldn't get On Level of 255 to work. This is the right most slider setting which should equate to 100%.

E11-G13 by Sengled
I've found on these bulbs, 255 is not correct. 254 is. In other words, the setting is completely ignored at 255 and the system will retain the last configured on level instead.

Is this the desired design? Is 255 supposed to disable the On Level or is this an error and the max should be set to 254?

I'm not sure if this is unique to these bulbs or if this is common across all ZHA lights.

Not fluent with Discord or GitHub, so I figured I'd start here.

versed hemlock
#

254 is the max brightness per the Zigbee spec. An OnLevel value of 255 doesn't do anything

#

A value of 255 for OnLevel more or less means "not implemented"

chilly isle
#

Or ZHA should default to something other than 255 for new devices. (Like 254)

versed hemlock
#

That attribute is an 8-bit unsigned int, so that's why it's not -1 at least

#

But yeah, max brightness being 254 in the Zigbee spec is a head scratcher

versed hemlock
#

I have it set to 254 on my DIY Zigbee devices

chilly isle
versed hemlock
#

0 isn't a valid option either. 1 is the minimum, but I agree that 254 is a good choice

#

Are you sure it consistently defaults to 255 though?

chilly isle
#

Actually 0 keeps it off, which I wouldn't understand why anyone would set it to 0 so maybe 254.

versed hemlock
#

A value of 0 is invalid for OnLevel anyway (the range is 1-255)

versed hemlock
chilly isle
versed hemlock
#

Gotcha

chilly isle
#

I'll test tomorrow and get back to you.

versed hemlock
#

Yeah that's weird then unless the light doesn't support OnLevel

#

But I imagine that attribute wouldn't be exposed if it wasn't supported

chilly isle
#

After removing the bulb from ZHA, I performed a factory reset using the 10x power‑cycle method and then re‑added the device back into ZHA. Upon rejoining, the bulb once again defaulted to a value of 255.
At this point, I’m trying to determine whether that default value is being set internally by the bulb itself as part of its factory reset process, or if ZHA is assigning the 255 value when it provisions the device after re‑addition.
I also noticed that the device history remained visible even after I removed the bulb from ZHA. This suggests that removing a device doesn’t actually purge its record from the Zigbee database. If that’s the case, it feels like the removal process should ideally include clearing the device’s historical data to avoid confusion when re‑adding it later.

versed hemlock
#

The Zigbee database and recorder (history) database are separate. It's normal for entity state history to not be deleted from the recorder database when an entity is deleted (regardless of integration)

sick furnace
#

The "OnLevel" attribute is supposed to default to a "NULL" value, which means "restore the brightness that was last used when the light turns on again". It's possible that ZHA is using '255' as a way to indicate the NULL value, since 255 is not a valid brightness value.

#

254 is the value which indicates "max brightness".

#

hmm, i could be mixing up matter and zigbee stuff, would have to pull out the zcl specs to double check - but regardless, the valid values for enabling "onlevel" are 1-254 where 1 is "min supported brightness" and 254 is "max supported brightness", and the default on a new (or reset) device is supposed to be "remember the last used brightness and restore that". I'm just not sure specifically how this default value is encoded in the protocol - it might be encoded as 0xff (255) in zigbee.

#

ok, double-checked the Zigbee specs. onlevel value of 255 is supposed to be the default, and means that onlevel is disabled (when onlevel is disabled, the light is supposed to remember and restore the last-used brightness).

#

so, it sounds like everything is working properly according to spec. the bulb would be restoring onlevel to the default (255) itself on factory reset.

#

if onlevel is not supported at all by the bulb, the attribute would not be present. 255 means "supported but not currently enabled".