Very easy mod to control the UGREEN usb switches with EspHome.
- Take the enclosure apart (see images)
- Bridge the SMD pads on the pcb near the USB MINI-B connector (blue line on the photo)
- Flash an ESP32-C3 board (see photo) with the following in the config:
- platform: gpio
pin:
number: GPIO18
mode: OUTPUT_OPEN_DRAIN
inverted: true
id: usb_switch
button:
- platform: output
name: "Toggle USB Source"
output: usb_switch
duration: 100ms
icon: "mdi:swap-horizontal"
status_led:
pin:
number: GPIO8
inverted: true```
4. Connect the two with a USB Type-C to USB MINI-B cable
That’s it ✨