Hue Lights Not All Turning On

Hello,

I have been having issues with my hue lights (Lily’s to be exact) not all turning on and or setting to the specified brightness for my sunset automation.

I created a group in Home Assistant for the Lily’s (and other exterior lights) and am not using the Hue Bridge group names. In this post, I have seen that the Home Assistant will send x requests, one for each light, and the Hue Bridge (ZigBee) will send 1 for all lights.

I would love to use the the Hue Bridge groups, but my automatons do not always use the same settings for every light or every other light.

An example of this is as follows below - Are there any better ways / suggestions to do this and achieve the correct brightness / color / power toggle every time?

custom_lights_on:
  sequence:
    # Red
    - service: light.turn_on
      data:
        brightness_pct: 100
        color_name: red
        entity_id:
          - light.exterior_lily_1
          - light.exterior_light_1
        transition: 3
    # Green
    - service: light.turn_on
      data:
        brightness: 136
        color_name: green
        entity_id:
          - light.exterior_lily_2
          - light.exterior_lily_3
          - light.exterior_lily_5
        transition: 3
    - service: light.turn_on
      data:
        brightness: 174
        color_name: green
        entity_id:
          - light.exterior_light_2
        transition: 3
      #Blue
    - service: light.turn_on
      data:
        brightness_pct: 100
        color_name: blue
        entity_id:
          - light.exterior_lily_4
          - light.exterior_light_3
          - light.exterior_light_4
        transition: 3

So let me go back to basics here, I used bridge groups in this example and still not all of the lily’s are going to the designated brightness. I figured I would add a delay in there so the lily call from the bridge had a chance to catch up the other exterior lights turn on.

Any idea what is going on here?

**Automation:**
- alias: Exterior Lights - Sunset - On
  initial_state: true
  trigger:
    - platform: sun
      event: sunset
  action:
    - service: script.exterior_lily_on
    - delay: '00:00:01'
    - service: script.exterior_lights_on

**Scripts:**	
exterior_lily_on:
  sequence:
    - service: light.turn_on
      data:
        brightness: 255
        color_temp: 276
        entity_id:
          - light.all_exterior_lily
        transition: 1

exterior_lights_on:
  sequence:
    - service: light.turn_on
      data:
        brightness: 255
        color_temp: 276
        entity_id:
          - light.all_exterior_lights
        transition: 1	

I have similar issues with my Hue lights as well. I have a bunch, including the Lily and others. The usually work. But when they don’t, what seems to happen is one of two things:

  1. One (random) light in a group is sometimes missed and does not turn on at all
  2. A light or group of lights turns on, but retains the color and brightness that it was previously set to last time it was on

To get around this, I created what I call “scene settings” scripts for each light/group. I guess this is probably similar to the scripts you have created. Here are a couple of my examples:

patio_spotlights_bright:
  sequence:
    - service: light.turn_on
      data:
        entity_id: light.patio_spotlights
        brightness: 255
        rgb_color:
            - 255
            - 211
            - 132

kitchen_cabinet_lights_movie_night:
  sequence:
    - service: light.turn_on
      data:
        entity_id: light.kitchen_cabinet_lights
        brightness: 229
        rgb_color:
            - 88
            - 0
            - 255

Then in an automation, I execute which ever scene setting script I want. Then I add a 1 second delay and execute the same script a second time.

So your automation might look a little more like this:

- alias: Exterior Lights - Sunset - On
  initial_state: true
  trigger:
    - platform: sun
      event: sunset
  action:
    - service: script.exterior_lily_on
    - service: script.exterior_lights_on
    - delay: '00:00:01'
    - service: script.exterior_lily_on
    - service: script.exterior_lights_on

It is terribly inelegant, but it seems to work. And having the settings encapsulated into small reusable scripts has been useful. But hopefully someone way smarter than me will chime in with a better solution!

Hi! Thanks for the reply.

I like your thought here! I was thinking of trying the same thing. Have you ever had any issues with lights not going to the right color or brightness with your method, more so after the second execution after the delay?

Once in a while it doesn’t work, but most of the time it is pretty solid. I have the most trouble with my exterior lights, presumably because they are the farthest from the Hue bridge. Although, Hue lights are supposed to form a mesh network so if one works, the one next to it should work as well. It could also be some kind of interference from nearby homes. So for my exterior lights, I do it a little differently. I have multiple triggers occurring every few minutes. This method seems to work well. If one light is missed but turns on 10 minutes later, I don’t really care because it is outside lighting.

# Outside Lights - Evening
- id: outside_lights_evening
  alias: 'Outside Lights - Evening'
  initial_state: true
  trigger:
    - platform: sun
      event: sunset
      offset: "-00:20:00" # Fires 20 minutes prior to sunset
    - platform: sun
      event: sunset
      offset: "-00:15:00" # Fires 15 minutes prior to sunset
    - platform: sun
      event: sunset
      offset: "-00:10:00" # Fires 10 minutes prior to sunset

  action:
    - service: script.outside_lights_on

Thanks! I even moved my bridge to be closer to where the outside lights are.

For my automation, I’m using sun elevation since it seems to match a little better in my area.

Have you ever had issues with a light not turning on by the 3rd execution not working if the first 2 didn’t?

I’m pretty sure they are all good by the second try. The third one is in there as a backup. It doesn’t really hurt anything to have multiple tries in there, so add as many as you feel comfortable with.

Hue also has a method for changing the channel that it runs on, in the event that you do have a lot of interference in your location. I did try that. Not sure if it helped or not. But you might want to look into that as well.

Thank you very much for your help!

1 Like

With the 0.113 release, I think we’re lucky with the repeat option!

1 Like

Wow, I hadn’t read about that yet. Repeat would definitely simplify this!

I tested a few variations in my office since I have Hue’s and really like that it was implemented.

For my outdoor lights, I’m doing a count: 5 and delay seconds: 5. For whatever reason, if the Hue Bridge gets bogged down, it has a chance to recover before the next call in 5 seconds.

I did have a transition in my script, once I removed that things seemed to even out without the second call from our initial example.

For what you posted, something like this:

# Outside Lights - Evening
- id: outside_lights_evening
  alias: 'Outside Lights - Evening'
  initial_state: true
  trigger:
    - platform: sun
      event: sunset
      offset: "-00:20:00" # Fires 20 minutes prior to sunset
  action:
    repeat:
      count: 3
      sequence:
      - service: script.outside_lights_on
      - delay:
          seconds: 5

While this could be used via automation or script, which one would you add it to? I tried it both ways, and since I have a lot of outdoor automation’s & scripts for my lights to change colors, I’ll keep the loop portion in the automation, and the script strictly for the color/brightness.

@MontyRisk Thank you SO much for telling me about repeat. I would have read about it when I updated my HA anyway, but I might not have immediately realized how I could apply it. I did a LOT of clean script and automation clean up tonight. Fingers crossed that everything works well!!