How to wire a light with multiple black/white/green wires from the ceiling

light

There are multiple wires coming from my ceiling, 4 black, white, and green, and 1 yellow wire.

enter image description here

Our light has 1 black, 1 white, and 1 yellow/green.

I wired:
– the black on the light to the bundle of blacks from the ceiling.
– the white on the light to the bundle of whites from the ceiling.

Then plugged in a light bulb. The light bulb was ALWAYS ON no matter what light switch I toggled.

How should I be wiring this? Thanks.

Best Answer

Yellow (and painted white) will be switched hot, connect that to fixture black.

The white bundle is neutral, the white from the fixture goes here.

Fixture yellow/green is ground and gets connected to the green bundle.