Is my configuration.yaml wrong?

I had an old install of Home Assistant that I hadn’t updated for two years. Rather than try to update it and fix everything that got broken, I decided to just start fresh.

I have everything working and I’m trying to try espresense, but the example code for the sensors doesn’t work for my config. In my previous installation, my config had things like sensor, switch, light, etc blocks, but the new install ended up with a mqtt block that all of those were under, which I believe I based on this: MQTT Switch - Home Assistant
Did I do something wrong here?

Here’s a small snippet showing one switch and one sensor

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  
group:
  family:
    name: Family
    icon: mdi:home-heart
    entities:
      - person.steve
      - person.becky
      - person.nate

mqtt:
  - switch:
      name: "Front Porch"
      unique_id: Front_Porch_switch
      icon: mdi:ceiling-light
      command_topic: "cmnd/SonoffFrontPorch/power"
      state_topic: "stat/SonoffFrontPorch/RESULT"
      value_template: "{{value_json.POWER}}"
      qos: 1
      state_on: "ON"
      state_off: "OFF"
      payload_on: "ON"
      payload_off: "OFF"
      retain: false


  - sensor:
      name: "Dryer State"
      state_topic: "hass/state/dryer"
      icon: mdi:tumble-dryer

Thanks!

There is nothing wrong with your configuration.yaml (at least, it will not prevent HA from starting)

But there is also nothing for espresense in that configuration.yaml.

I guess you still need to add these.

I’m dumb. I capitalized Sensor:

it’s working now.