wire powered?

Some form of light sensor (LDR, phototransistor etc) would be the easiest and safest - no connections to harmful voltages..........