Expected '<document start>', but found '<block mapping start>'

I am just going crazy because of this unexpected error. I just cannot see what is wrong with my code. It is probably something with the spaces, but i have checked them 100 times. Can you please help me with this error:

Testing configuration at /home/homeassistant/.homeassistant
2018-03-06 21:15:04 ERROR (Thread-2) [homeassistant.util.yaml] expected ‘’, but found ‘’
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 70, column 1
2018-03-06 21:15:04 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: expected ‘’, but found ‘’
in “/home/homeassistant/.homeassistant/configuration.yaml”, line 70, column 1

and the code is:

#homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 51.2993
  longitude: 9.491
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # 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: UTC
  # Customization file
  customize:
    script.irrigation_manual_1:
      icon: mdi:water
      friendly_name: Manual Irrigation
    script.irrigation_manual_2:
      icon: mdi:water
      friendly_name: Manual Irrigation
    script.reboot_ha:
      icon: mdi:home-automation
      friendly_name: Restart Home Assistant
    script.restart_pi:
      icon: mdi:raspberrypi
      friendly_name: Restart Raspberry Pi
    script.shutdown_pi:
      icon: mdi:raspberrypi
      friendly_name: Shutdown Raspberry Pi
    script.reboot_os:
      icon: mdi:linux
      friendly_name: Reboot Debian OS
    switch.wake_up_nuc:
      icon: mdi:desktop-classic
      friendly_name: Wake Up NUC
    automation.irrigation_auto_1:
      icon: mdi:autorenew
      friendly_name: Automatic Irrigation
    automation.irrigation_auto_2:
      icon: mdi:autorenew
      friendly_name: Automatic Irrigation
    binary_sensor.soil_moisture_1:
      friendly_name: Soil Moisture Sensor
    binary_sensor.soil_moisture_2:
      friendly_name: Soil Moisture Sensor
    sensor.cpu_temp:
      friendly_name: CPU Temperature
    switch.relay_8:
      icon: mdi:water-pump
      friendly_name: Water Pump
    switch.relay_1:
      friendly_name: Solenoid Valve 1
    switch.relay_2:
      friendly_name: Solenoid Valve 2
    switch.relay_3:
      friendly_name: Solenoid Valve 3
    switch.relay_4:
      friendly_name: Solenoid Valve 4
    switch.relay_5:
      friendly_name: Solenoid Valve 5
    switch.relay_6:
      friendly_name: Solenoid Valve 6
    switch.relay_7:
      friendly_name: Solenoid Valve 7

# Show links to resources in log and frontend
# introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
# Secrets are defined in the file secrets.yaml
# api_password: !secret http_password
# ssl_certificate: /home/homeassistant/.homeassistant/certificate.pem
# ssl_key: /home/homeassistant/.homeassistant/privkey.pem

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
# Optional, allows Home Assistant developers to focus on popular components.
# include_used_components: true
# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

# Sensors
sensor:
  - platform: command_line
    name: cpu_temp
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "°C"
    value_template: '{{ value | multiply(0.001) }}'
  - platform: systemmonitor
    resources:
      - type: disk_use_percent
        arg: /home
      - type: memory_use_percent
      - type: processor_use
      - type: last_boot
      - type: since_last_boot

# Text to speech
tts:
  - platform: google

# Cloud
cloud:

switch:
  - platform: rpi_gpio
    ports:
      02: Relay_1
      04: Relay_2
      17: Relay_3
      27: Relay_4
      22: Relay_5
      10: Relay_6
      09: Relay_7
      11: Relay_8
    invert_logic: true
  - platform: wake_on_lan
    mac_address: "00:1F:C6:9B:A8:E8"
    name: wake_up_nuc
    host: 134.130.55.210

weather:
  - platform: yweather

script:
  irrigation_manual_1:
    alias: irrigation_manual_1
    sequence:
      - service: switch.turn_on
        entity_id: switch.relay_1
      - service: switch.turn_on
        entity_id: switch.relay_8
      - delay: 00:00:02
      - service: switch.turn_off
        entity_id: switch.relay_8
      - service: switch.turn_off
        entity_id: switch.relay_1
  irrigation_manual_2:
    alias: irrigation_manual_2
    sequence:
      - service: switch.turn_on
        entity_id: switch.relay_2
      - service: switch.turn_on
        entity_id: switch.relay_8
      - delay: 00:00:02
      - service: switch.turn_off
        entity_id: switch.relay_8
      - service: switch.turn_off
        entity_id: switch.relay_2
  reboot_ha:
    alias: reboot_ha
    sequence:
      - service: homeassistant.restart
  restart_pi:
    alias: reboot_pi
    sequence:
      - service: shell_command.restart
  reboot_os:
    alias: reboot_os
    sequence:
      - service: shell_command.reboot
  shutdown_pi:
    alias: shutdown_pi
    sequence:
      - service: shell_command.shutdown

shell_command:
  reboot: 'echo Leistung2013 | sudo -S reboot'
  restart: 'echo Leistung2013 | sudo -S shutdown -r now'
  shutdown: 'echo Leistung2013 | sudo -S shutdown -h now'

binary_sensor:
  - platform: rpi_gpio
    ports:
      03: power_sw
      18: reset_sw
      24: soil_moisture_1
      25: soil_moisture_2
    invert_logic: true
    bouncetime: 200
    initial_state: true

automation irrigation_auto_1:
  alias: irrigation_auto_1
  trigger:
    platform: state
    entity_id: binary_sensor.soil_moisture_1
    from: 'on'
    to: 'off'
  action:
    service: script.turn_on
    entity_id: script.irrigation_manual_1

automation irrigation_auto_2:
  alias: irrigation_auto_2
  trigger:
    platform: state
    entity_id: binary_sensor.soil_moisture_2
    from: 'on'
    to: 'off'
  action:
    service: script.turn_on
    entity_id: script.irrigation_manual_2

group:
  default_view:
    view: yes
    name: irrigation
    entities:
      - group.plant1
      - group.plant2
      - group.climate
  system:
    view: yes
    name: system
    entities:
      - group.system_data
      - group.system_control
      - group.nuc_control
      - group.relay_board

  plant1:
    name: Plant 1 (Avocado)
    icon: mdi:flower
    entities:
      - script.irrigation_manual_1
      - automation.irrigation_auto_1
      - binary_sensor.soil_moisture_1
  plant2:
    name: Plant 2 (Indrishe)
    icon: mdi:flower
    entities:
      - script.irrigation_manual_2
      - automation.irrigation_auto_2
      - binary_sensor.soil_moisture_2

  system_data:
    name: System Data
    icon: mdi:information-variant
    entities:
      - sensor.cpu_temp
      - sensor.cpu_used
      - sensor.ram_used
      - sensor.disk_used_home
      - sensor.last_boot
      - sensor.since_last_boot
  system_control:
    name: System Control
    icon: mdi:settings
    entities:
      - script.reboot_ha
      - script.reboot_os
      - script.restart_pi
      - script.shutdown_pi
      - binary_sensor.power_sw
      - binary_sensor.reset_sw
  nuc_control:
    name: NUC Control
    icon: mdi:desktop-classic
    entities:
      - switch.wake_up_nuc
  relay_board:
    name: Relay Board
    icon: mdi:dip-switch
    entities:
      - switch.relay_1
      - switch.relay_2
      - switch.relay_3
      - switch.relay_4
      - switch.relay_5
      - switch.relay_6
      - switch.relay_7
      - switch.relay_8

  climate:
    name: Climate
    icon: mdi:weather-partlycloudy
    entities:
      - weather.yweather
      - sun.sun

Hi there @Viktor_Keray - is the # at the very beginning of your code in your actual file? If so, try deleting that :slight_smile:

1 Like

Thanks a lot! You saved my day

1 Like

Why is homeassistant commented?

EDIT: To slow :grinning:

I had other issue with a same error. All problems was caused by space at the beginning of the FIRST LINE (and was not reported as fault there, just in following lines).