[written by Chris Swart]
Eskom recently introduced their new grid power status tracker; where Eskom keeps us up to date with their Green/ Yellow / Red power status, where Green indicates the grid is stable, orange shows an increase in grid congestion and red indicates the grid is saturated. At the orange level, it is recommended you switch off unneeded electrical appliances, while at the red level Eskom request you switch off any appliances that is not critical.
This new status tracking website does make it easier to stay up to date, but a stand alone display will make it much more visible, and maybe help reduce electrical consumption when a bright red display confronts you. To get the data from Eskom’s website, a BinarySpace challenge was launched on a Friday morning, with a midnight deadline. The goal was simple: Create a Python script that will return the current status, without using too many libraries. Normally this involve scraping html pages for the appropriate tags and posting back the results. But Eskom threw an oddball in using a dynamic page that does not contain any real data in the html code.
Chris managed to get the values using webkit.WebView but more as a workaround as a true solution. Lee found a way in bash, but still had to parse the JSON with an external tool, and had to rewrite the code to work in Python. Between Sebastian and Lee the script was perfected.
A red herring appeared in the form of City level status. The MyEskom website allows you to view the status of your specific area instead of the national status. This can become handy for a visual indicator, or for building hardware that automatically switches off heaters, geysers and pool pumps. Passing the city to the website is a possibility, but makes the script slightly less user friendly since area ID’s are used instead of names.
The solution: sign up on the Eskom site, set your area, and pass the username and password into the Python script.
And the resulting Crowd Sourced Code writing script is available here: http://pastebin.com/t9hGGigU
Now to implement some hardware. Tom added the script to his homeserver, sending the data to an Arduino to display the status on some Neopixels. He laser cut a perspex square and stuck the Neopixels in.
Now a display lives at Binaryspace to indicate the power saturation status.