Light sensors for Home Automation
A simple light-dependent resisor (LDR) connected to an Arduino posts regular updates with the light level outside. More sophisticated light sensors are available including ones that give readings on different wavelengths allowing for compensation from UV light. I've tried them but they didn't seem any more useful than the simple LDR for determining how sunny it is outside.
Placing the light sensor is a bit tricky because you want an unobstructed view of outside where there are no house lights that could affect the reading. A single tree in the path of the sun also creates an interesting dip in the graph but generally not enough to affect the determination 'sunny' or 'dark'.
The home automation system uses the external light level to trigger internal lights to come on according to the light state machine. Each light has its own percentage value at which the lights should come on and the level at which they should go off.
This works really well in practice. You can be sitting in the kitchen as a storm rolls in outside and the lights come on just as you notice that it's getting dark inside. In the morning the same lights go off as soon as it's bright enough that they aren't needed. Different lights in the same room can have different percentages set to they come on in a staggered fashion as it gets darker.
Overall I would recommend adding a solar sensor as early as you can if you are creating your own home automation system.
I plan on adding at least one more solar sensor to my set up to measure the light in different compass directions and to provide some fault-tolerance.
Recently we had snow on the ground (a rare occurrence in Seattle). It reflected a lot of light up at the solar sensor so it appeared extra sunny outside, however the skylights were covered with snow so those rooms were darker than normal. Even after 15 years I'm still finding edge-case scenarios that the system can't handle perfectly.