How I Programmed Philips Hue Lights to Notify Me of Baseball Scores for Icee Deals

Update (May 2019): ESPN has discontinued IFTTT integration months ago, and I’m still looking for a simple alternative rather than scraping scores with some custom Python code or something similar. Suggestions welcome, as the below info May no longer apply.

Hacker Fun for Baseball Drink Deals:

Want to take advantage of local deals based on your home team’s game scores?

I’m a deal-hunter and life-hacker. So when I saw that Mobile on the Run Gas stations were running $.50 drink days based on my home baseball team’s score, I saw a fun challenge.

The challenge

Could I get my newly installed fireplace smart LED lights (powered by Philips Hue) to automatically light up Cardinals red when our St. Louis baseball team scored the necessary “more than 6” runs?

How cool would it be to have my great room turn red to notify me that I needed to run to the gas station and get my drink deal?

Icees, here I come!

The Solution

If Then Then This (IFTTT) is a favorite service of mine where you can do just about anything online if you can find the right “recipe.”

Since my challenge was based on a sports team’s score, I used ESPN, but I needed to limit the variable to 6 or more runs.

Here’s the steps:

  • Set up an IFTTT Recipe with ESPN service
  • ESPN Populates a Google Sheet with the Cardinal’s Final Score
  • Setup a formula field cell to only change when STL Cardinal’s score is greater than 6
  • When this happens, another IFTTT Recipe monitors Google Sheets and sets the Philips Hue Fireplace lights to the desired scene

Pretty cool outcome.

I enjoyed the end result of having my fireplace turn red. It can be a bit eerie when you’re in bed and the great room turns red all of a sudden, but it’s the price to pay for a .50 drink.

It can surely be accomplished in many ways, but this worked for me. I can share my Google sheet or feel free to take the magic below to be added to the file ESPN creates:

Column E:

  • =ARRAYFORMULA(IF(ISBLANK($B$1:$B),, MID(B1:B,FIND(“STL”,B1:B)+4,2)+0))

Column F:

  • =ARRAYFORMULA(IF(E1:E<6, “”, “yes”))

Column G:

  • =SUMIF(F1:F,”yes”,E1:E)

Then you can set up any IFTTT Recipe (or trigger) to happen when this cell updates. In my case, it was the fireplace. For you it could be a text, an email, etc.

I’d like to have this trigger the next morning, but since IFTTT does not support timed events it may involve another service or possibly a field calculation in Google sheets involving the clock or date. I’ll update this post accordingly. 😉

P.S. There’s also a McDonald’s deal if the Cardinals score a home run, but I haven’t figure out how to translate that to the lights yet.

Feel free to enlighten me. For now, I’m using the “Mike app” to keep me posted (my friend Mike monitors sports more than I do!).

Posted in: , | Tagged with:

Brett