ESP32-C5 and ESPHome

Hey @DuckDuck25.

Also used your config as inspiration for my own working config. It is now running as my Bluetooth Proxy.

My only question would be: I like the status_led functionality but would rather be able or have it turning off LED automatically, after some time, in case everything is OK (and only light up again in case of boot or in case any issue comes up).

Does that seem like feasible to you?

Thanks in advance.

I didn't test this, but Claude gave me this:

# Remove status_led block entirely, replace with:

output:
  - platform: gpio
    pin: GPIO27
    id: led_gpio

script:
  - id: led_blink
    mode: restart
    then:
      - while:
          condition:
            lambda: return true;
          then:
            - output.turn_on: led_gpio
            - delay: 500ms
            - output.turn_off: led_gpio
            - delay: 500ms

  - id: led_ok_off
    mode: restart
    then:
      - delay: 30s
      - output.turn_off: led_gpio
esphome:
  name: ${device_name}
  friendly_name: ${friendly_name}
  includes:
    - common/wifi_helpers.h
  on_boot:
    then:
      - output.turn_on: led_gpio
  on_connect:
    then:
      - script.stop: led_blink
      - output.turn_on: led_gpio
      - script.execute: led_ok_off
      - component.update: wifi_band_sensor
      - component.update: wifi_channel_sensor
  on_disconnect:
    then:
      - script.stop: led_ok_off
      - script.execute: led_blink
      - lambda: |-
          id(_wifi_disconnects_since_boot)++;

Behavior summary:

  • Boot → LED on immediately
  • Wi-Fi disconnects → LED blinks (500ms on/off) until reconnected
  • Wi-Fi reconnects → LED turns solid, then off after 30s
  • Any future disconnect → blink resumes

The 30s delay in led_ok_off is the easy knob to tune. You could also expose it as a number entity if you want runtime control.

Thank you! It work using Tasmota flasher.
FYI for ESP32C5 better to use below:
esp32:
board: esp32-c5-devkitc-1
variant: esp32c5
framework:
type: esp-idf