Touch switch Yvvpiupu configuration

I managed to flash an esphome file onto a smart switch with touch, and it works properly except the touch.

Here is my yaml:

esphome:
  name: kitchen-sink-light
  friendly_name: Kitchen Sink Light

bk72xx:
  board: cb3s

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "XXX"

ota:
  - platform: esphome
    password: "XXXX"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kitchen-Sink-Light"
    password: "XXX"

captive_portal:


#uart:
#  rx_pin: GPIO24 #RX1
#  tx_pin: GPIO26 #TX1
#  baud_rate: 9600

#tuya:

status_led:
  pin:
    number: GPIO11
    inverted: true

# Example configuration entry
switch:
  - platform: gpio
    pin: GPIO06
    name: "Green LED"
    id: green_led
    inverted: true

  - platform: gpio
    pin: 07
    name: "Sink Outlet"
    id: outlet
#    on_turn_on:
#      then:
#        switch.turn_on: "blue_led"
#    on_turn_off: 
#      then:
#        switch.turn_off: "blue_led"

#  - platform: gpio
#    pin: 11
#    name: "Blue LED"
#    id: blue_led
#    inverted: true

  - platform: gpio
    pin: 09
    name: "Sink Light"
    id: light
    on_turn_on:
      then:
        switch.turn_on: "green_led"
    on_turn_off: 
      then:
        switch.turn_off: "green_led"

binary_sensor:
  - platform: gpio
    pin:
      number: 14
      mode:
        input: true
        pullup: true
      inverted: true
    name: Outlet
    on_click:
      min_length: 150ms
      then:
        switch.toggle: outlet
    on_double_click: 
      then:
        - switch.toggle: light

#.    CANT BE THIS BECAUSE NOT CONNECTED TO THE UC
#  - platform: gpio
#    pin:
#      number: 10
#      mode:
#        input: true
#        pullup: false
#      inverted: true
#    name: Light
#    on_click:
#      min_length: 50ms
#      then:
#        switch.toggle: light

Pinout: CB3S - LibreTiny

The pins P26 and P24 on the cb3s are connected to the IC to the right (via the two vias to the bottom right of that ic marked A102C; which in turn is also connected to the touch sensitive areas outlined in white silkscreen).

Wondering if anyone has any thoughts on how to get this touch setup to work?

Happy to test things out.

Thank you

Edit: added pics

Figured it out!

Turns out that chip must be some sort of capacitive sensor, it just relays the touches to the pins of the cb3s.
As a result, there’s a second touch button that can be used!
If one is feeling a bit adventurous, there are a few pads that seem like they could accommodate the respective LEDs too!

Pretty happy with this, I got a bonus button for the outlet I was already happy with.
Sweet!

here’s my final YAML:

status_led:

pin:

number: GPIO11

inverted: true

# Example configuration entry

switch:

- platform: gpio

pin: GPIO06

name: "Green LED"

id: green_led

inverted: true

- platform: gpio

pin: 07

name: "Outlet"

id: outlet

- platform: gpio

pin: 09

name: "Light"

id: light

on_turn_on:

then:

switch.turn_on: "green_led"

on_turn_off:

then:

switch.turn_off: "green_led"

binary_sensor:

- platform: gpio

pin:

number: 14

mode:

input: true

pullup: true

inverted: true

name: Outlet

on_click:

min_length: 50ms

then:

switch.toggle: outlet

- platform: gpio

pin:

number: 24

mode:

input: true

pullup: false

inverted: true

name: Light

on_click:

min_length: 50ms

then:

switch.toggle: light

- platform: gpio

pin:

number: 26

mode:

input: true

pullup: false

inverted: true

name: "Button 2"

I hope this helps someone.
Cheers!

One more thought:

There are even solder points for a 3rd relay, and its respective diode; so you could upgrade this entirely if you had the components…

For the second touch button, it doesn’t work when the cover is put back on; presumably because there is no button cutout at that area on the metallic sticker on the backside of the glass. So this could work if you peeled off the sticker and replaced it with something else (or not) or cut a circle similar to the top button that is also cut out.

I’m not going to use this button unless I find a way to make it all look nice.

Cheers!

edit: added pic