You could use a lux sensor. Either a device like the Fibaro for example or use your local weather station. Do a search for Apiwx.