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

So I am sure this is a silly question but- can you track more than one team / sport or is it only one? Assuming you can track more than one or better put, have multiple sensors, would you just hand jam each in the config.yaml?

Sure you can in YAML. See here for NFL Real-Time Sports Scores w/ TeamTracker and TeamTracker-Card (Beta) - #5 by kbrown01

1 Like

Thanks- not sure how I missed that

Hi guys, any chance to track tennis? In this case I’d like to track a specific player (e.g. Rafa Nadal) and show all his matches. I read the Custom API Configuration part, but there’s no team_id for tennis, of course.

Unfortunately not right now.

Games are considered events with a single competition between two competitors. Tennis tournaments, golf tournaments, racing, etc. are considered events made up of multiple competitions and/or multiple competitors. It would require a ton of changes to the existing logic to work and I’d probably just create a different integration. Right now I still want to confirm hockey and basketball are stable. Once that’s done, I may look at creating a new integration for these other types of sports depending on what type of in-game updates they provide.

4 Likes

Hi thanks!
Just tested with GS and working fine.
I have a doubt, how many hours before the game starts ESPN consider to start sending the infos trhough the API?

Also: There is a way to include MMAs?

Each sport/league loads future games on a different schedule. The NFL loads the next week on Tuesdays. Other sports with games throughout the week load a couple days before the scheduled game. Preseason games appear to load with even less lead time. Since the NBA season hasn’t started yet, I don’t have a sense of what the schedule will be. The WNBA was loading a day or two before the game. The NHL is loading the preseason games anywhere from a day before to the day of the game.

MMA is like tennis. It will require a significant logic change. I want to make sure NHL and NBA is working smoothly before pulling them in or building a separate integration.

1 Like

Sure, thanks for the reply, take your time bro, thank you so much for integration =)

Excellent work bro, I was trying to make it work with the Spanish Football League, but I get NOT_FOUND.

La Liga or something else? For La Liga, just enter LIGA as the league and then the team abbreviation. If you’ve already done this and are still getting NOT_FOUND, it’s probably because your next upcoming game is not loaded into the API yet. Right now, the La Liga API is only returning games through 9/30.

I’m going to add something to make it clearer how far into the future the API looks so people know if there is a real problem or if it’s just that the games aren’t loaded yet.

@vasqued2 any way to show the infos in another language?
pt-br?
I read something about espn br api, but didnt find where to change.
thanks!

If you change the definition of URL_TAIL in const.py from
URL_TAIL = "/scoreboard"
to
URL_TAIL = "/scoreboard?lang=es"
it looks like it will translate it to Spanish.

I’ve never tested it w/ the integration so don’t know how it will behave. Not sure if other languages are supported by the API or not. You will have to experiment. Let me know if you find something that works.

Maybe @betohs can provide info on what he did w/ translations.

Nice, I will give it a try on Memphis game tomorrow hahah
lets see what happens and I let you informed

Maybe the sad part here is that when you release a new version, we always need to change the file right?

Let me know how it went and if you found any other languages supported. Right now you’re right, you would have to make the change to the file each time. Once we understand how it works and what’s available, I might be able to create an option to handle it in some manner.

Just tested it right now.

When changing the final url to “?lang=pt”, working fine.
image

Not all words is fully translated but maybe they are variables you set on code, but the API infos seems to be working ok…

@vasqued2 if you want help I can translate the texts to pt, just let me know. Thanks!

Nice.

There are several things that I will need to change to enable localizations:

  • Format dates and times based on the locale instead of hard-coding it to use “en-US”
    • This should fix the dates and times
  • Use the locale to append the correct language to the API call so the API returns in the desired language
    • This will automatically append the correct ‘lang’ suffix to the API so you don’t have to change the const.py file
  • Translate the hard-coded phrases in the card based on the locale
    • This will translate phrases like “Tipoff” and “Win Probability”

I’ve got a good idea on how to do the first two but will likely need you to test.

I don’t know how to do the third. If you or anyone else know how I can use translation files with the Javascript for the card, let me know or point me to some examples.

I’ve got a minor release that should be ready in the next couple days. Once that’s out, I’ll see what I can get working with the localization.

immm, I am not a JS master and is not my best programming language, I thought maybe if you create like a .py json file with the words in a dictionary, and then I could submit an pt-br version.

basically the same way here:

Im just suggesting here ok, maybe is not possible at all haha

about the tests I can do it just let me know when you release, the topics here are not notifying on my email (dunno why)
but you can send me a msg on telegram

That’s my hope too, but I haven’t seen any examples for HA cards so hopefully someone else will be able to give some pointers.

This is great work, thanks so much. I’d like to pull touchdown notifications out of the integrations for NCAAF and NFL games that are being tracked. If I can get that then the lights can flash team colors and play the fight song etc. I suppose you could setup an automation that triggers on “possession” value and “last play” contains “TOUCHDOWN”? Do you have another suggestion? Is there a way to build that into the integration somehow?

The Wiki has an example of an automation for any score change. If you just want touchdowns, just make sure the to_state score is greater than the from_state score plus 5. That’s what I do.

2 Likes