I have this device. I have the ESP8266 Version.
I want to setup the light switch button to toggle my light bulb on and off directtly (without turning off the relay cutting the power) when I touch the button. I would also like to make the same button to toggle the relay when I hold the button for 2 secs.
Issue is that the the same gpio can’t be use to do both. I wanted to avoid using MQTT as it has the issue of doubling up the switches in Home Assistant. I know I can make it so that doesn’t happening but I would like to see ESPhome can do this on it own.
I can kinda do this with the Tasmota scripting but it has the same GPIO issue and a difficult console interface and so many rules to setup for this device just to work I gave up trying to work it out.
I have the same device but with a WB3S - BK7231T chip running OpenBeken. It took some stuffing about but finally got it going with some easy autoexec.bat script. Unfortunatly, I have the ESP8266 version and OpenBeken doesn’t support that yet.
I wanted to give ESPhome a go as it functions well with in Home Assistant and would allow me to have all my devices running ESPhome and not have to use MQTT. Not that I hate MQTT it’s just an extra step. I guess If I can’t do it then I might leave everything as it is as and convert this device back to Tasmota and live with that fact that it can’t be done for now.
I would stay with ESPhome but it is not working well with this device as the fan get stuck on MED speed and I have no idea how to fix it at the moment. This device has a very stange relay system setup and the script on the ESPhome site doesn’t work how it should. That will be my next step if I get this working first. One thing at a time.
So far I haven’t had luck so I’m turning to you to see if you can help me work it out. So far i have this
I’ve also asked ChatGPT and Claude to help out but they all give the same answers and so far it appears it can’t be done easily. I have searched Google this forum and so many others like it but still can’t find an answer that works. My guess is it can’t be done but doesn’t hurt to ask.
binary_sensor:
- platform: gpio
pin: GPIO16
name: "Touch Switch"
id: touch_switch
on_press:
- homeassistant.service:
service: light.toggle
data:
entity_id: light.lounge
on_multi_click:
- timing:
- ON for at least 2s
then:
- switch.toggle: relay
switch:
- platform: gpio
name: "Relay"
pin: GPIO16 # Physical relay connected to GPIO16
id: relay