Hue lamps flash when turning on scene

Hi all,

I have multiple Philips Hue lamps in my setup. I am turning them on by using a dummy-shelly, which triggers an automation, which in turn activates a scene. That scene defines the lamps that should turn on, their brightness, and their color temp. The scene includes a Philips pendant light (two seperate entities, one up, one down) and three standard bulbs. They all have different values set in the scene.

I recently updated to Home Assistant core 2022.9.0.dev20220826. Since then, the two lights in the pendant light give a quick flash every time they are turned on via a scene (i.e. turn on, immediately turn off and turn on again - all in a matter of less than a second).

This was not the case before the HA update. The bulbs work just fine, only the pendant light is affected.

I did some troubleshooting:

  • Turning on lamps via Philips Hue app → works fine
  • Turning on lamps directly in the HA app (no automations/scenes) → works fine
  • Activating scene directly (no automation) → LAMP FLASHES
  • Integrating lamps directly into the automation (no scenes) → works fine

So it seems like there is an issue with the scene. I am pasting the code of the scene below:

- id: '1615232060883'
  name: Essen
  entities:
    light.hue_color_pendant_up_1: # THIS ONE FLASHES
      min_mireds: 153
      max_mireds: 500
      effect_list:
      - None
      - candle
      - fire
      supported_color_modes:
      - color_temp
      - xy
      color_mode: color_temp
      brightness: 255
      color_temp: 230
      hs_color:
      - 26.722
      - 28.925
      rgb_color:
      - 255
      - 214
      - 181
      xy_color:
      - 0.401
      - 0.359
      effect: None
      mode: normal
      dynamics: none
      icon: mdi:wall-sconce-flat-variant
      friendly_name: Esstischlampe oben
      supported_features: 44
      state: 'on'
    light.hue_color_pendant_down_1: # THIS ONE FLASHES
      min_mireds: 153
      max_mireds: 500
      effect_list:
      - None
      - candle
      - fire
      supported_color_modes:
      - color_temp
      - xy
      color_mode: color_temp
      brightness: 175
      color_temp: 359
      hs_color:
      - 28.217
      - 63.073
      rgb_color:
      - 255
      - 169
      - 94
      xy_color:
      - 0.517
      - 0.386
      effect: None
      mode: normal
      dynamics: none
      icon: mdi:wall-sconce-flat
      friendly_name: Esstischlampe unten
      supported_features: 44
      state: 'on'
    light.stehlampe_oben:
      min_mireds: 153
      max_mireds: 454
      supported_color_modes:
      - color_temp
      color_mode: color_temp
      brightness: 255
      color_temp: 346
      hs_color:
      - 28.016
      - 59.968
      rgb_color:
      - 255
      - 173
      - 102
      xy_color:
      - 0.507
      - 0.384
      mode: normal
      dynamics: none
      icon: mdi:floor-lamp-dual
      friendly_name: Stehlampe oben
      supported_features: 40
      state: 'on'
    light.stehlampe_mitte:
      min_mireds: 153
      max_mireds: 454
      supported_color_modes:
      - color_temp
      mode: normal
      dynamics: none
      icon: mdi:floor-lamp-dual
      friendly_name: Stehlampe mitte
      supported_features: 40
      color_mode: color_temp
      brightness: 255
      color_temp: 346
      hs_color:
      - 28.016
      - 59.968
      rgb_color:
      - 255
      - 173
      - 102
      xy_color:
      - 0.507
      - 0.384
      state: 'on'
    light.stehlampe_unten:
      min_mireds: 153
      max_mireds: 454
      supported_color_modes:
      - color_temp
      mode: normal
      dynamics: none
      icon: mdi:floor-lamp-dual
      friendly_name: Stehlampe unten
      supported_features: 40
      color_mode: color_temp
      brightness: 255
      color_temp: 346
      hs_color:
      - 28.016
      - 59.968
      rgb_color:
      - 255
      - 173
      - 102
      xy_color:
      - 0.507
      - 0.384
      state: 'on'
    switch.schalter_entertainment:
      icon: mdi:light-switch
      friendly_name: Schalter Entertainment
      state: 'off'
    switch.schalter_kuche:
      icon: mdi:light-switch
      friendly_name: Schalter Küche
      state: 'on'
  icon: mdi:silverware
  metadata: {}

I would like to keep using scenes (or a reasonable alternative), as it makes setup and maintenance a lot easier than setting the different light settings in various automations.

Do you have any idea what the issue is here and how it can be resolved?

Thanks a bunch!

//Edit: I have setup the scene via the visual editor in HA core-2021.4.3

Same problem here, my scene was created in the HUE app and activated by an automation, but if I activate it directly or in the HUE app I get the same result, so I’m thinking that this might be a HUE problem. The bulbs are BR30 color.

Interesting, that you, unlike me, have the issue even through the Philips App directly…

Anybody got any ideas?

Did you manage to fix this? Only my Hue lights do this while my other lamps are fine.

Unfortunately not, still the same issue.

Turns out you can supply the scene turn_on service with a transition time.
So when I call that scene I just set a
"transition": 0.5
and it fixes the flashing

Hi there

Interesting idea and glad it works for you!
Unfortunately, it does not resolve my issue.

I also only have the flashing issue with two of my hue lamps (hue pendant lamp) and not with other hue bulbs.

Would still be amazing if anybody had any great ideas :slight_smile:

Alright, so for my use case I have “fixed” this in a way that shouldn’t be necessary, but at least it no longer flashes.

I have ditched the Hue Bridge and instead connected my bulbs via the SkyConnect using Zigbee. And suddenly there’s no flashing anymore. Even though I am using the exact same setup with scenes and automations. :man_shrugging:

So if you have similar issues: look into this. Considering that having multiple hubs running for different zigbee devices is obsolete anyway, this might be a win-win for you :slight_smile:

I am using the Philips Hue hub and I had this issue with “Flickering” and out-of-sync light changes (not all change at the exact same time) when trying to turn on a Home Assistant-based scene. Instead, I created a script to use with custom component pyscript, which allows me to update a native Philips Hub-based Scene and then call that scene. It’s annoying but it works really well:

Interesting approach, thanks!
I myself am pretty happy with the switch to SkyConnect as it has overall simplified my setup with various brands now using a single hub.

But I’m sure others will benefit greatly form this link!

That is a nice solution. I made a script to save the lights state, using a group helper for the lights and a input_text helper to store the data, then I discovered that I could use the scene snapshot to simplify things but ended with the lights flickering on scene activation, so I found this thread searching a way to fix it.

Here is my script in case is useful to someone:

ht_light_save:
  alias: Home Theater Light Save State
  sequence:
    - service: input_text.set_value
      data:
        entity_id: input_text.ht_light_saved_state
        value: >
          {% set lights = state_attr('light.home_theater_lights','entity_id') %}
          {% set ht_light = namespace(lights=[]) %}
          {% for light in lights %}
            {% set light_json = {
                      "entity_id": light,
                      "state": states(light),
                      "rgb_color": state_attr(light,"rgb_color"),
                      "brightness": state_attr(light,"brightness")
                    } %}
            {% set ht_light.lights = ht_light.lights + [ light_json ] %}
          {% endfor %}
          {{ht_light.lights|to_json}}

ht_light_restore:
  alias: Home Theater Light Restore State
  sequence:
    - variables:
        saved_state: "{{states('input_text.ht_light_saved_state')|from_json}}"
    - repeat:
        for_each: "{{saved_state}}"
        sequence:
          - if:
              - condition: template
                value_template: "{{ repeat.item.state == 'on' }}"
            then:
              - service: light.turn_on
                data:
                  entity_id: "{{repeat.item.entity_id}}"
                  brightness: "{{repeat.item.brightness}}"
                  rgb_color: ["{{repeat.item.rgb_color[0]}}","{{repeat.item.rgb_color[1]}}","{{repeat.item.rgb_color[2]}}"]
            else:
              - service: light.turn_off
                data:
                  entity_id: "{{repeat.item.entity_id}}"

Using this it doesn’t flicker (since its not really using scenes), the only caveat is that input_text can only hold 255 characters max, my light group only has 2 lights but with a bigger group it will fail, so I thought to replace input_text with this Home Assistant Variables component if needed.

Anyway I think your pyscript is more efficient and less prone to hiccups using the hue bridge api, I’ve tested it and it works smoothly, thank you for sharing.