Make LED show the status of a light (relay defined as light)

Hi there

I would like to have an LED on the powerplug to show the status of the light.
I can make this work without any issues with a switch, but if I enter the same commands for a light, I get a no-no.

So I have two buttons, two relays, and two LED’s.

The code looks like this currently:
First I have the buttons defined.
Then the outputs, followed by the switch, and finally the light.

binary_sensor:
  - platform: gpio
    id: button1
    name: button1
    internal: true
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: true
    on_press:
      - switch.toggle: relay1
  - platform: gpio
    id: button2
    name: button2
    internal: true
    pin:
      number: GPIO12
      mode: INPUT_PULLUP
      inverted: true
    on_press:
      - light.toggle: relay2

output:
  - platform: esp8266_pwm
    id: led1
    pin:
      number: GPIO13
      inverted: true
  - platform: esp8266_pwm
    id: led2
    pin:
      number: GPIO2
      inverted: true
  - platform: gpio
    id: light_relay
    pin: GPIO16

switch:
  - platform: gpio
    pin: GPIO14
    id: relay1
    name: 'server'
    on_turn_on:
      - output.turn_on: led1
    on_turn_off:
      - output.turn_off: led1

light:
  - platform: binary
    id: relay2
    name: freezerlight
    output: light_relay
#    on_turn_on:
#      - output.turn_on: led2
#    on_turn_off:
#      - output.turn_off: led2

The on_turn_on works fine with switches, but if I enter it into the light I get the message:
image

So how do I get this working?

Try the Dev version. I believe these triggers were added to the light recently.

That worked perfectly, it compiled with a single warning:

Compiling /data/serverroompower/.pioenvs/serverroompower/libf87/ESPAsyncWebServer-esphome/SPIFFSEditor.cpp.o
In file included from /data/serverroompower/.piolibdeps/serverroompower/ESPAsyncWebServer-esphome/src/SPIFFSEditor.cpp:1:0:
/data/serverroompower/.piolibdeps/serverroompower/ESPAsyncWebServer-esphome/src/SPIFFSEditor.h:16:101: warning: ‘SPIFFS’ is deprecated (declared at /root/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/FS.h:269): SPIFFS has been deprecated. Please consider moving to LittleFS or other filesystems. [-Wdeprecated-declarations]
SPIFFSEditor(const String& username=String(), const String& password=String(), const fs::FS& fs=SPIFFS);
^
But it did finish, and the LED turns on together with the light.
Not sure if I dare recompile everything.