I am looking for the simplest electronic solution to be contained in boxes B1 and B2 so that when the switch SW is toggled, a signal (free choice) should be carried across the AC power lines (residential 110/220V) to B2 where it should be detected and converted to a small voltage meant to feed some input GPIO pin of a microcontroller.
In other words, the uC should be aware whenever the switch gets toggled, provided the configuration. B1 and B2 are some feet apart and the circuit is also used for other consumers, therefore no huge voltage or current spikes can be used unless filtered by B2. The carried signal can be of any kind as far as B1 can generate it and B2 can detect (and further cancel) it. I hope for an easy solution, not involving additional uC or heavy signal modulation processing, if possible.
LE: based on the provided answers I want to stress out the need of the simplest solution to send/receive a "sign" of any kind over the power lines. I don't need to de/modulate data, a fair voltage spike generated by B1 that can be detected and filtered out in B2 would be enough for the "sign" I need, if possible. I'd rather avoid uC and heavy processing in B1, maybe just in B2.