Splitting yaml

I am trying to split up my configuration.yaml file into several but keep getting an error when trying.
I have created a customize.yaml with success but when trying with light, Groups, sensors and so on it returns an error.

Configuration yaml looks like this:
elevation: 20

metric for Metric, imperial for Imperial

unit_system: metric

Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones

time_zone: Europe/Copenhagen
customize: !include customize.yaml
group: !include groups.yaml

Groups yaml looks like this:

Groups yaml (hashtag is in front of the original text)

stue:
name: Stue
view: true
entities:
- light.pendel_op
- light.bordlampe_ned
- light.bordlampe_op
- light.pendel_ned
- light.pendel_ned_2
- light.pendel_ned_3
- light.pendel_op
- light.strip_stue
- light.strip_trappe
- light.stue
- media_player.stue

sovevaerelse:
name: Sove
view: true
entities:
- light.sovevrelse_loft
- light.sovevrelse_skab

Error from log file:
17-04-15 09:50:41 ERROR (MainThread) [homeassistant.config] Invalid config for [homeassistant]: [group] is an invalid option for [homeassistant]. Check: homeassistant->group. (See /home/homeassistant/.homeassistant/configuration.yaml, line 2).
Failed config
homeassistant:
customize: [source /home/homeassistant/.homeassistant/configuration.yaml:12]
light.bordlampe_ned: [source /home/homeassistant/.homeassistant/customize.yaml:3]
icon: mdi:lamp
light.bordlampe_op: [source /home/homeassistant/.homeassistant/customize.yaml:5]
icon: mdi:lamp
and so on

Can someone see what is wrong?

You have group: indented under your home assistant header - you need to change it from this:

homeassistant:
  elevation: 20
  [...]
  customize: !include customize.yaml
  group: !include groups.yaml

to this:

homeassistant:
  elevation: 20
  [...]
  customize: !include customize.yaml
  
group: !include groups.yaml

So that group is a category of it’s own.

Hope this helps.

How come it should not be intended like the customize line?
So lights, sensors and other yaml files also has to be a category of their own in the configuration.yaml?

Because groups, lights, sensors etc are separate components, whereas customize is an option of the homeassistant component.

[edit] - slightly misread your last post the first time.

Yes, is the answer to your question, the basic format for the yaml entries is:

component:
  option1:
    option1's_suboptions:
  option2:
  ETC

So in your case:

homeassistant:
  elevation:
  unit_system:
  customize:

group:
light:
sensor:
1 Like

okay thanks :-)… i will try it out later in the afternoon.

1 Like

Works perfectly now :slight_smile:

1 Like