Real-Time Sports Scores w/ TeamTracker and TeamTracker-Card (Beta)

Firstly, Go Browns!

Forgive me if I missed a post on here, I have tried many different configurations but I can’t figure out the NBA Cavs abbreviation ( I tried CLE, cle but get the no game scheduled)

I did get all the nfl teams, guardians and the Ohio state buckeyes all working. I just need the NBA and I’ll be good to go.

Thanks in advance for any help.

Thanks!

Cirey

CLE should work. It is showing tonight’s Raptors game for me. It’s possible that the API wasn’t returning the game info yet and you just needed to wait. If you look at the api_message attribute on the sensor, if the team info isn’t found it will give more info as to why.

If you still have problems, post the sensor state and api_message and that will give more info to troubleshoot.

1 Like

yep, your correct. I’m sorry, i thought it would have been there this morning. all is good. Thanks for the work you have put into this! i appreciate it

This is Great, thanks for sharing!

Im not good with templates, is there a way to template just NFL sensors then group conferences then group divisions and if possible list by record within divisions?

Not a template expert either. Maybe someone else on this thread can help.

It sounds like you want standings and not games. This is game tracker for scores. I would assume some simple ESPN JSON call would yield standings. Let me look.

Edit: ESPN Developer Center I/O Docs

Standings is one. You could easily create a single NFL standings sensor with like JQ and attributes.

Edit: I looked through some of the APIs, one could do it but I could not find a single API call to return a single JSON with all the data for NFL. It could be done with a sensor per team and get you all the information you would want.

Like this is for Bills I believe (team 2):

https://sports.core.api.espn.com/v2/sports/football/leagues/nfl/seasons/2022/types/2/teams/2/record?lang=en&region=us

OR. You could just use a scrape sensor and grab this: 2022 NFL Standings | ESPN and create what you want from that. I could not find a single API call that would give the information for that table

Edit again!

OK, after some digging I found this:

https://site.web.api.espn.com/apis/v2/sports/football/nfl/standings?region=us&lang=en&contentorigin=espn&type=0&level=3&sort=winpercent%3Adesc%2Cplayoffseed%3Aasc

This can easily to used to create one sensor with standings if this is what you want. I suggest drawing a picture of what you what. One sensor should be fine with one attribute which contains a streamlined JSON of the stats.

The whole thing returns AFC/NFC, then divisions and teams … standings in order and lots of other stats.

So you could create this as a sensor:

- platform: rest
  name: NFL Standings
  resource: https://site.web.api.espn.com/apis/v2/sports/football/nfl/standings?region=us&lang=en&contentorigin=espn&type=0&level=3&sort=winpercent%3Adesc%2Cplayoffseed%3Aasc
  value_template: "{{ now() }}"
  json_attributes:
    - children

WIthout any JQ filering and you have the entire league stats.

3 Likes

Is anyone able to help convert this to a NodeRed flow?

Thank You so much, now I just have to figure out how to use this information in Lovelace.

Seriously I appreciate you taking your time to help me get this started!

Thanks @Corey_Maxim. If I get a chance watching games this weekend I may implement something in like a flex-table-card. I could probably make it much cleaner and use JQ to parse the JSON into something easier that has just the information needed. Like the idea, would like it on my Sunday wall-mount portal!

Then next up … Fantasy Football maybe!

1 Like

Great job, I love it. I use a conditional card so in case the game is not found its not visible:

type: conditional
conditions:
  - entity: sensor.fcbarcelona
    state_not: NOT_FOUND
card:
  type: custom:teamtracker-card
  entity: sensor.fcbarcelona
  outline: true
  outline_color: '#ffe500'
  theme: Google Light Theme

As a suggestion, it would be good to put the league logo, for example, in small in the middle of the card after the start in X hours or during the match or final result to differentiate one competition from another of the same team.

And if it is possible also leave the moving text of scorers :soccer:, and cards :yellow_square: in the final result… although in that case I suppose it would depend on the sport.

I’ve been playing w/ various options to display league info on the card including a new section in various locations, adding it to an existing section, and displaying the league logo in the background. I’ve wondered a bit it if was just for my own sanity because I keep so many different cards going to confirm I haven’t broken anything. Good to know others might find it useful.

I’m working on supporting individual sports like golf, MMA, and tennis now. As part of those changes, I am adding the ability to display the event name (i.e. UFC Fight Night) at the top of the card. It would be rather easy to add a config option to the card’s YAML to allow the option to display the league abbreviation there as well and will try to include it in the release where I support the additional sports. Could eventually be expanded to the full league name.

I also played w/ adding the ticker to the post-game card for stats, game summaries, etc. For me, it created too much motion but again, I could provide the option via the card’s YAML. If I go in this direction, it will be a little farther out.

BTW, I also use the conditional card to display/hide the card just like you do.

1 Like

v0.5.0 is available and adds support for Golf, MMA, Racing, and Tennis.

You can also add the following to the card’s YAML to display the league abbreviation at the top of the card.
show_league: true

You can track individual athletes by setting the team_id to the athlete’s name. You can also use a single * for the team_id for golf, MMA, and racing and the sensor will automatically match the current leader or active competitor depending on the sport. Remember that you must include the * in quotes when used in YAML.

Lot’s of new functionality for this release so let me know if anyone sees problems. Risk to prior functionality should be minimal but could still have occurred. Let me know if anything broke.

This should now allow the sensor to support any sport available via the ESPN Scoreboard API’s w/ minimal, if any changes.

Full list of new functionality:

  • Added support for the following non-team sports:
    • Golf
    • MMA
    • Racing
    • Tennis
  • Ability to track individual athletes by name for non-team sports
  • Ability to use wild card ‘*’ to track whoever is active/leading in non-team sports
  • Ability to configure the card to display the league abbreviation at the top of card
1 Like

Hi @vasqued2
First off, thanks very much for this. I’m using it for following my nhl, nfl and nba teams. Now trying to get the f1 working.
I select F1 for league and mclaren for team ( also tried * ) but all i get is not_found. Am i missing something?
On a side note is it possible to get the afl? ( australian football league ). I’m guessing not as i can’t find a team as such on the espn site. The espn.com.au has afl but not in the same format as the rest as far as i can tell.
Thanks again

Is the field set for this weekend’s F1 race yet? The API isn’t returning a list of competitors.

I was only able to test using past race results, so I’m not sure how far in advance the competitors will get populated or how frequently the API returns real-time updates during the race. I’ll be watching this weekend and try to push updates if needed.

I am not aware of any API for the AFL. If you are aware of any, let me know and I’ll see what I can do.

Only afl api’s i can find aren’t espns

http://australian-football-league-api.herokuapp.com/api/docs#/

https://developer.sportradar.com/docs/read/australian_rules_football/Australian_Rules_Football_v2#aussie-rules-football-api-map

But i understand you probably have better things to do lol.

But thanks again for the espn trackers

@Modul8, thanks for the research. I’ll take a look at them but will probably stick w/ ESPN APIs, at least in the near-term.

I was able to capture some in-race API data during the F1 sprint yesterday and just released v0.5.1.
It provides some enhanced F1-specific info during the race. Let me know if you are still having problems. Driver name and * should both work. I think the biggest issue was that the API doesn’t return driver info until during or after the first Free Practice session. I was out until after the FP was over so don’t know when exactly it got populated.

Thanks

Thank you for the update!
Not sure if this is the expected behaviour for a driver?
Also the tag for race start time

Or i probably should ask what do i enter for drivers name. I was just going by what i see on espn.com.au when i look up a driver

Ok. Was just surname required.

But tags for race start time still an issue

If i can stay awake I’ll have a look during the race tonight. Thank you again

Try clearing your browser cache and refreshing. If that doesn’t work, let me know what language you have selected for your front end and I’ll see if I can replicate it.

Yeah that did it thank you. Am using the companion app. Cleared cache and all good