How do I wire a switch with 9 wires in the box?
Any thoughts?


Plainly something is messed up. 

I have many times taken apart a switch and discovered that the previous homeowner was creative in their choices. A recent one: white was hot and black was neutral, ground was open, the switch was wired to interrupt the neutral, the white wire from the lamp was connected to the black wire from the wall, and there were two reds, one of which was hot and one was neutral. Oh, and everything was held together with tape, and the wires were all three inches long. Nightmarish. It took me probably an hour to figure out what everything was and correctly label everything so that I could safely change the light fixture. It will take you longer than that in this situation, so be patient.

If something is messed up step one is assume nothing.  Or rather, assume that whoever created this mess knew nothing about electrical code and that everything is about to catch on fire. Proceed carefully and methodically, forming hypotheses, testing them, and recording your results.

It sounds like you've started sensibly: determine which are the hots, and, equally importantly, which breakers control the hots. It might be two different breakers, and they might be 240 V apart from each other as a result. 

It is particularly important to figure out if one of your two hots is switched somewhere else. I have occasionally wired up circuits where the black wire is "always on", the white wire -- recoloured red with tape -- is switched somewhere else. 

Also, be on the lookout for other errors. Is one of the circuits switched on the neutral, for example?  Again, assume that it is wrong until you prove that it is right.

Once you know that the power is shut off completely, put a piece of tape on every wire and number them so that you can record your findings. Do not trust your memory; it is very easy to be distracted.

Check each ground to see if it is open (not connected back to the panel) or closed. Do this by obtaining a known good hot wire, like from an extension cord plugged into a working, correct outlet that you've tested with an outlet tester. If there is a voltage between the known hot and the ground then the ground is closed, if not, then it is open.

If you have three open grounds then you have a problem; your safety system is put together wrong. Solve that problem.  

The closed ground is probably the one that goes back to the panel. Not guaranteed; it could be attached to a pipe somewhere or some such nonsense. (Remember, the person who got you in this mess was a bozo who doesn't wire things correctly.)  But this is evidence that the wires with the closed ground are the wires from the panel.

Regardless, attach all the grounds together. Now you at least know that the grounds are good.

Next, identify which wires are really hot and really neutral -- it sounds like you are well on your way here already. Again, figure out which ones are open and closed. Remember, there might be no potential difference between two hots. Test every wire against a known ground to determine if it is a closed hot, and the rest test against a known hot to determine if they are closed or open neutrals.

Now, for your situation where there is allegedly a white hot wire. If that is the case, first of all, label the wire correctly by wrapping black, blue or red tape around the wire to warn future generations that this is hot.  Next, figure out where the other end of that wire is so that you can see if that thing is miswired.

How do you figure out where the other end of a wire is? First, make sure there is no power to it. You can do this with a continuity tester; you can buy one, or build one yourself out of a flashlight and some scrap wire easily enough.  This will let you identify where all the wires you've not yet identified actually go to.

Suppose you suspect that a black wire goes to a light fixture. Take apart the light fixture and find what looks like the other end of the black wire. Join the light fixture end of the black wire to a second piece of wire, and run the end of that second piece of wire to the box. Now disassemble a flashlight, hook up one end of the circuit to the battery, the other to the bulb, you see how this goes I'm sure, and see if you can turn on the light. If you can, then your hypothesis is correct; you have found two ends of the same black wire.

Keep doing that until you have correctly identified every wire in the box. At that point it should be straightforward to correctly label the wires if any are mislabeled, and rewire the box. Once you do, test the heck out of everything that is attached to that box to make sure that there aren't similar oddities downstream.