Pi Lights was a fairly simple idea and my first exploration into DIY home automation: measure the ambient light level throughout the day using a Raspberry Pi, then switch Wi-Fi lights on or off automatically.
Implementation
The system polls several light-dependent resistors and averages their readings before deciding whether to switch the lights. Using multiple sensors and rate-limiting changes made the automation less sensitive to brief shadows or sudden changes in brightness. A dedicated light-sensing Raspberry Pi HAT would have been more accurate, but I wanted to see if I could build a first pass using components I already had lying around. I ran the software as a Linux service so it would start automatically and continue working in the background without needing any attention.
I also designed the system to only switch the lights when the threshold was crossed, avoiding constant requests to the Wi-Fi lights when they were already appropriately on or off. This also meant that if I chose to turn the lights off manually, the system would not turn them back on.

To make the system easier to understand and tune, I also built a small Express server and React client for viewing logs and historical light-level graphs. Seeing the sensor readings over time helped me choose sensible thresholds and diagnose cases where the lights behaved unexpectedly. The project later grew to include a lights-out timer and an Alexa welcome message when I arrived home.

Reflection
Although the end result performs a simple task, building it involved hardware integration, network-controlled devices, scheduling, and monitoring a service intended to run continuously. It taught me that even small automation projects benefit from useful logs and a way to inspect their behaviour, particularly when they interact with an unpredictable physical environment.