vasqued2 / ha-teamtracker

Home Assistant integration that provides real-time scores in multiple professional (NBA, NFL, NHL, MLB, MLS, and more), college (NCAA), and international (soccer, golf, tennis, mma, racing) sports using ESPN APIs.
166 stars 20 forks source link

In europe soccer: No upcoming games #7

Closed janfajessen closed 1 year ago

janfajessen commented 1 year ago

Very interesting integration. I have tried with 4 soccer teams from different leagues (LIGA:BAR, BUND:MUN, EPL:MCI, LIG1:PSG) and in all of them it shows that there are no upcoming matches and all the data is null. On the cards it puts the league logo and no upcoming match. I don't know if it's an api problem. I know that all those teams have the next Champions League match but I have also tried it with another one that has la liga tomorrow and the same thing. Could you try it to check?

vasqued2 commented 1 year ago

The API works by league, then by team. If a team is playing in a different tournaments or leagues, you have to set a separate integration for each of them. Their upcoming games are not considered a LIGA league game and won't be included in that API. It's considered a CL game. That's the way the API works. The integration doesn't support Champions League out of the box but you should be able to set it up as a custom API configuration.

You can find the League Path to use by going to the ESPN soccer scores page and picking UEFA Champions League from the drop down on the top right.

It will show the URL as https://www.espn.com/soccer/scoreboard/_/league/uefa.champions

Use uefa.champions as the League Path in the custom configuration.

The following works for me:

You can also set it up using the GUI. If you enter XXX as the league, it will bring up a second screen to enter the sport and league path.

vasqued2 commented 1 year ago

And I just checked the LIGA API. As of now, it only returning games for 9/11. It is not returning the ALM/OSA game for 9/12. I would expect it to populate soon.

janfajessen commented 1 year ago

Great, it works! Maybe there is a better way to see the cards in ha dark mode. It seems that it api active the Champions League matches for two days from now, it seems that not for Wednesday's. I guess the api has 48 hours to mark the next match...

🤔 I was thinking if I could even put a tennis player like Carlos Alcaraz :) to know the next match... The code with the names of the competition and team or players can you see them in the link? Like for example tennis/playercard?playerId=3782

vasqued2 commented 1 year ago

Glad to hear it worked.

ESPN rarely provides alternate dark logos. You can apply different themes at the global, view, and card level. Hopefully that gives you enough flexibility to get a look you want.

The data returned for tennis, and other multi-competitor sports, is meaningfully different from two competitor sports. From my perspective it would be better to develop a whole new sensor than to try to force that functionality into this one.

Thanks again for the kind words.

bachoo786 commented 1 year ago

Hi @vasqued2

I have followed the instructions and have put down as the league as EPL and the team id as MUN. However the sensor shows 'NOT_FOUND'. Please see the screenshot below.

image

Can you tell me what am I doing wrong please?

Thanks.

bachoo786 commented 1 year ago

anyone?

vasqued2 commented 1 year ago

Two problem. First the abbreviation for Manchester United in MAN, not MUN. Second, the API is only returning games through 10/1 and the MNC/MAN game is not until 10/2.

Change your abbreviation to MAN and wait until closer to 10/2 for the API to return the 10/2 games.

bachoo786 commented 1 year ago

Two problem. First the abbreviation for Manchester United in MAN, not MUN. Second, the API is only returning games through 10/1 and the MNC/MAN game is not until 10/2.

Change your abbreviation to MAN and wait until closer to 10/2 for the API to return the 10/2 games.

ok thanks will wait till around 2nd October. Changed the abbreviation to MAN but still have the same as before, guess will have to wait near the time as you said.