Sintax error in binary_sensor

Hi all.
Would appreciate some help in this.
I’m configuring an ESP32 for 2 gate (garage) sensors. Open and Close states.
Using following config in ESPHome:

# FCP1
binary_sensor:
  - platform: gpio
    pin:
    number: 25
    mode:
      input: true
      pullup: true
  name: "FCP1"
  device_class: door
  id: fcp1
  filters:
    -delayed_on: 100ms

Tried adding # in all lines, removing one by one, copy/paste from ‘GPIO Binary Sensor’ page…But always have that red square in right that means ‘sintax error’.
Of course tried to install in ESP32 but appeared the error:

ERROR Error while reading config: Invalid YAML syntax:
while parsing a block collection
in “/config/esphome/esphome-web-eab3a4.yaml”, line 36, column 3:
- platform: gpio
^
expected , but found ‘?’
in “/config/esphome/esphome-web-eab3a4.yaml”, line 42, column 3:
name: “FCP1”
^

For sure is something easy, but can’t find it.
Thanks in advance.

YAML is all about indentation :grinning:

So, all lines starting with the name: line should have one more indent. And there should also be a space between - and fllters

1 Like

Thank you for your reply. This is the case, checking always the same, and you see everything fine, but another one see the issue:

Here the solution:

#  FCP1
binary_sensor:
  - platform: gpio
    pin:
      number: 22
      mode:
        input: true
        pullup: true
    name: "FCP1"
    device_class: door
    id: fcp1
    icon: "mdi:gate"
    filters:
      - delayed_on: 100ms

Thanks again.