Use can use an electronic component so called LDR (Light Dependant Resistor) there are two type of ldr's one which offer high resistance when light is there in the ambience (surroundings) and the other is the one which offer high resistance when light is not present i.e it is dar . you can somehow dig up the power source or wherever your ac is being powered up from and then use one of these ldrs.