Luminance Sensor, You can automate this process if you add an ambient light sensor to your smart home setup.