Error with setLevel on ZigBee White Color Temperature Bulb

I was trying to set dimmer via Rule Machine, but kept getting these errors in log with no change in level.
image

image
I noticed in the device handler that there are two fields for setLevel. As soon as one of them are empty, the same error is visible in the log and the level will not change.

So, I guess that Rule Machine only tries to set one of the values, and therefore runs into this error? What is the purpose of the "second" field (I can't trial and error, as I have to fill out both).

Maybe I have missed something obvious. :slight_smile:

EDIT: Okay, I had missed something obvious. If I specify a "Transition Time", everything works. Maybe a default value could prevent some confusion there?

First value is brightness in %, from 0-100. Not all devices support 0. Second value is fade time in seconds. Not all devices support fade time, but a value is required for devices that do.

@mike.maxwell there was a suggestion quite a while back to add descriptive labels to the dimmer numbers. Any chance that’s on the short list?

I found out that I have to fill out "Transition Time" in the separate field further down as well.
image

That field is empty/null by default. Just adding a 1/0 there solved the error!

Yep, a preassigned value would be an easy enough fix, I’d imagine.

I believe the problem is that empty fields = Null. And you can't do math on Null. Two workarounds, 1) fill in the blanks, put a number in, even zero. 2) add a null detect/replace in the driver(s) where the error is produced.

Example:
I had the same error occur with the Aeon MultiSensor6 V1 DH on line 443

        map.value = (cmd.scaledSensorValue.toInteger() + settings.HumidOffset)

In this case, "settings.(HumidOffset" is the value from the UI.. and is Null. I added a line immediately above to replace null with zero.

        settings.HumidOffset = settings.HumidOffset ?: 0
        map.value = (cmd.scaledSensorValue.toInteger() + settings.HumidOffset)

I then (of course) found I had to do it in 3-5 other places, but now my standard lazy way of completing the Preferences of the device doesn't throw errors.

A replacement zigbee driver (generic zigbee ct bulb) will be in the next release, it will be replacing this one.
Preferences include selectable default transition time, which is used for both the level and temp changes and an option to disable ct updates from turning the bulb on, this will allow for setting the color temp while the bulb is turned off.

1 Like

is this available thru the api as well? if yes what is the syntax?

thank you.

it is not, all "api" commands are shown in the driver details command section.

ok. do you expect to make this available as an api?

I don't expect to extend or make this a separate capability as it's only applicable to zigbee bulbs.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.