I bought a photocell sensor on eBay after learning Lowes, Home Depot, and Walmart were either out of stock on them or did not carry them. No problem, I thought, 3 wires and it should come with instructions. It arrived, but with no instructions except on the little plastic part (see second photo). I am NOT an electrician, but usually can handle easy projects. If it had 2 wires, it should be easy, but with 3......that's a problem. I went online to instructables, Youtube, and a few other sites. Although I could not find anything showing what I needed, I did gather enough to attempt it. Here is my wiring diagram ( third photo) and instructions:

CAUTION: BLACK WIRE IS 120 VOLTS, SO TURN OFF SWITCH OR CIRCUIT BREAKER.