Cannot split input_boolean from main config file

Hey everybody. So I have been trying to figure out this issue for days now and I cannot figure out why hassio is doing what it is doing.

What I am trying to do: I want to take the input_boolean portion of my main configuration file and put it into its own input_booleans.yaml file.

I created the new input_booleans.yaml file in the config directory level of my hassio instance. I then copy and pasted my input booleans from my main configuration into said yaml file and fixed the indentations (I think). When I go and click on the “Check Configuration” button on the Configuration tab on the front end, I get this error:

“Invalid config for [input_boolean]: expected dictionary for dictionary value @ data[‘input_boolean’]. Got [OrderedDict([(‘bedroom_speakers’, None), (‘name’, ‘Automatically Turn On/Off Bedroom Speakers’), (‘initial’, True), (‘icon’, ‘mdi:cellphone-wireless’)]), OrderedDict([(‘under_bar_led’, None), (‘name’, ‘Automatically Turn On/Off Bar LEDs at Night’), (‘initial’, False), (‘icon’, ‘mdi:led-outline’)])].”

If I comment all of the input_booleans.yaml (to where it is essentially blank), then the Check Configuration button says my config is good to go. But then obviously, I have no working input booleans. I have even tried to make an input_boolean folder and using all 4 variations of the !include methods, but still no luck.
Does anyone have any ideas?

This is a picture of my configuration yaml showing the !include statement

This picture shows my configuration file with my input_boolean portion block quoted out. Without the comments, the input booleans work perfectly.

This is my input_booleans.yaml file. At first, the name:, initial:, and icon: all had 4 spaces instead of 2 (since I copied it straight from my configuration.yaml file), but I took them down to 2 since 4 wasnt working. 2 isnt working either however.

bedroom_speakers:
  name: some name
  initial: 'on'
  icon: some icon

Tried that. I get the same error.

Confirm that you have:

  • Removed the dashes and aligned the keys bedroom_speakers: and under_bar_leds: all the way across to the left of the page.

  • aligned the subkeys name, initial and icon 2 spaces in.

Without the leading hyphens?

1 Like

Holy Crap that worked…I knew it had to be something simple. But why should the hyphens not be there? Being new to HA, I am still confused on when to use hyphens and when to not use them.

Because input_booleans are ‘named’ rather than ‘listed’. Same with groups and scripts too.

#Component with 'names'
script:
  script_one:
    alias: Script One
    sequence:
      [...] 

  script_two:
    alias: Script Two
    sequence:
      [...]

#Component with list
sensor:
  - platform: template 
    value_template: "{{ some_cool_jinja }}"

  - platform: version

  - platform: rest 
    [...] 

See each component page for what type of entries it takes :+1: