The goal light is essentially a wifi device that connects to the internet and alerts you when your favourite team scores a goal. The Arduino side of things is pretty straight forward. Just a light or buzzer or both triggered by an event being sent to it on the serial port. So, how do we find out if a team scored and how do we send that to the Arduino? I wrote a little Python script for that. You should note that there are some important changes between python 2 and python 3 in areas like string parsing and encoding and the url library (all things essential to this script!). I wrote this for python 3. If you are still using 2 you’ll have to modify the string and url functions. Also, the example code is for the Montreal Canadiens playing away. To change it for home games, replace the line:
lo = li[2].split("homeTeam", 1)
to:
lo = li[2].split("scoringDetails", 1)
For the moment, my Arduino sketch is nothing more than a simple melody played when the messages comes on the serial port. It also writes the current score to the serial monitor. Of course you can modify this to do whatever you want when you receive the goal message. The sketch is based on the Arduino Buzzer example sketch.