Thanks for the update. First, you have raw smarts but you are scattered, not able to describe what you want succinctly - and you seem to have no knowledge of code electrical, this stuff can kill you and burn your house down (with the lemons). You need to learn its pecularities (there are many) before you attempt to homebrew anything like this. Like I say, for smart people, knowledge is cheap. Learn more, work less, rather than the other way 'round.
The home automation field is rapidly evolving, and I'd search it to see if someone has already solved your problem. I bet they have. Then you can install a listed, code legal solution without a lot of work.
If you have to homebrew it, it's straightforward with 2 relays, though, that'll be a lot of wire. It can be done properly with one relay but you really need to know what you're doing with neutrals and grounds, in the Code paradigm.
Your ohmmeter testing has established that the switch enclosure is NOT grounded. (or you were hitting it on a painted or rusted spot). That's not a surprise given the vintage of the home. Stop measuring voltages to it... or air. It's futile.
Most likely your house originally had gas lights - that's something to think about if you have a chandelier or ceiling fan, because they often hung those from the gas line. The active, never-disconnected gas line. Isn't old San Francisco housing stock fun?
And you know those 2 wires that were never connected to anything? They're not needed obviously, so please identify them and exclude them from the following test. God only knows where they go to, and energizing power onto them could be a mistake.
If feasible, put an AFCI (Arc Fault) breaker in there. Those prevent house fires. A GFCI (Ground Fault) breaker prevents electrocutions by making sure all current going down a "hot" comes back on the corresponding neutral. Distinguishing the difference is diagnostically useful here.
Time to make a test instrument. Buy a cheapie extension cord. Grab it by the prongs, cut the cord, and throw the prongy part away (or plan your cut and use it for another project.) Strip the cut end of the cord back to expose hot and neutral.
Plug a desk lamp with an Edison base into the socket on the cord. CFLs and LEDs won't work for this - get matched incandescent bulbs. Put one in every lamp under test (remove others), plus one in the desk lamp. Get spares.
Shut the breakers off, wire-nut the leads to any two wires, have a helper turn the breaker on and see what happens. Do the same matrix you did before (leaving out the two mystery wires for now).
- If the test lamp and a fixture both light dimly, you have found a "line" and a "load". This is guaranteed to happen at least twice.
- If they are of unequal brightness, different wattage bulbs, no big.
- If the test lamp lights full brightness, you have found a "line" and a "neutral" or "ground".
- If the lamp lights very brightly, once, you have found two opposing "line" legs of 120V (240V between them). That is special, possibly a MWBC.
- If an overcurrent trips, you did something wrong, or bad wire.
- If a ground fault trips, it means you have found a "line" and a "ground". Or (not likely) a "line" and the neutral from another circuit. Or bad wire.
- If an arc-fault trips, it means the wiring just tried to set your house on fire. There's a remote chance it succeeded - inside-wall fires can take hours to develop - so stay around for a few hours.
That's why I'd start with an arc-fault breaker, especially if you're messing with those two mystery wires. A dual-mode breaker is OK if it can tell you definitely that it tripped for arc-fault and not something else.
Then get back to us and tell us what you find.
Best Answer
You want to use Euro-style RCD equipment for this
The Filipino power system can be treated as a split-phase, no-neutral (hot-hot) system using TT earthing (Terra-Terra, where the source transformer is connected to an earth electrode and local metal parts are connected to a different earth electrode, but there is no conductor connecting the two earth electrodes). As a result of this, North American distribution equipment is only marginally suitable, as much of it assumes that an earthed neutral is distributed.
Instead, I would use two-pole (1P+N) Euro-style circuit breakers and RCDs (RCBOs, preferably, even, so that local socket-outlets can be used) -- however, instead of a single RCCB or RCBO incomer for the entire system, I would use a regular CB for the incomer and RCBOs with 10mA or 30mA residual (differential) trips for the individual circuits. If you really want to use socket-outlet style equipment, SRCDs can be obtained and used with 10mA trips, but they have the disadvantage that they may not come in a suitable socket style for your local plugs.
(Furthermore, this is forward compatible to what the power utility wants to do over there, which is get you converted over to the IEC/Eurostyle system, full stop.)