Hue Light Automation Bug? Or bad automation?

Then your problem is with Hue

HA can only know what Hue tells it. If Hue says it was turned off then clearly HA has to believe that.

Thanks Tinkerer. Do you think I will still have this problem if I replace the Philips Hue Bridge V0.2 with a generic ZigBee 3.0 coordinator?

But why is the automation different from manually toggling the lights from the dashboard? The dashboard has no problem turning off the lights, but the automation reliably fails.

Edit: Never mind… I just realised your problem is with the light status reported in Home Assistant.

Try this:

- alias: "Turn on the light"
  service: light.turn_on
    brightness_pct: !input light_brightness
    entity_id: !input light_target

haha thanks Edward. I’d already tried that snippet of code in both of the configurations in my original post anyway. But I appreciate the help regardless.

Yeh, the status, and the inability to turn off the lights within an automation.

Have you tried to call those services one by one on the Developer tools window and see if you get it working properly?

I mean call the light.turn_on with the parameters you have on your automation, then call the light.turn_off, etc.

If everything works fine on Developer tools, then you probably have something in your automation.

Do you realize the mode: restart is an important part of that original blueprint? That is what allows the light to stay on while movement is around. By using single you will always turn off the light be or turn it on again if the movement is continuing.

Thanks, I didn’t think of that. The Developer Tools produced the same result as the automation.

In the screenshot below, I have the 2 windows with Home Assistant. On the left, I’ve set up the light.turn_on service with brightness_pct = 20%. On the right, I’ve set up the light.turn_off service.

When I click Call Service to call the turn on service, the light turns on with 20% brightness. The Call Service button is replaced by a green tick for a few seconds, and then fades back to the original blue Call Service button.

When I click Call Service to call the turn off service, the light stays on, but the Call Service button is still replaced by a green tick that fades back to the original blue button. And both the Home Assistant Dashboard and Philips Hue app think the light is off.

I don’t have this problem manually toggling the light from the dashboard (or Philips app), and I can reliably toggle it quite fast without any error.

EDIT: Just like with automations, removing the brightness setting from the Developer Tools turn on service allows the turn off service to work, further proving that the brightness setting is potentially doing something it shouldn’t.

I used to use restart, but I was told not to in a reply to this post I made.

Either way, comment 4 from this thread does use mode: restart and that produces the same result. If I don’t try to set brightness or colour when calling the light.turn_on service, the light cannot turn off when light.turn_off is called. However, without setting brightness or colour, the light can turn off ok. Comment 4 is a copy/paste of the original blueprint, but with a brightness setting added.

EDIT: comment 6 if you’re looking at the URL, or comment 4 if you’re looking at the side bar.

1 Like

The fact that Developer Tools also can’t turn the light off proves that it’s not the way the automation config YAML is done (but I still appreciate the feedback anyway because it helps me in the long run).

To simplify the problem, why does adding brightness or colour to the light.turn_on service prevent the light.turn_off service from working?

I ditched Hue and went direct with a CC2562 coordinator and haven’t looked back. Much more reliable and stable than I ever got Hue to be.

Developer tools doesn’t actually change the state of anything, just what HA thinks.

Your light target

Is that a single light bulb. Or a group of bulbs defined as a group in Home Assistant?

If the latter than it is common problem that some zigbee systems handle multiple almost simultaneous changes very badly. Especially when there are attributes involved like intensity and colour.

What can happen is that the zigbee net gets flooded with messages and the some bulbs never get the message

I have also seen bulbs go in limbo where they ignore direct messages but still turn on and off with true zigbee group messages.

You want to avoid sending messages to multiple bulb simultaneously and individual messages and instead send single messages to predefined zigbee groups. I believe both ZHA and Zigbee2mqtt supports defining zigbee groups now. I use deconz and it has always supported making light groups that appear as a single light entity in HA.

Creating a group of lights with the HA group feature means that HA sends a flood of individual messages and that is asking for trouble

Thanks Kenneth,
That’s especially good to know for when I start adding more automations.

It sounds like you’re describing intermittent problems. Is that correct?
What I’m describing is 100% repeatable. Every time the turn on service is called with a brightness setting, the turn off service fails.

I’ve used Hue/ZigBee groups, multiple lights individually, and also just single lights.
The traces and logs I posted earlier are from an automation with only a single motion sensor and a single light. Although, groups behave in the exact same way as individual lights.

Thanks. I’ve been thinking about switching to see what happens.

But this seems way too repeatable to just be a reliability problem. To quote myself:

Does anybody else have a Hue Bridge V2 and some Hue lights to run these same tests with? Or if nobody with that setup is seeing this post, maybe someone with a Hue Bridge V2 and 3A Nue lights that are meant to be a decent clone?

I can’t replicate the problem you’re experiencing where the physical light remains on yet both Home Assistant and the Hue app indicate it’s off. In my case, the physical light’s state is always in sync with the state reported by the Hue app and Home Assistant.

Here’s the experiment I performed (let me know if you want me to try something different):

I used this to turn on a Hue light.

        service: light.turn_on
          brightness_pct: 20
          entity_id: light.hallway_lamp

and this to turn it off

        service: light.turn_off
          entity_id: light.hallway_lamp

The physical Hue light successfully turned on to 20% brightness and then turned off.

Thanks @123. The behavior seems to change if I target a Hue room, as opposed to individual lights.

I made a video to show what’s happening. Is this what you did?
Sorry about the quality; I’m definitely not a YouTuber.

  • Home Assistant 2022.10 (I updated this morning)
  • Philips Hue Bridge V2 (the square one)
1 Like

Hi i think ive got the same issue with the build in motion light automation,
Home Assistant 2022.10.5
Supervisor 2022.10.1
I’m using frigate + zigbee aqara lamp. My supervised HA updates by itself to latest version.
It used to work before this.

  1. Turning lamp manually works, so not zigbee issue
  2. The automation only works for turning on after off. But not the other way around.
  3. Frigate correctly display on/off state, so not frigate issue.
    Is there any workaround or fix yet?

I have the same problem too. Has HA fixed this? Mine is kinda random though, it does not turn off at times.

Hi, was there a fix for this? I’m having exactly the same issue with turning off hue lights from an automation (in my case, trigger from a smart light switch).

I’ve tried turning on the lights individually (no brightness settings), turning on all lights via a scene-but no matter what, turning them off results in some staying on (different ones each time).

Also the hue hub/app thinks they’re off and I have to toggle the lights in the hue app to turn them off.


@sgjonathan and @mcoughlin22
Is this the issue you’re having? This test was done with 3A Nue smart lights that claim to work in place of Philips Hue lights. I haven’t tested other lights that claim to work as Hue lights but I imagine the last thing I mentioned about the Fade to Off command being a problem for a lot of clones.

Was this issue ever solved or do you still have issues? I have a very similar issue that I cannot switch off lamps, even if HA reports them as off. It looks like it involves IKEA colortemp tunable bulbs together with my deconz conbee stick. See here: deCONZ - Official thread - #3467 by Robban and deCONZ - Official thread - #3470 by phsdv (same thread)
I first noticed this early 2023, bit it could have been there before. It is still an issue for me.