HS vs. Color Temp in Scenes

I’m setting up Home Assistant to talk to some Govee RGBW lights via HACS.

When I set up the scene, I set some of the lights via color temperature (different intensities of white) and others via color. It looks fine when I’m making the scene. But when I go to activate the scene later, all of the whites show up as an RGB approximation of white (i.e. much duller).

I had a look at the yaml. The configuration says color_mode is compatible with both hs and color_temp. Each light has the color temperature field set to the appropriate Kelvin value that I set in the config. But the color_mode, on ALL the lights, is hs. I changed it manually to color_temp, and upon activating the scene, the lights turned the proper white.

But… why is it being set to hs?

Is there something to do within the UI to make the color “stick” as a color temperature rather than hue/saturation? Is this a bug in HA or HACS or the plugin I’m using, or…?

Which integration are you using to connect to your Govee lights?

I have seen reports that the Homekit integration has the same issue with Lifx lights due to API limitations with Homekit, whereas the Lifx integration does not have this limitation.

I’m using this one: https://github.com/LaggAt/hacs-govee/blob/master/README.md

I have the problem even if I’m setting the colors via Home Assistant (on the website) though, not even going through HomeKit. (Unless maybe something about HomeKit being in the loop causes the problem)

Hmm, looking at the code, my guess is this might be the culprit…

It looks like, if the light supports a combination of HS and Color Temp, it defaults to HS.

Lines 242-249:

 def color_mode(self):
        """Return current color mode."""
        if self._fixed_color_mode:
            return self._fixed_color_mode
        # Support for ct + hs, prioritize hs
        if self._color is not None:
            return ColorMode.HS
        return ColorMode.COLOR_TEMP

Another possibility in https://github.com/home-assistant/core/blob/b2b57c5f87a519af951a9d1ca8777f5ae3517b92/homeassistant/components/homekit_controller/light.py#L99

    def color_mode(self) -> str:
        """Return the color mode of the light."""
        # aiohomekit does not keep track of the light's color mode, report
        # hs for light supporting both hs and ct
        if self.service.has(CharacteristicsTypes.HUE) or self.service.has(
            CharacteristicsTypes.SATURATION
        ):
            return ColorMode.HS

        if self.service.has(CharacteristicsTypes.COLOR_TEMPERATURE):
            return ColorMode.COLOR_TEMP

        if self.service.has(CharacteristicsTypes.BRIGHTNESS):
            return ColorMode.BRIGHTNESS

        return ColorMode.ONOFF

So it appears that if both HS and Temp are supported, it will just use HS. There’s no setting, no option, that’s just what the code stores as the color mode.