Anyways, I have create a "remote switch" with 2 relays and a esp8266 and put in my wall switch. That way, I can turn on/off the ceiling fan and lights. Inside the wall, I have 4 wires, LIVE, NEUTRAL, FAN, LIGHTS.
The LIVE and NEUTRAL goes to a stripped down "USB-charger", thus outputs 5v that I then feed to the relays and a Wemos D1 Mini (esp8266). I then use 4 pins on the Wemos. 2 pins goes to 2 push buttons for manually turning on/off the relays. The other 2 pins goes to the 2 channels on the relays. Everything works fine, except one annoying thing!
If I switch on/off my lights or fan in another room (which has a normal wall switch), it sometimes triggers the relays to swich in the OTHER ROOM where my Wemos is connected! It seems like the fast electric spike that happens in the other room is somehow effecting the pins on the Wemos and it acts like the manual buttons where pushed.
Does anyone know how this can happen and how I can prevent it? It drives me crazy
Please let me know if you need any further explanation. Thanks!