How to know the status of a two way switch through MCU
Yes, you could certainly use an ac current sensor to detect whether or not current is flowing. There are many possible solutions for this, some of which will inherently isolate the detection signal from mains. It's probably time for you to do some additional research into &quot;ac current sensing&quot; and also to think about where all of these pieces of circuitry will be physically located with respect to the physical switch.