Status led on Sonoff basic

Hi,
I need to make visible the status of the relay on a Sonoff Basic via the status led.
I am trying to use this code:

switch:
  - platform: gpio
    name: "Relé del porche"
    pin: GPIO12
    id: relay
    on_turn_on:
    - light.turn_on: stat_led
    on_turn_off:
    - light.turn_off: stat_led

light:
  - platform: status_led
    id: stat_led
    name: "Switch state"
    pin:
      number: GPIO13
      inverted: yes

But when use this, the unit does not boot. The status link blinks and never connects.
If I comment this:

    on_turn_on:
   - light.turn_on: stat_led

or this:

    on_turn_off:
   - light.turn_off: stat_led

The unit boots and works, but obviously without the desired behaviour. With both options enabled, the unit does not boot.

Am I doing something wrong?

this one works for me:

switch:
  - platform: gpio
    pin: GPIO12
    name: ${switch_name}
    id: light_1
    icon: "mdi:lightbulb"
    on_turn_on:
    - light.turn_on: stat_led
    on_turn_off:
    - light.turn_off: stat_led
light:
  - platform: status_led
    id: stat_led
    pin:
      number: GPIO13
      inverted: yes

Looks very much the same, but I don’t use any accent in the name of the switch, or anywhere for that matter.

I know that I’m reviving an old topic, but I’m having the same issue, without accents in my names.

I’m trying to migrate from Tasmota to ESP Home, since when I tried to update Tasmota to the most recent version (For discovery), it failed to connect to the network.

This works:

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode:
        input: true
        pullup: true
      inverted: true
    name: "Relay Button"
    on_press:
      - switch.toggle: relay

switch:
  - platform: gpio
    name: "Sonoff Basic Relay"
    pin: GPIO12
    id: relay
    icon: "mdi:lightbulb"
    restore_mode: "RESTORE_DEFAULT_OFF"
    device_class: "OUTLET"
#    on_turn_on:
#      - light.turn_on: stat_led
#    on_turn_off:
#      - light.turn_off: stat_led

light:
  - platform: status_led
    name: "Relay Status"
    id: stat_led
    pin:
      number: GPIO13
      inverted: yes

When I un-comment the triggers, the device connects to the network and gets an IP address, but it doesn’t respond to anything: pings, API calls, etc. It looks like the basics (I have board revision V1.1).

It appears that this might be a limitation of some boards?
With the light setup, I can do the automation in Home Assistant to get the desired LED functionality. This is not ideal, but should be workable.

Hopefully this answers someone else’s web search.