Hello there! i installed the esphome software on a cheap “qs-wifi-s04-2c” and i have this problem, when i’m on the bench with a simple wire to test with the device correctly detects on and off states and it toggles without any problems the relay accordingly but when i try to install it into my light system it goes crazy and starts randomly changing the state. This is how i’m detecting the being button pressed:
The module (qs-wifi-s04-2c) has 220V ac voltage detection on the inside, maybe it has a simple resistor to drop down the 220v AC to friendly 3.3V so probably it pulls HIGH the GPIO when 220V is attached to the internal resistor
Hold on sir, i was trying to OTA update the firmware on the device and looks like my entire home assistant istance crashed right after system update, i will wait for it to recover
I had a similar issue with a similar device.
Internally, my device has a resistor divider to the base of a transistor. This transistor pulls down the GPIO input.
Unfortunately, when the external switch is open, it seems that with such low current going into the pin, something in my house makes some voltage build up there, and the transistor ends up activating when it should not.
I tried a relatively large resistor between S1 and N, but this did not help at all.
The only thing that helped was a 100V zener diode in series with S1, “pointing out”, so that in order to activate the transistor, there needs to be more than 100V in that input.
So… S1 ----|>Z---- your switch.