Entity in multiple groups - possible?

Hi,
New HA user running Hass.io.
I have setup some groups for lights to make automations easier. Some of the groups share lights. I have found that if a light is in multiple groups, then when I call that group in an automation (toggle lights when a switch is pressed for example), the lights don’t turn on. If I have the lights in only a single group, then it works calling the group name.

In configuration.yaml

light:
  - platform: group
    name: Group Upstairs Lights
    entities:
      - light.LightStudy
      - light.LightMainBedroom
  - platform: group
    name: Group Lounge Lights
    entities:
      - light.LightLoungeBack
      - light.LightLoungeFront
  - platform: group
    name: Group All Downstairs Lights
    entities:
      - light.LightLoungeFront
      - light.LightLoungeBack
      - light.LightStrip
      - light.LightDining
      - light.LightKitchen

Example automation

- id: '1578023564250'
  alias: Button Dining Single Click
  description: ''
  trigger:
  - event_data:
      click_type: single
      entity_id: binary_sensor.switch_158d000201649a
    event_type: xiaomi_aqara.click
    platform: event
  condition: []
  action:
  - entity_id: light.group_lounge_lights
    service: light.toggle

The above doesn’t work unless I comment out the loungefront and loungeback lights from the All Downstairs Group.

So, most likely answering my own question here, but does this mean that each light can only be a in single group? Or is there another way to do it?

Cheers.

Those entity_id's you’ve given - they’re not valid.

If you were to look in Developer Tools -> States you’ll see the actual, valid, values that you should be using.

1 Like

Thanks for the feedback.

Even with the entities listed as above, the automation works without issue as long as each light is only in a single group. As soon as it’s in more than one group, the automation of turning on that particular light group no longer works.

I will change the entity ID in the group and see if it makes a difference - just changing upper case to lower case from looking in Dev Tools, States as you suggested.

Edit: changing the uppercase letters to lower case seem to now allow same entity in multiple groups. Strange how having uppercase letters and entity only being in one group worked.

Because you found a bug that is extremely edge case.