How to set up multiple binary sensors in configuration yaml

Hello all,

Ive just started my home asssistant journey and have installed a shelly plus 1 device on each of my 2 garage door openers. I added reed switches to be able to see the status of the door with MQTT. When i add the binary sensors to the YAML file, i get a duplicate key error. I’m sure this is a vey easy fix, but I am so new at this that I am pathetic. Thanks for your time

mqtt:
binary_sensor:
name: "Gym Door State"
state_topic: "stat/Gym_door/status"
payload_on: "open"
payload_off: "closed"
availability_topic: "tele/Gym_door/LWT"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
device_class: opening

name: "Garage Door State"
state_topic: "stat/Garage_door/status"
payload_on: "open"
payload_off: "closed"
availability_topic: "tele/Garage_door/LWT"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
device_class: opening

You need to use indentation and hypens appropriately.

YAML for Non-Programmers

mqtt:
  binary_sensor:
    - name: "Gym Door State"
      state_topic: "stat/Gym_door/status"
      payload_on: "open"
      payload_off: "closed"
      availability_topic: "tele/Gym_door/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
      qos: 1
      device_class: opening

    - name: "Garage Door State"
      state_topic: "stat/Garage_door/status"
      payload_on: "open"
      payload_off: "closed"
      availability_topic: "tele/Garage_door/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
      qos: 1
      device_class: opening

I really appreciate the answer. I was missing a space between - and name and obviously my indentations were wonky. Lesson learned.