Automatic function of street light can be done by the use of:

Thermistor

Inductor

Capacitor

Comparator