[App][Pro] football-data.org - automations based on football matches!

Coloring your home in the colors of your favorite football team on matchday? We’ve got you covered!

This app connects Homey to football-data.org. Their services offer a free tier that can get you the teams and matches from some of the largest competitions: World Cup, European Cup, Champions League, Premier League, La Liga, Serie A, Bundesliga, Eredivise and more!

Their free tier is limited to 10 requests per minute. Our app has smart monitoring setup that scales the number of requests up and down based on if there is a match playing or starting soon. This way we can keep you within that limit easily.

Another thing to note is that their free tier has a 5 minute delay for match events unfortunately. In case you do want live scores and immediate feedback there are tiers available starting at € 12 a month.

Test app (awaiting approval for release)

Setting up the app

  1. Go to football-data.org and signup for an account, you’ll receive your API key per mail
  2. Install the application and go to the app settings where you’ll find a field to paste the API key, save first and then test the connection to validate the API key is working
  3. Go to devices and add a new device for Football Data, you will be prompted to select any competition your API key has access to followed by selecting a team from that competition.
  4. You are ready to setup some flows!

Flow cards

All flow cards are bound to the device (the team) you created.

Triggers (when …)

  • Match starts within X minutes
  • Match kicked off
  • Half-time started
  • Second half started
  • Extra time started
  • Match result changed - emitted on every score change
  • Team conceded a goal
  • Team scored a goal
  • Team draw (final result)
  • Team lost (final result)
  • Team won (final result)

Conditions (and …)

  • Team has a match today
  • Next match is within X hours
  • Team is playing
  • Team is drawing
  • Team is losing
  • Team is winning

Actions (Then …)

  • Get current score - returns tokens for: away team, away score, home team, home score, is _live, match status, score and current minute
  • Get next match - returns tokens for: date, kickoff time, date, days untill match, opponent, venue and is_homematch

Smart polling

To prevent hitting rate limits on the free tier we’ve added a system that scales requests up and down based on the current state for your team:

  • Idle: there are no matches within 2 hours, the polling rate is 1 request per 15 minutes
  • Pre match: a match starts within 2 hours, the polling rate is 1 request per 5 minutes
  • Live: a match is currently being played, the polling rate is 1 request per 30 seconds
  • Paused: during half-time we scale back to 1 request per 2 minutes
  • Post match: after the match polling scales back to 1 request per 15 minutes

This should give enough space to track about 5 teams playing at the same time.

Roadmap

There are no plans for future releases yet, feel free to request any feature!

Changelog

No releases yet, app is available for testing - see the link above.

Source code

I’ve open-sourced the code of this app. It can be found in the Github repository below. Feel free to contribute.