I want to use home automation, so I am thinking of using INPUT to ESP8266 from PC814 bi-directional optocoupler for mains 230V physical switch.
Using this scheme I don't have to modify my house wiring and I will just connect physical wall switch output which was going to device will now go to PC814 optocoupler using some 100k resistor. Now PC814 output size NPN Switch will be connected to NODEMCU GPIO.
But I doubt that @ 50 Hz my input will be toggling every 20 ms. How can I avoid this toggling and by using mimimum components to get continuous signal until power is present on input of PC814?
Need experts advice if anyone had tried this scheme.