Continuous error on configuration.yaml

Home assistant on Pi 3B, Node Red, Mosquitto and Configurator installed. This is all a fresh installation today.
I’m trying to install TheHookUps holiday LED scripts/code, but I keep getting errors. The errors I get are these:
From the log file (after check config button pressed):

while parsing a block mapping
  in "/config/configuration.yaml", line 18, column 3
expected <block end>, but found '<block mapping start>'
  in "/config/configuration.yaml", line 52, column 5

From the notification icon within configurator:

bad indentation of a mapping entry at line 52, column 5:
        name: "Holiday Lights"
        ^

For the life of me I cannot see what the issue is. I’ve tried indenting it further right and left. copied and pasted from another line that is closely similar (line 76) but I still get this. Could someone please explain to me what is going wrong?
Here is my configuration.yaml


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

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  platform: google_translate
  group: !include groups.yaml
  automation: !include automations.yaml
  script: !include scripts.yaml
  scene: !include scenes.yaml

mqtt:
  broker: 192.168.1.10
    
# Example configuration.yaml entry
  mobile_app:

#start holiday leds
  switch:
  - platform: mqtt
    name: "Audio Effects"
    state_topic: "holidayLights/audio/state"
    command_topic: "holidayLights/addEffects"
    payload_on: "Audio On"
    payload_off: "Audio Off"
    retain: false
  - platform: mqtt
    name: "Add Glitter"
    state_topic: "holidayLights/glitter/state"
    command_topic: "holidayLights/addEffects"
    payload_on: "Glitter On"
    payload_off: "Glitter Off"
    retain: false
  - platform: mqtt
    name: "Add Lightning"
    state_topic: "holidayLights/lightning/state"
    command_topic: "holidayLights/addEffects"
    payload_on: "Lightning On"
    payload_off: "Lightning Off"
    retain: false

  light:
    #platform: mqtt_json
    # the most recent HA requires a different platform
     platform: mqtt
     schema: json
    name: "Holiday Lights"
    state_topic: "holidayLights/state"
    command_topic: "holidayLights/commands"
    effect: true
    brightness: true
    effect_list:
      - Color_Chase
      - Color_Glitter
      - Single_Race
      - Double_Crash
      - Rainbow
      - Blocked_Colors
      - BPM
      - Twinkle
      - Fire
      - Fill_Solid
      - Spooky_Eyes
      - Halloween
      - LED_Locator
    qos: 1
  - #platform: mqtt_json
    # the most recent HA requires a different platform
     platform: mqtt
     schema: json
    name: "Holiday Lights Color 1"
    state_topic: "holidayLights/state1"
    command_topic: "holidayLights/commands1"
    rgb: true
    qos: 1
  - #platform: mqtt_json
    # the most recent HA requires a different platform
     platform: mqtt
     schema: json
    name: "Holiday Lights Color 2"
    state_topic: "holidayLights/state2"
    command_topic: "holidayLights/commands2" 
    rgb: true
    qos: 1
  - #platform: mqtt_json
    # the most recent HA requires a different platform
     platform: mqtt
     schema: json
    name: "Holiday Lights Color 3"
    state_topic: "holidayLights/state3"
    command_topic: "holidayLights/commands3"  
    rgb: true
    qos: 1

input_number:
  led_identification:
    name: LED identification
    initial: 0
    min: 0
    max: 500
    step: 1
#end holiday leds

Thanks, Colin

Welcome to HomeAssistant! :slight_smile:

The short answer: your indentation is wrong. :wink: The entries mobile_app, switch and lights are indented, they shouldn’t be. And according to these indentations, the following config needs to be indented correctly, too.

The long answer: I assume you copied the entries from github. If so, you should first switch the github page (with the code on it) to “raw” view before copying. The button for that is in the line above where the code starts. That solves issues with copy and paste.
But I would really advise you, to read just a small tutorial about yaml and it’s use. This is not meant offensive, but if you want to use yaml for your configuration, you should understand at least the basics. :slight_smile:

And take a look at the examples in the documentation (https://www.home-assistant.io/docs/configuration/yaml/), these help in understanding, what you are copying into your configuration files. I know, when starting with a new system, one wants to get things running, but with only copy & paste, you will likely run into bad experiences with your system.

Try it with this config (just copied your code and looked for indentation, I didn’t check what you put in there):


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

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
#   base_url: example.duckdns.org:8123

# Text to speech
tts:
  platform: google_translate
  group: !include groups.yaml
  automation: !include automations.yaml
  script: !include scripts.yaml
  scene: !include scenes.yaml

mqtt:
  broker: 192.168.1.10
    
# Example configuration.yaml entry
mobile_app:

#start holiday leds
switch:
  - platform: mqtt
    name: "Audio Effects"
    state_topic: "holidayLights/audio/state"
    command_topic: "holidayLights/addEffects"
    payload_on: "Audio On"
    payload_off: "Audio Off"
    retain: false
  - platform: mqtt
    name: "Add Glitter"
    state_topic: "holidayLights/glitter/state"
    command_topic: "holidayLights/addEffects"
    payload_on: "Glitter On"
    payload_off: "Glitter Off"
    retain: false
  - platform: mqtt
    name: "Add Lightning"
    state_topic: "holidayLights/lightning/state"
    command_topic: "holidayLights/addEffects"
    payload_on: "Lightning On"
    payload_off: "Lightning Off"
    retain: false

light:
  - platform: mqtt
    schema: json
    name: "Holiday Lights"
    state_topic: "holidayLights/state"
    command_topic: "holidayLights/commands"
    effect: true
    brightness: true
    effect_list:
      - Color_Chase
      - Color_Glitter
      - Single_Race
      - Double_Crash
      - Rainbow
      - Blocked_Colors
      - BPM
      - Twinkle
      - Fire
      - Fill_Solid
      - Spooky_Eyes
      - Halloween
      - LED_Locator
    qos: 1
  - platform: mqtt
    schema: json
    name: "Holiday Lights Color 1"
    state_topic: "holidayLights/state1"
    command_topic: "holidayLights/commands1"
    rgb: true
    qos: 1
  - platform: mqtt
    schema: json
    name: "Holiday Lights Color 2"
    state_topic: "holidayLights/state2"
    command_topic: "holidayLights/commands2" 
    rgb: true
    qos: 1
  - platform: mqtt
    schema: json
    name: "Holiday Lights Color 3"
    state_topic: "holidayLights/state3"
    command_topic: "holidayLights/commands3"  
    rgb: true
    qos: 1

input_number:
  led_identification:
    name: LED identification
    initial: 0
    min: 0
    max: 500
    step: 1
#end holiday leds
3 Likes

Patrick,

Thank you so much. I’m going to compare the 2 lots of code to see exactly what you’ve done (apart from removing unneeded comments). Thanks for the info on selecting the RAW code - I indeed didn’t copy that, but now I know…!

Colin

1 Like