Light group in groups.yaml does not appear in lovelace

Hi there. I had A few light groups in the configuration.yaml

  - platform: group
    name: Keuken lichten
    entities:
      - light.tradfri_keuken_plafond_1
      - light.tradfri_keuken_plafond_2
      - light.tradfri_keuken_plafond_3
  - platform: group
    name: Woonkamer lichten
    entities:
      - light.hue_bloom_tv_links
      - light.hue_bloom_tv_rechts
      - light.lightstrip_radiator

This worked nice. If I created a new light card in lovelace I could select the groups as an entity.

light.woonkamer_lichten

But then I tried to move these groups to groups.yaml. Trouble started. First of all I needed to change te format because i was getting errors.

light:
  name: Keuken lichten
  entities:
    - light.tradfri_keuken_plafond_1
    - light.tradfri_keuken_plafond_2
    - light.tradfri_keuken_plafond_3

  name: Woonkamer lichten
  entities:
    - light.hue_bloom_tv_links
    - light.hue_bloom_tv_rechts
    - light.lightstrip_radiator

But now I can not select these groups as an entity in lovelace. Can someone explain to me what I’m doing wrong? I can not find any documentation about it.

Because a light group belongs to the light domain and not to the group domain. You can’t define light groups in the same place as you define groups as far as I know.

Your groups.yaml file should look like this

Keuken lichten
  - light.tradfri_keuken_plafond_1
  - light.tradfri_keuken_plafond_2
  - light.tradfri_keuken_plafond_3

Woonkamer lichten:
  - light.hue_bloom_tv_links
  - light.hue_bloom_tv_rechts
  - light.lightstrip_radiator

then in an entity card you can
add
group.keuken_lichten
group.woonkamer_lichten

anyway that is how my groups.yaml file is
my group.master_bedroom has
light
switch
and they all turn on or off

But this way the light group is created in group domain instead of light domain. It is 100% the same funcionslity wise?
BTW it sucks cause moving light group to groups.yaml requires changes in every place of the system where the light group is referenced

well i don’t understand why he wanted to move them in the first place
light group and group are two different things.

Ok I tried both Burningstone and Harry13 suggestions.

First I now created the light groups in lights.yaml (and included this in configuration.yaml)

But stil if I make a light card I cannot select the light groups. even if i manually type in the name of the newly created group. light.keuken_lichten lovelace tels me “entity is not available”

Secondly I created the group like Harry13 suggested in groups.yaml but then love lace tells me “Specify an entity from within the light domain.” And if I take a entity button card I get the “entity is not available” error

I want them to move out of configuration.yaml to make things more readable.

I did not realize that. I guess I do not understand the differences.

1 Like

No it is not. Light groups also allow you to control color and brightness of the whole group for example.

1 Like

then create a light.yaml
add
light: !include light.yaml
and stick it in there

1 Like

You can also easily move groups out of the configuration.yaml, without changing them to light groups.

Just add this to your configuration.yaml group: !include groups.yaml and then put your group config in groups.yaml and remove the group: at the top of the groups.yaml file

Did you restart home assistant after making the changes? Do you see the light.keuken_lichten under Developer Tools -> States?

the confusion is that orginally what you had was under the
lights domain
light:

  • platform: group

the use of the word group as a platform is the part that confused you to assume its a group and belong in the groups.yaml

but they are two completely different things

image

`
Ok. First of al. Thank you both for spending you’re time in helping me so far. I respect that.

Yes I did restart. This how my lights.yaml looks like

- platform: rpi_gpio_pwm
  leds:
    - name: Lightstrip Radiator
      driver: gpio
      pins: [17, 22, 24] #[r, g, b]
      type: rgb
        
- platform: group
  name: Keuken lichten3
  entities:
    - light.tradfri_keuken_plafond_1
    - light.tradfri_keuken_plafond_2
    - light.tradfri_keuken_plafond_3
- platform: group
  name: Woonkamer lichten3
  entities:
    - light.hue_bloom_tv_links
    - light.hue_bloom_tv_rechts
    - light.lightstrip_radiator

This is my groups.yaml

Keuken lichten2:
  - light.tradfri_keuken_plafond_1
  - light.tradfri_keuken_plafond_2
  - light.tradfri_keuken_plafond_3

Woonkamer lichten2:
  - light.hue_bloom_tv_links
  - light.hue_bloom_tv_rechts
  - light.lightstrip_radiator

And this is my configuration.yaml (part of it)

  - platform: group
    name: Keuken lichten
    entities:
      - light.tradfri_keuken_plafond_1
      - light.tradfri_keuken_plafond_2
      - light.tradfri_keuken_plafond_3
  - platform: group
    name: Woonkamer lichten
    entities:
      - light.hue_bloom_tv_links
      - light.hue_bloom_tv_rechts
      - light.lightstrip_radiator

under Developer Tools → States I can only find
light.lightstrip_radiator
light.Keuken lichten
light.Woonkamer lichten

light.lightstrip_radiator is from lights.yaml so clearly the file is included…right?
but I do not see the other light groups.

HOLDUP!!! I Restarted again. And now I can see:
group.woonkamer_lichten2 and light.keuken_lichten3 but the original light.keuken_lichten from the configuration.yaml is gone. I I guess thuis is because i forgot the light: in configuration.yaml

Nope, This is because there can only be one light section. either in configuration.yaml or in light.yaml

2 Likes

So does it mean that light.yaml is only direct extension of configuration.yaml?
I expect then that changes in light.yaml requires HA restart too. Am I right?

Yes in my case it was necessary to restart.

Thanks.
I’m really happy for this thread, 'cause I was looking for the same answers because trying to find a way to group lights without need of restarting HA. Unfortunately got no answer at that time.
But today this thread makes it clear.
Light group and group are different animals.
light group is rather like one light however containing more light sources (something like Philips Hue scene) and for some reason cannot be created in runtime (without restart).
Common group can group various devices and can be created in runtime but it doesn’t provide functionality of light group.
Pretty limiting I would say.

1 Like

I think the devs are working hard on reducing/getting rid of restarts for configuration changes. However most of the time I don’t care about this, I’m not changing my config on a daily basis and if I need to restart it takes around 20 sec, which is acceptable for me.

Yeah. And probably this is the same reason behind current design. Most of experienced HA users don’t restart HA because they have things already configured.
But some one forgot about newcomers who have a lot to configure yet in addition facing a lot of problems which leads to even more restarts