Photocell’s are light-sensitive, variable resistors. If you need a way to sense the level of ambient light, then there is no easier way to do it. As the light on the sensor increases then the resistance across the two leads decreases. Just Hook a light-sensing photocell up to an Arduino to create an ambient light monitor. Where you can program the Arduino to turn on the room lights when the sun light is not hitting the photocell anymore and turn off the room lights when the sun light is hitting the photocell.