How to support the new setColorTemperature multi parameter command in user drivers

Platform version 2.2.6 included an extension to the setColorTemperature command, which included optional level and transition time parameters (see this post for a brief overview of all 2.2.6 capability updates).

The primary reason for this change was to allow applications to include level and or transition time parameters in the setColorTemperature command along with the colorTemperature, previously an app needed to make a call to setColorTemperature, then a separate call to setLevel, in many cases one command or the other would not be accepted by the device as the commands were sent one directly after the other.

By including level and or transition time in the setColorTemperature command the driver can include an appropriate delay between the native setColorTemperature and setLevel commands as required by the device such that it responds correctly.

Platform 2.2.8 included updates to all the internal drivers and applications to implement and use the new multi parameter command version.
If a given application makes a setColorTemperature call that includes a level parameter to a user device that has not implemented support for the additional parameters an error similar to the following will be generated in the live logs:


To recover from this error the given driver needs to implement an interface to accept and process the setColorTemperature commands with multiple parameters.
This can be accomplished by updating the method call from setColorTemperature(colorTemp), to
setColorTemperature(colorTemp, level = null, transitionTime = null)
The remainder of the method updates required to process level and or transition time are dependent on the existing device and driver implementation.
To give you a general idea of one implementation, please see this driver code starting at line number 473.

4 Likes

Is this at all related to the Scene-1.2 fix implemented in 2.2.8.136?

Yes. All of the built-in apps were updated to use the new ColorTemperature method. However, there was a mistake made in Scene-1.2 in that regard, and that was fixed (took two releases due to a build glitch).

2 Likes

Ok so built in drivers are working as intended now but community or manufacturer built drivers may still need updates?

Correct.

Perfect, thank you!

Hubitat's driver for the Zooz Zen31 does not work with the new ColorTemperature method, so not all built in drivers are working yet.

The Zooz Zen31 driver that is currently built-in doesn't even have Color Temperature. What driver are you using?