New advanced feature. Available from Version 2025-11-14
It is well known that some lights do weird things with On Level attribute so you can’t use it for what it is intended. Nanoleaf rewrites it when you turn the light off and WiZ rewrites it after a power cycle to name two examples.
@TapioX shared with me a workaround copying values with a rule and a virtual number device and gave me an idea to build an On Level enforcer right into the driver.
Meet the On Level enforcer
This is a WiZ light, after a power cycle, replacing my previous -1 with a 25 and then the driver detecting the change and writing -1 again.
And here’s a Nanoleaf that changed the value to 203 when turning it off and the driver restored the 91 I set before to test.
How to use the On Level enforcer
To enable, just run this command in the Advanced input or in the AWA (runCommand). It only needs to be run once for each light.
feature enforceOnLevel value enabled
To disable, when vendors fix their bugs, use:
feature enforceOnLevel value disabled
How it works
- While the feature is enabled, the driver stores in a persistent field the
On Levelvalue set in the capability, that is, the app or the routine action Write On Level. - When a report from the light arrives, it processes it as usual and changes the capability value but then checks if the value is different and it was not the user doing it. In that case it will write the old value to the light, reverting the change made by the light.
- To prevent infinite loops where a stubborn light or other platforms may react by changing the value, the driver will not enforce the value again if it already enforced it within the last 3 seconds.

