The idea of placing a sensor in this position is to monitor the light level entering the cockpit window and control instrument illumination to track this level. So your eyes don't have to adjust too much when shifting your gaze from outside to the screens. Sensors on instruments work in conjunction with this to keep ambient light inside the cockpit from overpowering the displays.