Color temperature with optional level


#1

CT bulbs using the standard Hubitat driver support an optional level adjustment when setting color temperature. Two problems:

1/ If a level adjustment is specified when you’re setting up the action, it does not appear in the displayed source code. The level adjustment does work as expected but, without editing the statement, you wouldn’t expect a level change.

2/ The optional level field in tasks setup defaults to a value of 0. Specifying a valid color temperature and level of 0 appears to be an ambiguous command. Sometimes the bulb just changes the color temperature and sometimes it turns off. If you just want to change the color temperature and leave the level where it is, as a workaround, you can change the level field from ‘value’ to ‘expression’ and leave the expression field blank. It would be more clear and less error prone if the optional level field got a ‘nothing selected’ option and this was the default for new tasks.


#2

I can post an update for the parameters showing (#1).

Will have to speak with @ipaterson on how to not set a value (beyond what you did as a workaround).


#3

You’re in luck, these are essentially the same fix. @E_Sch, add a d to make the level optional and to show it in the statement:

{
    "n": "Level",
    "t": "level",
    "d": " and set level {v}"
}

Then change the command spec to display it (where {2} is the level parameter and {1} is the switch state parameter):

{ ..., d: 'Set color temperature to {0}°K{2}{1}' }


#4

I think the last question is how does he not provide a value for level and duration (without using the blank expression workaround.


#5

There is a fix posted if you have the user install of webCoRE on HE

hpm repair on webCoRE to get this (I have not pushed it to everyone, hence the hpm repair)


#6

It’s all the same fix, adding the d parameter will default it to Not Set rather than zero.


#7

Thanks so much. I have WebCoRE installed with Hubitat Package Manager. I don’t see an update available there yet but I will watch for it. Thanks again.


#8

do an hpm repair to get it

I have not pushed it to everyone, but HPM repair will pick it up.