ESPHome configuration yaml for UltraPro toggle dimmer switch

I’m very new to ESPHome.

I decided to give tuya-cloudcutter a try on one of my switches, and now I’m stuck.

The switch in question is this:
Amazon link

Ultrapro Wifi Toggle Dimmer 51427

I got a raspberry pi 5, with latest raspberry os 64 bit.
I loaded and successfully ran the tuya cloudcutter process on this switch.
The switch now has the kickstart firmware and is on my home wifi network, and I can access its webpage at 192.168.4.1.

I then downloaded LTChipTool and found a profile for this switch on that application, and copied the yaml code it produced, and pasted it into ESPHome Device Builder.
I also tried the yaml code I got from UPK2ESPHome.

But when I clicked install in ESPHome Device Builder and chose “manual” (I planned to upload it through kickstart at 192.168.4.1), it gave me this error message:

Failed config

output.libretiny_pwm: [source /config/esphome/basement-toy-area.yaml:34]
  platform: libretiny_pwm
  id: output_red
  
  Pin number '19' is not usable for board generic-bk7231n-qfn32-tuya.
  pin: P19

I have a feeling that this config code is not the right code for this switch, but not sure.

Any suggestions?

This is the config code I pasted into ESPHome Device Builder:

esphome:
  name: upk2esphome-bk7231n

bk72xx:
  board: generic-bk7231n-qfn32-tuya

logger:

web_server:

captive_portal:

mdns:

api:
  password: ""

ota:
  platform: esphome
  password: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:

text_sensor:
  - platform: libretiny
    version:
      name: LibreTiny Version

output:
  - platform: libretiny_pwm
    id: output_red
    pin: P19
  - platform: libretiny_pwm
    id: output_green
    pin: P18
  - platform: libretiny_pwm
    id: output_blue
    pin: P8
  - platform: libretiny_pwm
    id: output_cold
    pin: P7
  - platform: libretiny_pwm
    id: output_warm
    pin: P6

light:
  - platform: rgbww
    id: light_rgbww
    name: Light
    color_interlock: true
    cold_white_color_temperature: 6500 K
    warm_white_color_temperature: 2700 K
    red: output_red
    green: output_green
    blue: output_blue
    cold_white: output_cold
    warm_white: output_warm

And I think if you fix that you will find you get the same error for P18.

Have a look at the pinout and maybe try some valid pins. Not sure what you can break unfortunately.

You could also have a look at the circuit board if you can get it apart…. Post some photos if you do.

I used the kickstart webpage to scan all the pins.
The only pins that responded were 8 and 14.
When I selected pin 8, there was a response on a downpress of the toggle switch.
When I selected pin 14, then it just shows continuous responses, no need for me to touch the actual switch.

There are the only responses I got from the pins from the kickstart webpage.