[SOLVED] Newbie need help for splitting config

Hi,

I am new to Home Assistant. I have Philips Light and light on a smart plug. I was able to do a group with those light, but now I want to clear my configuration file by splitting it. But the file “group” don’t work and I don’t understand why.

Here are my files

configuration.yaml:


# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml


homeassistant:
  external_url: https://el-ha.duckdns.org
  internal_url: https://192.168.0.222:8123

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: true
  login_attempts_threshold: 10

light:
  - platform: switch
    name: Lumière comptoir
    entity_id: switch.lumiere_comptoir
  - platform: switch
    name: Lumière salon
    entity_id: switch.lumiere_salon

My groups.yaml:

light:
  - platform: switch
    name: Lumière comptoir
    entity_id: switch.lumiere_comptoir
  - platform: switch
    name: Lumière salon
    entity_id: switch.lumiere_salon

  - platform: group
    name: Cuisine
    entities:
      - light.cuisine_1
      - light.cuisine_2
      - light.cuisine_3
      - light.cuisine_4
      - light.cuisine_5
      - light.lumiere_comptoir
  - platform: group
    name: Salon
    entities:
      - light.lumiere_salon

When I check the config, I got this error:

  Invalid config for [group]: expected a dictionary for dictionary value @ data['group']. Got [OrderedDict([('platform', 'group'), ('name', 'Cuisine'), ('entities', ['light.cuisine_1', 'light.cuisine_2', 'light.cuisine_3', 'light.cuisine_4', 'light.cuisine_5', 'light.lumiere_comptoir'])]), OrderedDict([('platform', 'group'), ('name', 'Salon'), ('entities', ['light.lumiere_salon'])])]. (See /config/configuration.yaml, line 8). 

Can anyone help me with that?

Sorry, all my name are in french, I leave in Quebec and my girlfriend don’t speak English, so I try do my smart home as much as possible in french for her!

Thanks!

Why are you putting a “light:” configuration in your groups.yaml?

A light group is configured in the “light:” section, not the “group:” section.

Yes, you are right. I change my code, here is my new files

Config file:

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml


homeassistant:
  external_url: https://el-ha.duckdns.org
  internal_url: https://192.168.0.222:8123

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: true
  login_attempts_threshold: 10

light:
  - platform: switch
    name: Lumière comptoir
    entity_id: switch.lumiere_comptoir
  - platform: switch
    name: Lumière salon
    entity_id: switch.lumiere_salon

Group

  - platform: group
    name: Cuisine
    entities:
      - light.cuisine_1
      - light.cuisine_2
      - light.cuisine_3
      - light.cuisine_4
      - light.cuisine_5
      - light.lumiere_comptoir
  - platform: group
    name: Salon
    entities:
      - light.lumiere_salon

But I still have this error

 Invalid config for [group]: expected a dictionary for dictionary value @ data['group']. Got [OrderedDict([('platform', 'group'), ('name', 'Cuisine'), ('entities', ['light.cuisine_1', 'light.cuisine_2', 'light.cuisine_3', 'light.cuisine_4', 'light.cuisine_5', 'light.lumiere_comptoir'])]), OrderedDict([('platform', 'group'), ('name', 'Salon'), ('entities', ['light.lumiere_salon'])])]. (See /config/configuration.yaml, line 8). 

you need to remove the dash from in front of each group section. the dash indicates a list. the groups aren’t lists in that way. And “platform” isn’t valid group config. Look at the docs for “group”.

But I think this should work:

cuisine:
  name: Cuisine
  entities:
    - light.cuisine_1
    - light.cuisine_2
    - light.cuisine_3
    - light.cuisine_4
    - light.cuisine_5
    - light.lumiere_comptoir
salon:
  name: Salon
  entities:
    - light.lumiere_salon
1 Like

Thanks, it’s working now!