I'm having a problem with a 5 button panel with LEDs

I’m having a problem with this code, I’m unsure, but I think it’s the esp32 ports. Can anybody help me ?

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO2
      inverted: true
      mode:
        input: true
        pullup: true
    id: display_button
    on_press:
      then:
        - display.page.show_next: oled
        - component.update: oled

  - platform: gpio
    id: button1
    pin:
      number: GPIO4
      mode: INPUT_PULLUP
      inverted: true
    on_press: 
      then:
        - output.turn_on: led1
        - output.turn_off: led2
        - output.turn_off: led3
        - output.turn_off: led4
        - output.turn_off: led5

  - platform: gpio
    id: button2
    pin:
      number: GPIO5
      mode: INPUT_PULLUP
      inverted: true
    on_press: 
      then:
        - output.turn_off: led1
        - output.turn_on: led2
        - output.turn_off: led3
        - output.turn_off: led4
        - output.turn_off: led5

  - platform: gpio
    id: button3
    pin:
      number: GPIO12
      mode: INPUT_PULLUP
      inverted: true
    on_press: 
      then:
        - output.turn_off: led1
        - output.turn_off: led2
        - output.turn_on: led3
        - output.turn_off: led4
        - output.turn_off: led5

  - platform: gpio
    id: button4
    pin:
      number: GPIO14
      mode: INPUT_PULLUP
      inverted: true
    on_press: 
      then:
        - output.turn_off: led1
        - output.turn_off: led2
        - output.turn_off: led3
        - output.turn_on: led4
        - output.turn_off: led5

  - platform: gpio
    id: button5
    pin:
      number: GPIO15
      mode: INPUT_PULLUP
      inverted: true
    on_press: 
      then:
        - output.turn_off: led1
        - output.turn_off: led2
        - output.turn_off: led3
        - output.turn_off: led4
        - output.turn_on: led5

light:
  - platform: binary
    name: "LED1"
    output: led1
  - platform: binary
    name: "LED2"
    output: led2
  - platform: binary
    name: "LED3"
    output: led3
  - platform: binary
    name: "LED4"
    output: led4
  - platform: binary
    name: "LED5"
    output: led5

output:
  - id: led1
    platform: gpio
    pin: GPIO32

  - id: led2
    platform: gpio
    pin: GPIO33

  - id: led3
    platform: gpio
    pin: GPIO27

  - id: led4
    platform: gpio
    pin: GPIO18

  - id: led5
    platform: gpio
    pin: GPIO19

What sort of problem? Can you provide logs or a description of what’s happening compared too what you want to happen?

1 Like

I am receiving a message on the esphome flasher that my file is incompatible, however, the file is correct. The problem can only be the code.

That’s unlikely to be caused by the yaml above. If you need more assistance you will need to provide some more details, like the full yaml, the board you are using and the compile logs from ESPHome.

Unexpected error: Error while writing flash: MD5 of file does not match data in flash!

The error is this