Sports Team Alerts


#1

As a follow-up to my Scoreboard Pistons found here. I have posted a piston below for individual team alerts.

The current piston sends push notification prior to game, with each team score, and final. Due to the numerous other methods of notifications (i.e TTS via echo/google/sonos or even flashing lights), I did not include those options by default. Feel free to swap out the push notification with any individualized method. For example, I use the cast-web-api to announce the alert over google home based on certain conditions.

    Piston Logic:
  • To allow for as many sports as possible, user will need to set specific varaibles
    • Sport Index (0-Baseball, 1-Football, 2-Basketball, 3-Hockey, 4-Soccer)
    • Team Abbreviation found on ESPN.com
    • Professional Boolean (True = Pro, False = College)
    • Gender Boolean (True = Male; False = Female)
    • League ID for Professional Soccer Only
  • Alert Preferences: Set to true if you want to receive that alert
  • Pre-game Alert Offset - how far in advance to send the pregame alert
*Do not edit any other variables*

  • The piston will run every 5 minutes but only make the API call based on certain conditions. The top webrequest pulls high level data: team info and eventID. Event ID is passed to the second webrequest to get specific game information.
  • The high level webrequest is only completed 4 times a day to prevent spamming the API.
  • The secondary webrequest is only completed if the high level request indicates that the game is live (or about to start = after pre-game alert).
  • Ultimately this means that alerts are not live but will be received at 5 min intervals


  • Sports Scoreboard (American Football for now)
    #2

    I love your piston idea. I tried to follow the instructions, however i am getting a “Score Alert, just scored, currently Array item index is outside of bounds. to Array item index is outside of bounds.,” response. Is there something I am doing wrong?


    #3

    Ultimately that means that data has not populated correctly. Recall that the highest level of data is only pulled every 3 hours so after initial install, data would not populate until the next run. However, until that data populates, you shouldn’t be receiving any alerts. I am assuming that since your post was more than 3 hours ago, the piston has fixed itself?

    Full disclosure, I have actually moved any from using this piston since I left ST. Working on a driver to handle the data gathering and tile generation.