Thought I would share a real use case of the On Level attribute in this custom driver and how I used it initially to fix a bug in WiZ 1.35.0 lights.
WiZ lights have an amazing feature called rhythms in their app, you can set the state of the light at different times of the day so for instance the hallway lights turn on at full brightness during the day and dim at night, regardless of how you turn them on (voice assistants, remotes, apps, automations, etc.). It saves you lots of routines and was one of my favourite features!
Unfortunately, firmware 1.35.0 broke the rhythms when using Matter and the brightness was wrong. The issue was they were setting the OnLevel attribute to the wrong value and that controls precisely the brightness level used to turn on the light in Matter.
I disabled the rhythms in WiZ app and built the behaviour the native Matter way with a SmartThings daily routine which is a perfect fit. All you need is Write On Level at different times of the day so it has effect until the next time it changes.
Now, whenever you turn on the light during the day it has full brightness and if you turn it on at night is dim. You can use sunrise and sunset too in the daily routines which is a plus.
The manually run routines are for testing and convenience, you can Write On Level directly in the daily routine so it’s all done in a single routine, so convenient!
Mind OnLevel value is not converted by the driver and it’s in Matter units (like in Home Assistant), not percentage. For 100% you have to write 254, for 50% 127, for 10% 25, for 1% 1.
If you don’t want to force a specific brightness value so it turns on with the last brightness write -1 which is the default and maps to null in Matter (in Home Assistant they use 255 for that but I find -1 more intuitive for the previous brightness). You can change the value directly from the details screen.
Support of On Level across lights is not stellar though, Nanoleaf rewrites what the user sets when the light turns off so you need to work around that and WiZ rewrites it after a power cycle. I hope they both fix the bugs! (Update: The driver now includes a feature to enforce the On Level value set through the app or automations, it’s quite useful while the bugs are fixed by the vendors!)


