Cover service problem - error in the configuration

Hello,

I’m having problems with the cover service, here the error and my configuration:

Error:
INFO:homeassistant.util.package:Attempting install of colorlog==3.1.4
Testing configuration at /config
ERROR:homeassistant.util.yaml:while parsing a block collection
in “/config/cover.yaml”, line 2, column 5
expected , but found ‘?’
in “/config/cover.yaml”, line 3, column 5
Failed config
General Errors:
- Error loading /config/configuration.yaml: while parsing a block collection
in “/config/cover.yaml”, line 2, column 5
expected , but found ‘?’
in “/config/cover.yaml”, line 3, column 5

Successful config (partial)

Config: (first mqtt device, I’m very new to HA)

configurations.yaml

mqtt:
    broker: core-mosquitto
    username: admin
    password: ******
cover: !include cover.yaml

cover.yaml

- platform: mqtt
    state_topic: "cmnd/garagestate/POWER2"
    command_topic: "cmnd/sonoffsv01/POWER"
    payload_open: "ON"
    payload_close: "ON"
    payload_stop: "ON"
    state_open: "ON"
    state_closed: "OFF"
    optimistic: false

Error in Hass.io Configurator add-on when editing cover.yaml:

bad indentation of a mapping entry at line 2, column 9:
        name: "Sonof SV Garage"
            ^

Can you please help me? I followed this youtube video: https://www.youtube.com/watch?v=QMepwpyjMCY

First off you need to make sure you format your code properly in your posts.

But just as a guess, I would say that you don’t have the proper indentation but without the code being properly formatted there is no way I can tell you exactly where the problem is.

I edited the post as you requested.
Thanks for your help.

If that is a good copy & paste then the indentations are indeed off. try like this:

mqtt:
  broker: core-mosquitto
  username: admin
  password: ******
cover: !include cover.yaml

- platform: mqtt
  state_topic: "cmnd/garagestate/POWER2"
  command_topic: "cmnd/sonoffsv01/POWER"
  payload_open: "ON"
  payload_close: "ON"
  payload_stop: "ON"
  state_open: "ON"
  state_closed: "OFF"
  optimistic: false

It worked, the problem was only in the cover.yaml in the configuration.yaml It works like I pasted here.

So if I understand (my mother language is not english) the indentations is the structure of the code?
But why in the cover.yaml I have the problem and not in the configuration.yaml?

- platform: mqtt
  state_topic: "cmnd/garagestate/POWER2"

different from this, because of the space behind “state_topic”

- platform: mqtt
    state_topic: "cmnd/garagestate/POWER2"

sorry if this is a stupid question but I want to understand :slight_smile:

I think you can use tabs or spaces but whichever you start using you need to consistently use those all the time.