Moving into a new building and wanting to wire a new ceiling fixture into the box built into the ceiling. The fixture has only black, white, and an uninsulated copper wire. It does have green screws which are not hooked up to anything also. The fixture is to be operated by a wall switch—one switch only, not two—nothing else. The ceiling connection box has red, white, black and green wires. If you connect black to black, white to white, and uninsulated to green (ground I assume) the light turns on but the wall switch does not operate it; the wall switch will not turn it off. The red wire obviously is tied to the switch control. How to connect it into all this? What to do at this point? Not at all clear!!
how to wire ceiling fixture with only black white and ground wires into box with black red green and white wires?
Connect fixture black to ceiling box red instead
From what you've done so far, it's clear that the black wire in your ceiling box is an always-hot wire. So, we can safely assume by elimination that the red wire must be the switched-hot you're looking for, since we already know what neutral and ground are as well.
It may have originally been intended for a ceiling fan with a remote control. I agree that the red is probably the switched wire. It would be best to verify with a voltmeter though. + Oct 1, 2022 at 16:44
Great and just cover the end of the ceiling box black and leave it there right?– Larry GOct 1, 2022 at 17:00
@LarryG correct Oct 1, 2022 at 17:02
OK So I did this and the fixture worked fine. Off and on multiple times in the last 24 hours. Now today the switch will not stay in the on position. It's like there is a spring in there now. While I hold it down the light will stay on, but as soon as I take my finger off the switch it pops back into the off position and the light, of course, goes off. Wha??– Larry GOct 2, 2022 at 11:55
@LarryG the actual light switch? if that's the case, then the switch broke internally and needs to be replaced Oct 2, 2022 at 13:53