I did this some time in the 1980's. Originally intended as a flashing light controller for advertising, and run on batteries charged from a solar cell. It is supposed to be a night detector that is fairly immune to the headlights of passing cars. The batteries charge in the day time and it flashes for 30 minutes at the beginning of night. Then it latches out until daytime is detected and won't start again until night is detected. The prototype worked properly. The customer never implemented this in his final design.