Light group giving strange results

Hi,

I am trying to create some light groups and put the folllwjng into my group.yaml

light:
  name: Landing
  entities:
    - light.landing_1
    - light.landing_2
    - light.landing_3
  name: Hallway
  entities:
    - light.hallway_front
    - light.hallway_back
  name: Livingroom
  entities:
    - light.livingroom_alcove
    - light.livingroom_TV
    - light.livingroom_settee
    - light.livingroom_settee_2
  name: Livingroom_dark
  entities:
    - light.livingroom_TV
    - light.livingroom_settee
  name: Livingroom_Blooms
  entities:
    - light.livingroom_TV_bloom
    - light.livingroom_settee_bloom
    - light.livingroom_settee_2_bloom
  name: Patio
  entities:
    - light.patio_orangery
    - light.patio_kitchen
  name: Outside_lanterns
  entities:
    - light.frontdoor
    - light.sidedoor
    - light.patio_orangery
    - light.patio_kitchen

There are no errors, per se, but this is the result (as seen in the ā€œEntitiesā€ page"):

Name				Entity ID
--------------------------------------
Landing				light.landing
Hallway				light.hallway
Livingroom			<does not exist>
Livingroom_Dark		<does not exist>
Livingroom_Blooms	<does not exist>
Patio				light.patio
Outside_lanterns	group.light

Why do some not exist?
Why is one group.xx when the others (that work) are light.xx

Can anyone give me a steer as to what is going on?

Lightgoups are configured as lights not as groups so you should not add it to your group.yaml but to the light section in your configuration.yaml or light.yaml (or what ever file/folder you use for your lights)

thanks!

If I were to create a light.yaml, would I put
light: !include lights.yaml
in my configuration.yaml?

Every time I have tried something like this in the past, I get errors that the file xxx.yaml file cannot be found (even though it is there).

edit:
this is the error when I added the
light: !include lights.yaml
line:

Logger: homeassistant.components.homeassistant
Source: components/homeassistant/init.py:113
Integration: Home Assistant Core Integration (documentation, issues)
First occurred: 9:31:52 (1 occurrences)
Last logged: 9:31:52

Invalid config for [light]: required key not provided @ data[ā€˜platformā€™]. Got None. (See /config/configuration.yaml, line 11).

Just put this directly in your configuration.yaml

light:
  - platform: group 
    name: Landing
    entities:
      - light.landing_1
      - light.landing_2
      - light.landing_3
  - platform: group 
    name: Hallway
    entities:
      - light.hallway_front
      - light.hallway_back
  - platform: group 
    name: Livingroom
    entities:
      - light.livingroom_alcove
      - light.livingroom_TV
      - light.livingroom_settee
      - light.livingroom_settee_2
  - platform: group 
    name: Livingroom_dark
    entities:
      - light.livingroom_TV
      - light.livingroom_settee
  - platform: group 
    name: Livingroom_Blooms
    entities:
      - light.livingroom_TV_bloom
      - light.livingroom_settee_bloom
      - light.livingroom_settee_2_bloom
  - platform: group 
    name: Patio
    entities:
      - light.patio_orangery
      - light.patio_kitchen
  - platform: group 
    name: Outside_lanterns
    entities:
      - light.frontdoor
      - light.sidedoor
      - light.patio_orangery
      - light.patio_kitchen
1 Like

Hi - that worked perfectly - thanks!

ā€¦but do you know why my light.yaml file causes an error? (I want to learn and find the help pages very confusing esp. as I have not supervisor option (and hence no file editor).

Not really, I can only direct you to the documentation for ā€œsplitting up your configurationā€ :man_shrugging:

thanks - I have read that. I am sure it is formatting in my configuration.yaml

ā€¦thanks for you help anyway!

I have this in my configuration.yaml

light: !include_dir_merge_list config/lights

And the file I use for my light groups looks like this

- platform: group
  name: lightgroup1
  entities:
    - light.entity1
    - light.entity2

Iā€™ll give that try - thanks!

well that didnā€™t work for me, but it helped me solve the problem with my original issue of:
light: !include lights.yaml

as your file format worked for me. My issue (that I can see now) is that I had
light:
in my first line (so it was a duplicate) and then all my subsequent lines were indented by 2 characters too many as a result.

ā€¦so, thanks anyway :slight_smile: