How do I Configure Multiple Light Groups in YAML

I’m trying to add multiple light groups in configuration.yaml

 48 light:
 49         - platform: group
 50           name: Floorlamp
 51           entities:
 52                   - light.floorlamp_bulb_1
 53                   - light.floorlamp_bulb_2
 54                   - light.floorlamp_bulb_3
 55
 56 light:
 57         - platform: group
 58           name: Room One Overhead
 59           entities:
 60                   - light.mudroom_one_overhead_1
 61                   - light.mudroom_one_overhead_2

But in Dev Tools States, I only see Room One Overhead, I don’t see Floorlamp. Why am I only seeing one light?

Both - platform sections and everything under them need to be under one light:

It should look like this:

light:
- platform: group
  YOUR DATA HERE

- platform: group
  YOUR DATA HERE

Make sense?

Also, you should only be indenting two spaces. You have a lot of extra spaces there.

2 Likes

Ok so I am pulling my hair (what is left of it) out since a update back a few weeks ago to HA my light groups stopped working properly, not displaying the brightness slider anymore but after I opened a individual light then the brightness slider would magically reappear in the group of lights in the Lovelace card.
Now after doing some digging in the forums I found out that I need to use a “Light Group” instead of a group of lights, that makes sense to me so I followed your direction and put the “light: !include lights.yaml” line in my configuration.yaml and created the file lights.yaml and then added


one light group added was fine no issue but once I go to add a second light group I get this

with this error box saying I have a duplicate

I cannot figure out how to get the formatting correct to get rid of this error, I know I am missing something and have been hunting for a example of a some yaml code to use for creating multiple light groups. So far with no success. One group works fine but once I go for a second one it fails. Any assistance and examples of code would be appreciated.

You Should use it like this:

light:
  - platform: group
    name: Dining Table Lights
    entities:
      - light.hue_filament_bulb_1
      - light.hue_filament_bulb_2
      - light.hue_filament_bulb_3
      - light.hue_filament_bulb_4
  - platform: group
    name: Walk In Closet Lights
    entities:
      - light.walk_in_closet_ceilig_1
      - light.walk_in_closet_ceilig_2
  - platform: group
    name: Master Bedroom Lights
    entities: 
      - light.master_bedroom_dressoir_1
      - light.master_bedroom_dressoir_2
1 Like

Thank you, It seems should not use the “light:” because I have the

light: !include lights.yaml
in my configuration.yaml

But it seems that it still needs a half a indent (2 spaces) from the left to work.

this is working for me now
4LightGroupThisOK

1 Like

Yes in your case remove light:
Glad you figured it out!

only because of the example that you gave me I copied it and had to paste it and edit it to fit my needs.
for some odd reason my indents weren’t giving me that little red - (dash) before my entities.

THANK YOU!!!

1 Like