LED Status light issue - Tuya generic light switch / power point

Hi all,
I just can’t work this one out, and it is probably something obvious however I have a tuya generic light switch with 2 buttons / 2 status LEDs and one tuya generic power point and again with 2 buttons and 2 status LEDs… The power point works fine and both status LEDs fade in and out nicely which is what I am trying to achieve on the switch. On the switch though, I can only get LED 1 to fade in and out nicely with LED the other switching on / off instantly.

I originally used ITChipTool to create the yaml and the only difference I can see between both YAML’s is the light platform ( monochromatic / binary ) and the output platform (libretiny_pwm / gpio ). The power point has monochromatic and libretiny_pwm in both light and output platforms respectively and is working fine. The issue is, if I try it on the switch, the second LED stops working altogether. Help! lol I just can’t work out where I am going wrong! Thank you in advance for taking the time to at least read this! :slight_smile:

This works with LED one fading nicely and LED 2 instant:

light:
  - platform: monochromatic
    id: light_switch_1
    output: output_led_1
  
  - platform: binary
    id: light_switch_2
    output: output_led_2
    
output:
  - platform: libretiny_pwm
    id: output_led_1
    pin:
      number: P26
      inverted: false
  
  - platform: gpio
    id: output_led_2
    pin:
      number: P11
      inverted: false

This still works for LED 1, LED 2 is now unresponsive:


light:
  - platform: monochromatic
    id: light_switch_1
    output: output_led_1
  
  - platform: monochromatic
    id: light_switch_2
    output: output_led_2
    
output:
  - platform: libretiny_pwm
    id: output_led_1
    pin:
      number: P26
      inverted: false
  
  - platform: libretiny_pwm
    id: output_led_2
    pin:
      number: P11
      inverted: false

My entire YAML with LED 1 working and LED 2 unresponsive:


substitutions:
  device_name: esphome_test_switch   
  friendly_name: ESPHome - Test Switch   

esphome:
  name: ${device_name}
  friendly_name: ${friendly_name}

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password  
  manual_ip:
    static_ip: 192.168.1.206 
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    dns1: 192.168.1.1
    
  ap:
    ssid: ${device_name}AP
    password: !secret globe_ap_password
  
logger:

web_server:

captive_portal:

mdns:

api:
  encryption:
    key: !secret globe_api_key

ota:
  password: !secret globe_ota_password

button:
  - platform: restart
    name: Restart

bk72xx:
  board: generic-bk7231n-qfn32-tuya 

light:
  - platform: monochromatic
    id: light_switch_1
    output: output_led_1
  
  - platform: monochromatic
    id: light_switch_2
    output: output_led_2
    
output:
  - platform: libretiny_pwm
    id: output_led_1
    pin:
      number: P26
      inverted: false
  
  - platform: libretiny_pwm
    id: output_led_2
    pin:
      number: P11
      inverted: false


binary_sensor:
  - platform: status
    name: Connection   
  - platform: gpio
    id: binary_switch_1
    pin:
      number: P20
      inverted: true
      mode: INPUT_PULLUP
    on_press:
      then:
        - switch.toggle: switch_1
  - platform: gpio
    id: binary_switch_2
    pin:
      number: P7
      inverted: true
      mode: INPUT_PULLUP
    on_press:
      then:
        - switch.toggle: switch_2

switch:
  - platform: gpio
    id: switch_1
    name: Relay 1
    pin: P6
    on_turn_on:
      - light.turn_on: light_switch_1
    on_turn_off:
      - light.turn_off: light_switch_1
  - platform: gpio
    id: switch_2
    name: Relay 2
    pin: P8
    on_turn_on:
      - light.turn_on: light_switch_2
    on_turn_off:
      - light.turn_off: light_switch_2

status_led:
  pin:
    number: P22
    inverted: true

My power point YAML which is working fine:


substitutions:
  device_name: esphome_kitchen_power_point_2    
  friendly_name: ESPHome - Kitchen Power Point 2


esphome:
  name: ${device_name}
  friendly_name: ${friendly_name}

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password  
  manual_ip:
    static_ip: 192.168.1.127
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    dns1: 192.168.1.1
    
  ap:
    ssid: ${device_name}AP
    password: !secret globe_ap_password
  
api:
  encryption:
    key: !secret globe_api_key

ota:
  password: !secret globe_ota_password

logger:

web_server:

captive_portal:

mdns:

button:
  - platform: restart
    name: Restart


bk72xx:
  board: generic-bk7231n-qfn32-tuya

output:
  - platform: libretiny_pwm
    id: output_led_1
    pin:
      number: P24
      inverted: true
  - platform: libretiny_pwm
    id: output_led_2
    pin: 
      number: P6
      inverted: true
light:
  - platform: monochromatic
    id: light_switch_1
    output: output_led_1
  - platform: monochromatic
    id: light_switch_2
    output: output_led_2

binary_sensor:
  - platform: status
    name: Connection 
  - platform: gpio
    id: binary_switch_1
    pin:
      number: P9
      inverted: true
      mode: INPUT_PULLUP
    on_press:
      then:
        - switch.toggle: switch_1
  - platform: gpio
    id: binary_switch_2
    pin:
      number: P7
      inverted: true
      mode: INPUT_PULLUP
    on_press:
      then:
        - switch.toggle: switch_2

switch:
  - platform: gpio
    id: switch_1
    name: Relay 1
    pin: P26
    on_turn_on:
      - light.turn_on: light_switch_1
    on_turn_off:
      - light.turn_off: light_switch_1
  - platform: gpio
    id: switch_2
    name: Relay 2
    pin: P14
    on_turn_on:
      - light.turn_on: light_switch_2
    on_turn_off:
      - light.turn_off: light_switch_2

status_led:
  pin: P8