Just use a small transformer 125/5 V.
The primary side connects to the light switch, using wires that can run in the same conduits as other house wiring.
The secondary side connects to your microprocessor board.
For that you would need an isolated DC/DC converter and galvanically isolated transceiver - maybe an optocoupler.
Perhaps, more easier is to use just an optocoupler with few resistors or capacitors and use 230VAC directly for the switch supply.
simulate this circuit – Schematic created using CircuitLab
Similar question : Link
Where you saw that it directly powers the lines?
The only parts connected to +5V and GND on this circuit are both after the optoisolators, on the "safe, isolated side" of the circuit, so it is isolated.
But bear in mind that this circuit was not designed to withstand mains AC, you can find more rugged solutions if you search for it, for example:
Need help ...
Try driving the transformer primary from a zero-impedance source. The output of an op-amp is ideal for this.
I have successfully used significantly crappy transformers from Mouser (TU016) with excellent results using this technique. -3 dB Frequency response improved from around 200Hz down near 25 or 30Hz.
The Mouser TU016 is a 600-600 Ohm line transformer ...
This isn't something you solve with isolation. It's something you solve with more capacitance.
It's similar to if you haven't eaten and try to suddenly do some strenuous activity and get light headed. Your brain and muscles are working off the same energy reserves but there is not enough of it for both your muscles and your brain so you get light headed. So ...
You could implement the isolated supply using a transformer or coupled inductor with a turn ratio of 1:1.3 in conjunction with a transformer driver IC and a LDO.
Using the transformer and the driver you can create an isolated voltage supply which is slightly higher than the input voltage. The LDO then regulates it to the original value.
This configuration ...