Hi, maybe this is a silly question but anyone knows if is possible to power a small transformer with only 1 cable from the ac outlet? (I want to replace some light switches with a homemade controller, but inside them there are only 1 cable splitted to attach the light switch, no earth cable either)
I think you will find that the other conductor is there,but they just don't bring it out to the switch.
In other words,they only have to break one conductor to turn the light on & off.
No,you can't do what you asked if your wiring is as you say.
To operate a transformer off the mains from the light circuit,you would have to get access to the neutral line also.
I strongly suggest that if you want to continue with this project,to consult a Licensed Electrician,who will know what is legal (& safe) .
OR
If your Licensing Authority does allow homeowners to do their own Electrical work,get a copy of the Wiring Rules for your country,& follow them to the letter.