Setting color temperature and level independently

I'd like to set color temperature and level independently (from different rules or pistons) on my CT bulbs. The device page, rules interface and piston task have a field for specifying level when you adjust color temperature. The level field is not marked as required and it is not labeled as optional. When I leave this field blank, the behavior is unpredictable: sometimes it just changes the color temperature, sometimes it changes the temperature and then turns off. Is there a reliable way to adjust the color temperature without affecting the level?

As an aside, allow me to point out that setting the CT from within certain apps on certain bulbs may not give you the desired or expected results.

Notably, I recently fought with getting a particular Scene to "Set" (and remain "Set") in Room Lighting, but the scene Activator kept maddeningly going "Off" despite the Scene still being marked as (Active).

The culprit turned out to be a Hue bulb that I had instructed RL to set to CT = 3000, but for some reason the bulb reported 3003 to Hubitat, forcing a mismatch in values. Thus...

PRO TIP: Set your bulbs the way you want them for a particular scene, allow them time to settle, and then use the RE-CAPTURE mechanism in RL (or other app) to quantify CT and any other parameters accurately for you.

The level parameter is optional, and standard behavior when specifying only color temperature (the only required parameter) is to turn the bulb on to that color temperature without affecting level. (Some drivers have a "color prestaging" option that will just set the color temperature without turning the bulb on if it is not currently on, but I would discourage use of that setting unless you absolutely need it for some reason, and it will likely be replaced with new "preset..." commands, as this seems to slowly be getting standardized at the platform level).

So, the fact that your devices aren't doing this reliably is odd. What devices (brands/models) are they, and what drivers are you using for them?

(The scene issue above is, perhaps, interesting but unrelated, but even if this does happen to you, the state of the activator device is just an indicator and won't do anything on its own unless the activator device itself gets such a command.)

1 Like

It is happening with a couple of different types of bulb and different drivers. Two I'm actively working on are:

  • LIGHTIFY BR Tunable White using Generic Zigbee CT Bulb (dev) driver
  • Sengled E21-N1EA using Sengled Element Color Plus driver

I have tried different drivers and twiddling with the prestaging options. I can get reliable behavior if I always specify a level with the color temperature but otherwise it can be unpredictable.

I would definitely leave prestaging off if you have no preference.

The next thing I'd try is hitting "Configure" on the device detail page for each, especially since it sounds like you've switched drivers. My guess--maybe the bulbs aren't reporting "level" correctly all the time under "Current States"? A "configure" may help with this.

1 Like

Thanks, this seems to have helped. It's been unpredictable so I'll have to watch it for a while to see how it goes.

1 Like

A couple days later, this started happening again. Configure did not clear the issue. It looks like turning the bulb off and on again seems to be what helped this time.

A related issue is this and other bulbs are intermittently having other state synchronization issues. There are a couple of threads that seem to discuss this but I'm not clear what the resolution was.

I've turned on debug logging and descriptionText logging and captured the following for a misbehaving device:

dev:1322022-09-19 09:53:29.466 pm infoKitchen Sink is on
dev:1322022-09-19 09:53:29.463 pm debugevt- rawValue:1, value: on, descT: Kitchen Sink is on
dev:1322022-09-19 09:53:29.461 pm debugParse: read attr - raw: 5E9B0300060A00001001, dni: 5E9B, endpoint: 03, cluster: 0006, size: 0A, attrId: 0000, encoding: 10, command: 01, value: 01
dev:1322022-09-19 09:53:29.402 pm infoKitchen Sink is 99%
dev:1322022-09-19 09:53:29.400 pm debugevt- rawValue:252, value: 99, descT: Kitchen Sink is 99%
dev:1322022-09-19 09:53:29.397 pm debugParse: read attr - raw: 5E9B0300080A000020FC, dni: 5E9B, endpoint: 03, cluster: 0008, size: 0A, attrId: 0000, encoding: 20, command: 01, value: FC
dev:1322022-09-19 09:53:28.315 pm infoKitchen Sink is 99%
dev:1322022-09-19 09:53:28.313 pm debugevt- rawValue:252, value: 99, descT: Kitchen Sink is 99%
dev:1322022-09-19 09:53:28.310 pm debugParse: read attr - raw: 5E9B0300080A000020FC, dni: 5E9B, endpoint: 03, cluster: 0008, size: 0A, attrId: 0000, encoding: 20, command: 01, value: FC
dev:1322022-09-19 09:53:28.284 pm infoKitchen Sink is 99%
dev:1322022-09-19 09:53:28.281 pm debugevt- rawValue:252, value: 99, descT: Kitchen Sink is 99%
dev:1322022-09-19 09:53:28.279 pm debugParse: read attr - raw: 5E9B0300080A000020FC, dni: 5E9B, endpoint: 03, cluster: 0008, size: 0A, attrId: 0000, encoding: 20, command: 01, value: FC
dev:1322022-09-19 09:53:28.170 pm debugParse: catchall: 0104 0008 03 01 0040 00 5E9B 00 00 0000 0B 01 0400
dev:1322022-09-19 09:53:27.945 pm infoKitchen Sink is on
dev:1322022-09-19 09:53:27.943 pm debugevt- rawValue:1, value: on, descT: Kitchen Sink is on
dev:1322022-09-19 09:53:27.940 pm debugParse: read attr - raw: 5E9B0300060A00001001, dni: 5E9B, endpoint: 03, cluster: 0006, size: 0A, attrId: 0000, encoding: 10, command: 01, value: 01
dev:1322022-09-19 09:53:27.746 pm debugParse: catchall: 0104 0008 03 01 0040 00 5E9B 00 00 0000 0B 01 0400
dev:1322022-09-19 09:53:27.410 pm debugParse: catchall: 0104 0300 03 01 0040 00 5E9B 00 00 0000 0B 01 0A00
dev:1322022-09-19 09:53:27.353 pm debugsetLevel(12, 1)
dev:1322022-09-19 09:53:27.351 pm debugsetLevel(12)
dev:1322022-09-19 09:53:27.327 pm debugsetLevel(99, 1)
dev:1322022-09-19 09:53:27.325 pm debugsetColorTemperature(2700, null, null)

My automation would have set color temperature to 2700 and level to 12 in two separate back-to-back driver calls. I'm not sure where these extra level setting calls are coming from. I suspect debugsetLevel(99, 1) is the worst of it here. At the end of this, the bulb is at 99 brightness so the 12 brightness command is lost or ignored.

I may need some @support_team assistance with this.

I think I figured out what's going on here and have a workaround.

When you add a "Set Color Temperature" task in WebCoRE the default is to fill the optional Level parameter with a Value of 0. A value of 0 is not the same as a null value which would tell the device handler to leave the level as it is.

What appears to work to make color temperature changes without affecting the level is to change the Level parameter from a value of 0 to an empty expression. That is, select the Value pulldown associated with the Level parameter and select Expression. Then make sure the expression field is left blank.