This is a set of scripts to control a stop light (traffic light) with a raspberry pi and its gpio pins (external circuitry is yours to design - I use a buffer and a set of solid state relays). Originally the group I work for used PagerDuty but since moved to OpsGenie for paging/alerting. Both scripts are included.
Copy settings.py-dist to settings.py and set the appropriate variables.