Mapping error

hello guys i have ESP32

im trying to install dimmer however i got this error

ERROR Error while reading config: Invalid YAML syntax:

mapping values are not allowed here
in “/config/esphome/test.yaml”, line 37, column 8

somthing to do with pin: GPIO19.

any help ?

the code is this

esphome:
  name: test
  friendly_name: test
  

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "0po2eIYdC25FSnUaTIrqmaLmrMBMdlli1S56Tb4x54s="

ota:
  - platform: esphome
    password: "cae5b86d96fe5229d46a8d11d67a0f7c"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Test Fallback Hotspot"
    password: "d2Wh0MrDabqS"


captive_portal:

output:
- platform: ledc
    pin: GPIO19
    id: gpio_19
    frequency: "1000Hz"

light:

- platform: monochromatic
    output: gpio_19
    name: "ESP32 Dimmer

1 Like

Hi - please enclose your yaml in preformatted text tags - accessed by the </> button on the posting toolbar. The text will then have the correct indentation so we can see what the issue is. It will look like this:

preformatted text:
  - with indent

As Daryl says, please format YAML code correctly for the forum. Looking at your screenshot (which shouldn’t be needed with properly-formatted code), you’ve indented the lines under platform: ledc and platform: monochromatic, which is incorrect.

Indentation is critical in YAML. Take a look at the examples, and match those:

As Troon has pointed out, you have an indentation issue - should look like:

output:
  - platform: ledc
    pin: GPIO19
    id: gpio_19
    frequency: "1000Hz"

light:
  - platform: monochromatic
    output: gpio_19
    name: "ESP32 Dimmer"

amazing thanks alot guys for the help working now

1 Like