I took down a ceiling fan and put a new light fixture in its place. But the entire power box up there was loose, so I had to take it down and tighten everything and put it back up. In the process, I forgot where some wires go.
All circuits are off, everything is well grounded, and I'm not going to hurt myself, but here's the situation:
There are three wires (three black/white pairs) coming into this power box where the ceiling fixture gets attached. I believe
that one is from the wall switch, one is from the circuit source, and one leads to the other ceiling fixtures on the floor. I believe this because as long as I connect the the source wire and the wire that leads to the other fixtures (black to black, white to white), then when I turn the ciurcuit breaker on, everything upstairs works fine except
the fixture I'm working on. However, even when I connect the light fixture to the switch, it still doesn't work. Because I don't think there's anything else running to that switch. I've tried several other configurations of connecting the wires - some result in the switch working, or only working for one of the lightbulbs but not the other, or the light being on all the time, or being controlled by multiple switches that it shouldn't be, etc., but these always also have the side effect of strange behavior among all the other ceiling fixtures on the floor (not coming on, or coming on dimly).
So my question is this - if I've got two wires up there that, when attached, form a complete working circuit for everything else upstairs, and another wire that goes to the switch, (and of course the wire pairs coming out of the bulb sockets in the fixture) then what is the proper way to wire the switch and the fixture into the circuit in order to get them working correctly?
I'm confused because generally I imagine power running from the source through to the switch and then to the light, but I think this is somehow different. Am I crazy?
Also, I know that when I first took the old fan down, the wires were attached in some kind of crazy way with multiple wires of opposite colors twisted together. I'm trying to recreate that but I'm failing.