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





