Quick formatting help

Tried setting up a few new light groups but i’m running into a yaml formatting error. Can someone help me correct this? It’ll probably help me and others in the general formatting of the config…because there’s no good overall lesson on “this is how you indent lists of multiple instances of the same thing”

light:
  - platform: flux_led
    automatic_add: true
  - platform: group
     - name: Island
       entities:
         - light.kitchen_island_1
         - light.kitchen_island_2
         - light.kitchen_island_3
         - light.kitchen_island_4
     - name: Cabinets
       entities:
         - light.ge_link_1
         - light.ge_link_2
         - light.ge_link_3
     - name: Shower
       entities:
         - light.shower_light_1
         - light.shower_light_2

Results in this error:

ERROR:homeassistant.util.yaml:while parsing a block mapping
  in "/config/configuration.yaml", line 148, column 5
expected <block end>, but found '-'
  in "/config/configuration.yaml", line 149, column 5
Failed config
  General Errors: 
    - while parsing a block mapping
  in "/config/configuration.yaml", line 148, column 5
expected <block end>, but found '-'
  in "/config/configuration.yaml", line 149, column 5

Try…

light:
  - platform: flux_led
    automatic_add: true
  - platform: group
    name: Island
    entities:
      - light.kitchen_island_1
      - light.kitchen_island_2
      - light.kitchen_island_3
      - light.kitchen_island_4
  - platform: group 
    name: Cabinets
    entities:
      - light.ge_link_1
      - light.ge_link_2
      - light.ge_link_3
  - platform: group
    name: Shower
    entities:
      - light.shower_light_1
      - light.shower_light_2

Results in:

ERROR:homeassistant.util.yaml:mapping values are not allowed here
  in "/config/configuration.yaml", line 150, column 14
Failed config
  General Errors: 
    - mapping values are not allowed here
  in "/config/configuration.yaml", line 150, column 14

Where line 150 corresponds to the “entities” line of the Island group

Check the indentation, I did that on my phone so there may be some whitespace problems.

I think there was an extra space inserted because I made sure everything aligned and restarted and now it works. Thanks!

1 Like

No worries :+1:

Please mark the post as the solution when you get a chance, thanks.