Light Group Mysteriously Turned On When Automation Triggered One Member of Group

Hello,

Saw some weird behavior when I used a button triggered automation to turn on my living room lights. All of the downstairs lights turned on after when, as I understand it, they should not have:

Automation pasted here and below: brightclickweirdresults - Pastebin.com

alias: "[Livingroom Lights] [Styrbar Remote 2] Bright Click"
trigger:
  - platform: device
    domain: mqtt
    device_id: c820eb614f972e1cdc9123c84a214dfb
    type: action
    subtype: "on"
    discovery_id: 0xb43a31fffe94a82d action_on
condition: []
action:
  - if:
      - condition: state
        entity_id: light.livingroom_lights
        attribute: color_mode
        state: xy
    then:
      - condition: state
        entity_id: light.livingroom_lights
        attribute: color_mode
        state: xy
      - service: light.turn_on
        data:
          color_temp: 320
          brightness_pct: 100
        target:
          entity_id: light.livingroom_lights
  - if:
      - condition: device
        type: is_off
        device_id: 32e3efd7873e27f6ad7c7f62b14e3b6e
        entity_id: ba8e72ed1c7ae4afcf45c4df1a723101
        domain: light
      - condition: or
        conditions:
          - condition: device
            type: is_off
            device_id: 7a83564b8f63d0c1de631d4ba6871bf3
            entity_id: 11c8721be264626324b9f7d1efb889f8
            domain: light
      - condition: or
        conditions:
          - condition: device
            type: is_off
            device_id: fbadb164d2c8f2d7e80b4c602fcf8904
            entity_id: baffe14a99a806e3dfb18d2f6d136a29
            domain: light
    then:
      - service: light.turn_on
        data:
          color_temp: 320
          brightness_pct: 100
        target:
          entity_id: light.livingroom_lights
    else:
      - device_id: 9a098e39ab2812f28fb847aa0715e1de
        domain: light
        entity_id: 2359c5a06e658a4ec9c8bba6c17ee46c
        type: brightness_increase
mode: single

The devices it is checking are bulbs paired to a Hue Bridge as well as a Hue Group for those three bulbs. I had to use the group for the brightness_increase as they were not in sync doing each bulb individually.

light.livingroom_lights is a member of Downstairs Lights but as I understand it turning on livingroom_lights should only enable the group’s state to show as on, not turn on all other members in the group. Here is how that group is configured:

Any help would be gratefully appreciated. I’ve been able to turn lights on and off in this group without the entire thing lighting up at once. Not sure what happened this time around.

Tried to reproduce this by turning on children of various groups, either bulb entities or groups within groups, and I could not. I was able to turn on single bulbs in groups with no other bulbs going on as well as bulb fixtures groups in rooms with no other fixture groups in the same room group going on.

Your understanding of groups are correct, you can change individual part whit-out the rest should be affected.

The last device in the automation, is for a group. The device I’d, are you sure it is correct? Or could it be the wrong group?

My best guess is you, a some earlier point, had a test automation using the button, which is still running? Might not be visible in the GUI. Try and open automations.yaml and look for automations affecting the full group or device I’d for the full group.

My understanding of groups was that I could turn on a member of the group without every other member of the group turning on at the same time. I wanted to make sure that was accurate before I chased this, otherwise I’d just have to configure my groups differently and call it a day.

I don’t have, nor never had I had, any automations that turn on the group Downstairs Lights and I did a search to confirm that was still true. Searching all files from /root the group for Downstairs Lights only shows up once on, on a dashboard light card.

I grabbed the trace for the automation that went rogue. I’m not sure what else I can use to debut this but it did turn on all of the downstairs lights, no idea why:

I also don’t understand how the automation could still be running, it’s a button click that a light group on they are off or brightens them if they are on. Wish I could break in and see what line it was stuck on… Might switch to AppDaemon for automations if it makes that sort of thing easier.

For the last device in the automation, that is for a group of bulbs I made via the Hue app so they wouldn’t all brighten/dim at different intervals:

This is in the else clause and in this case the lights were off so it hit the then turn on livingroom lights block instead.

Here is the entity for that last group which is configured by device id:

All of the other lights in “Downstairs Lights” are on Zigbee2MQTT as only my Living Room lights go though the Hue bridge (I can’t use their full feature set without doing so and I have the TV rigged up to sync to lights) so that group can’t be tied to them. Side note it would be nice if these device blocks could be configured using friendly names instead of these two non-human readable IDs.

Perfect you have searched for other automations and ruled this out.

As the remaning lights are on Z2M, like the button, it might be a direct binding from the button to the lights. I have never used bindings my self, so someone else might help out. However I have seen a similar problem on a IKEA button (on/off version, do not recall the name as I have dismissed it due to poor battery life). My simple solution was

  1. Delete the button from Z2M, force remove
  2. Reboot HA fully, to secure Z2M restart and everything is gone
  3. Pair the button again, any old binding will be gone

What’s weird is not all of these lights are even in Z2M, only HA groups them together as some are on my hue bridge (unfortunately DiyHue didn’t work well enough for me to eliminate that). Bindings for the Styrbar remote are:

I was able to reproduce this only with the lights in the Downstairs Lights group. Other groups did not exhibit this behavior even when I tried groups of groups like that is. When I configured “All entities” to enabled for the Downstairs Lights groups the behavior went away but the group now shows off basically all the time unless every light downstairs is on. Seems like a bug somewhere as even if it was the intended behavior of “all entities” it’s not consistent across light groups.

I can try re-pairing the remote and see if that helps. I also tried re-creating the “Downstairs Lights” group but that didn’t help. If I re-pair I might just switch this one over to ControllerX, I started using that after I configured this one.

If some of the lights, turning on by error, are on Hue and not Z2M, then bindings are not the reason. This only works inside the zigbee network.

Have you tried to delete the downstairs group totally. Just to see if the behaviour actually stops.

Yes, I had tried that and it’s why it shows up as light.downstairs_lights_2. I even changed some bulbs around in that group so it would be one of a kind to rule out any other things kicking in but that was before I knew about the automation traces.

I can see that. My idea was to delete it and then try and see what happens. Not creating it again before the automation works.