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.
174 stars 20 forks source link

Tennis ? #62

Closed schumi2309 closed 1 year ago

schumi2309 commented 1 year ago

Hello,

The tennis season is starting again and I realize that I can't get the players I want to follow, probably due to the name I put in the configuration: ex: for Nadal (who plays this January 17) I can put nadal or rafael-nadal, I always have the result 'not_found'

Capture d’écran 2023-01-17 à 15 21 46

Thanks if you could give me a hand...

For exemple. Thanks

vasqued2 commented 1 year ago

It's working for me now. Maybe a timing issue? If you are still having problems can you share your YAML or what you typed in to the UI when you set it up.

Screenshot_20230117-103253_Home Assistant

schumi2309 commented 1 year ago

I do it through UI. Here's what I've put in and it's not working:

Capture d’écran 2023-01-17 à 19 21 40

I also tried in my sensor.yaml:

Capture d’écran 2023-01-17 à 20 08 12

and still the same...

vasqued2 commented 1 year ago

What version of the sensor are you using? What is your language set to? Also try NADA for team_id

schumi2309 commented 1 year ago

this is the version:

Capture d’écran 2023-01-18 à 13 11 57

and my language is french.

And i have a same problem with Djokovic... not normal

vasqued2 commented 1 year ago

I’ve been able to recreate when I change my backend language to French. If I use English, it works. It looks like the Tennis API doesn’t support French. In the past when I’ve requested a non-supported language, it defaulted to English. This one appears to error out instead of just returning info in English. I will have to dig in more tonight to confirm and see how to handle.

vasqued2 commented 1 year ago

I've confirmed the tennis API does not support French translations and generates an error instead of defaulting to English.

You have a couple choices.

  1. Change your backend language to a supported language (English, Spanish, potentially others)
  2. Manually install the fix from the Linters branch if you know how. There are no known issues but I can't guarantee there are none.
  3. Wait for the next release. Not sure when this will be.
schumi2309 commented 1 year ago

when you talk about language put in english, does that mean put home assistant in english? or is it something else? thanks to you.

vasqued2 commented 1 year ago

Yes. Set the language of your backend to English.

Once you restart, it will tell the API to use English instead of French and the sensor should work The problem is I don’t know what else will change when you do this. You can always reset it back to French if there are other adverse consequences..

I know it won’t change your front end language, because that is based on the language you set under your name, but I don’t know what else will be impacted.

I will try to release a beta version tonight that will fix the problem (I.e. ignore the language you set for the backend if the API generates an error and default it to English). I’ve never released a beta version before so I don’t know if it will work. But I will try. If it does, then you should be able to install the beta version from HACS and leave your backend language in French.

schumi2309 commented 1 year ago

Ok no problem

I already checked for the beta version in HACS. I am expecting this tonight. A big thank you to you.

vasqued2 commented 1 year ago

You should be able to install v0.6.4-beta1 from HACS. It will default the API to English and retry if the first attempt errors out because of an unsupported language.

Let me know if it solves the problem or not.

Also, if you can provide a French translation for the card elements, I'd be glad to include it in the next release.

Ryszard23 commented 1 year ago

My HA is in Polish. The beta version solves the problem and works very well.

schumi2309 commented 1 year ago

Hello, Thank you for racking your brains trying to solve this problem with the French language. After the small test with your beta version, it still does not work for me. On the other hand, if I put HA in English, the players are well recognized, then I put HA back in French, and it keeps my entity well, and it works. So, in summary, the beta version does not solve this problem for the moment. this is still not the right modification.

Regarding the possibility of providing you with the translations in French, there is no problem. Just tell me what you need, and how we're going to organize it. I am at your disposal.

I will still continue my tests, if I find something else, I will send you a message

schumi2309 commented 1 year ago

But beware: If I submit my HA in French here: general-parameter-language It doesn't work anymore, I lose the player.

Capture d’écran 2023-01-20 à 13 48 03

It absolutely must be in English.

But I can leave in my profile, the French language, and it works.

Capture d’écran 2023-01-20 à 13 53 55

therefore, in summary, it is necessary in general-language to put in English and in profile to leave it in French.

vasqued2 commented 1 year ago

Glad it helped for Polish.

@schumi2309, can you turn on debug level logging, reboot, search for teamtracker in the full logs and then post the results here. If you have a lot of sensors, you can search on the sensor name too.

Do it for both the working English and the non-working French.

Thanks!

vasqued2 commented 1 year ago

https://github.com/vasqued2/ha-teamtracker/wiki/Turning-on-DEBUG-level-logging

vasqued2 commented 1 year ago

Since it’s now working for me, there is nothing more I can do without seeing your debug logs.

schumi2309 commented 1 year ago

I put this in the config.yaml

logger: logs: custom_components.teamtracker: debug

Now I'll find it and the log and show it to you?

vasqued2 commented 1 year ago

Yes. Make sure the indenting is correct because it matters. Then reboot.

Then reboot and search for teamtracker in the log. You will want to look at the full log. You should see something like the following:

2023-01-20 09:44:23.432 DEBUG (MainThread) [custom_components.teamtracker] tt_atp: Data will be updated every 0:10:00 minutes
2023-01-20 09:44:25.725 DEBUG (MainThread) [custom_components.teamtracker] tt_atp: Getting state for 'NADAL' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr&limit=25&dates=20230119-20230125
2023-01-20 09:44:29.126 DEBUG (MainThread) [custom_components.teamtracker] tt_atp: Getting state without date constraint for 'NADAL' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr
2023-01-20 09:44:43.710 DEBUG (MainThread) [custom_components.teamtracker] tt_atp: Getting state without date constraint for 'NADAL' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard
2023-01-20 09:44:43.897 DEBUG (MainThread) [custom_components.teamtracker.event] tt_atp: Found competition for 'NADAL' in athlete name; parsing data
2023-01-20 09:44:43.900 DEBUG (MainThread) [custom_components.teamtracker.event] tt_atp: Found competition for 'NADAL' in athlete name; parsing data
2023-01-20 09:44:43.907 DEBUG (MainThread) [custom_components.teamtracker] Finished fetching tt_atp data in 20.474 seconds (success: True)
2023-01-20 09:44:46.113 DEBUG (MainThread) [custom_components.teamtracker.event] tt_atp: Found competition for 'NADAL' in athlete name; parsing data
2023-01-20 09:44:46.117 DEBUG (MainThread) [custom_components.teamtracker.event] tt_atp: Found competition for 'NADAL' in athlete name; parsing data
2023-01-20 09:44:46.125 DEBUG (MainThread) [custom_components.teamtracker] Finished fetching tt_atp data in 0.014 seconds (success: True)

Except yours isn't going to show that it found NADAL when the language is 'fr' like mine does. Hopefully we'll be able to look at the URL and see why.

I would like to see it when you have the language set to English and French so I can compare the two. Reboot after you change the language and then check the log.

Thanks

vasqued2 commented 1 year ago

It looks like it hadn't completely gotten done processing the API data before you searched and copied it. That's OK for the include because it's behaving the way it should but wait a couple minutes after restarting before searching and pulling the logs in french.

vasqued2 commented 1 year ago

Can you search specifically for Nadal or Djokovic in the log and paste it in. No need to restart. There should have been a line with the URL like in English version you pasted. I want to see that and then all of the things that come after. I only need it for Nadal or Djokovic, not both.

vasqued2 commented 1 year ago

I'm actually expecting to see 3 different URLs in three separate lines, For some reason when in French, it's finding the Rolex Shanghai Masters and China open instead of the Australian Open.

schumi2309 commented 1 year ago

this is in french:

For Djokovic:

2023-01-21 17:41:24.409 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: Rolex Shanghai Masters 2023-01-21 17:41:24.409 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: Rolex Shanghai Masters (TBD) 2023-01-21 17:41:24.410 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: China Open 2023-01-21 17:41:24.411 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: No competitor information 'DJOKOVIC' returned by API 2023-01-21 17:41:24.411 DEBUG (MainThread) [custom_components.teamtracker] Finished fetching Djokovic data in 0.002 seconds (success: True)

2023-01-21 18:02:30.621 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Getting state for 'DJOKOVIC' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr&limit=25&dates=20230120-20230126

For Nadal:

2023-01-21 17:41:24.406 DEBUG (MainThread) [custom_components.teamtracker.event] Nadel: async_process_event() No competitions for this event: Rolex Shanghai Masters 2023-01-21 17:41:24.407 DEBUG (MainThread) [custom_components.teamtracker.event] Nadel: async_process_event() No competitions for this event: Rolex Shanghai Masters (TBD) 2023-01-21 17:41:24.407 DEBUG (MainThread) [custom_components.teamtracker.event] Nadel: async_process_event() No competitions for this event: China Open 2023-01-21 17:41:24.408 DEBUG (MainThread) [custom_components.teamtracker.event] Nadel: No competitor information 'NADAL' returned by API 2023-01-21 17:41:24.409 DEBUG (MainThread) [custom_components.teamtracker] Finished fetching Nadel data in 0.003 seconds (success: True)

2023-01-21 18:02:30.181 DEBUG (MainThread) [custom_components.teamtracker] Nadel: Getting state for 'NADAL' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr&limit=25&dates=20230120-20230126


this is in english:

2023-01-21 17:54:25.548 DEBUG (MainThread) [custom_components.teamtracker.event] Nadel: Found competition for 'NADAL' in athlete name; parsing data 2023-01-21 17:54:25.550 DEBUG (MainThread) [custom_components.teamtracker.event] Nadel: Found competition for 'NADAL' in athlete name; parsing data 2023-01-21 17:54:25.553 DEBUG (MainThread) [custom_components.teamtracker] Finished fetching Nadel data in 0.007 seconds (success: True) 2023-01-21 17:54:25.556 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: Found competition for 'DJOKOVIC' in athlete name; parsing data 2023-01-21 17:54:25.558 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: Found competition for 'DJOKOVIC' in athlete name; parsing data 2023-01-21 17:54:25.561 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: Found competition for 'DJOKOVIC' in athlete name; parsing data 2023-01-21 17:54:25.562 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: Found competition for 'DJOKOVIC' in athlete name; parsing data 2023-01-21 17:54:25.564 DEBUG (MainThread) [custom_components.teamtracker] Finished fetching Djokovic data in 0.011 seconds (success: True)

2023-01-21 17:54:22.277 DEBUG (MainThread) [custom_components.teamtracker] team_tracker_barcelone: Getting state for 'BAR' from http://site.api.espn.com/apis/site/v2/sports/soccer/esp.1/scoreboard?lang=en&limit=25&dates=20230120-20230126 2023-01-21 17:54:22.684 DEBUG (MainThread) [custom_components.teamtracker] Alcaraz: Getting state for 'ALCARAZ' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=en&limit=25&dates=20230120-20230126 2023-01-21 17:54:22.685 DEBUG (MainThread) [custom_components.teamtracker] Murray2: Getting state for 'MURRAY' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=en&limit=25&dates=20230120-20230126 2023-01-21 17:54:22.688 DEBUG (MainThread) [custom_components.teamtracker] f1_verstappen: Getting state for 'VER' from http://site.api.espn.com/apis/site/v2/sports/racing/f1/scoreboard?lang=en&limit=25&dates=20230120-20230126 2023-01-21 17:54:22.689 DEBUG (MainThread) [custom_components.teamtracker] team_tracker_psg: Getting state for 'PSG' from http://site.api.espn.com/apis/site/v2/sports/soccer/fra.1/scoreboard?lang=en&limit=25&dates=20230120-20230126 2023-01-21 17:54:22.690 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Getting state for 'DJOKOVIC' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=en&limit=25&dates=20230120-20230126 2023-01-21 17:54:22.691 DEBUG (MainThread) [custom_components.teamtracker] Tsitsipas: Getting state for 'TSITSIPAS' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=en&limit=25&dates=20230120-20230126 2023-01-21 17:54:22.691 DEBUG (MainThread) [custom_components.teamtracker] team_tracker_hamilton: Getting state for 'HAMILTON' from http://site.api.espn.com/apis/site/v2/sports/racing/f1/scoreboard?lang=en&limit=25&dates=20230120-20230126 2023-01-21 17:54:22.692 DEBUG (MainThread) [custom_components.teamtracker] Nadel: Getting state for 'NADAL' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=en&limit=25&dates=20230120-20230126 2023-01-21 17:54:22.693 DEBUG (MainThread) [custom_components.teamtracker] team_tracker_leclerc: Getting state for 'LECLERC' from http://site.api.espn.com/apis/site/v2/sports/racing/f1/scoreboard?lang=en&limit=25&dates=20230120-20230126 2023-01-21 17:54:22.695 DEBUG (MainThread) [custom_components.teamtracker] Verstappen: Getting state for 'VERSTAPPEN' from http://site.api.espn.com/apis/site/v2/sports/racing/f1/scoreboard?lang=en&limit=25&dates=20230120-20230126

This is an exemple in french:

Capture d’écran 2023-01-21 à 18 08 00

schumi2309 commented 1 year ago

For Djoko:

2023-01-21 18:12:33.765 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Getting state without date constraint for 'DJOKOVIC' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr

for Nadal:

2023-01-21 18:22:33.549 DEBUG (MainThread) [custom_components.teamtracker] Nadel: Getting state without date constraint for 'NADAL' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr

this ??

vasqued2 commented 1 year ago

Yes, but I was also expecting a third which does not have the lang=fr on it.

For Nadal it would look like this.

2023-01-21 12:21:33.187 DEBUG (MainThread) [custom_components.teamtracker] tt_atp: Getting state for 'NADAL' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr&limit=25&dates=20230120-20230126 2023-01-21 12:21:35.953 DEBUG (MainThread) [custom_components.teamtracker] tt_atp: Getting state without date constraint for 'NADAL' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr 2023-01-21 12:21:38.725 DEBUG (MainThread) [custom_components.teamtracker] tt_atp: Getting state without date constraint for 'NADAL' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard

vasqued2 commented 1 year ago

If you are only seeing two, I think the first thing we should check is to make sure you are really on v0.6.4-beta1.

There are two things to check.

First, go into HACS and confirm it shows v0.6.4-beta1 in the upper left corner.

If not, then redownload the beta1 version.

If HACS is already showing v0.6.4-beta1 then we want to confirm that in the logs too. If you already have a sensor set up using YAML, search for that sensor in the logs like you did the other ones. If not, set up a brand new sensor with a new name using YAML and restart. It can be tennis or any other sport. It doesn't matter.

This will force the version number to be displayed in the log when you search for that new sensor name. If you see something other than v0.6.4 then you still have the wrong version running.

You should see 2023-01-21 12:21:31.067 INFO (MainThread) [custom_components.teamtracker] TeamTracker version v0.6.4 is starting, if you have any issues please report them here: https://github.com/vasqued2/ha-teamtracker

If both of those steps show you are running v0.6.4beta1, then I will have to put more debug logging into v0.6.4-beta2 to debug further.

Let me know if you once you confirmed you are running v0.6.4-beta1 and then I will know I have to release a beta2 w/ more logging.

schumi2309 commented 1 year ago

this:

2023-01-21 18:02:26.913 INFO (MainThread) [custom_components.teamtracker] TeamTracker version v0.6.4 is starting, if you have any issues please report them here: https://github.com/vasqued2/ha-teamtracker 2023-01-21 18:02:26.913 DEBUG (MainThread) [custom_components.teamtracker] Alcaraz: Data will be updated every 0:10:00 minutes 2023-01-21 18:02:26.924 INFO (MainThread) [homeassistant.setup] Setting up hardkernel 2023-01-21 18:02:26.924 INFO (MainThread) [homeassistant.setup] Setup of domain hardkernel took 0.0 seconds 2023-01-21 18:02:26.925 DEBUG (MainThread) [custom_components.teamtracker] Anderlecht: Getting state for 'AND' from http://site.api.espn.com/apis/site/v2/sports/soccer/bel.1/scoreboard?lang=fr&limit=25&dates=20230120-20230126

schumi2309 commented 1 year ago

But I notice that for these two, they put in yaml and not in UI, and when I'm in french language, they still work.

Capture d’écran 2023-01-22 à 11 36 19

2023-01-21 17:54:11.133 DEBUG (MainThread) [custom_components.teamtracker] Anderlecht: Getting state for 'AND' from http://site.api.espn.com/apis/site/v2/sports/soccer/bel.1/scoreboard?lang=en&limit=25&dates=20230120-20230126

2023-01-21 17:54:22.190 DEBUG (MainThread) [custom_components.teamtracker] Standard: Getting state for 'STL' from http://site.api.espn.com/apis/site/v2/sports/soccer/bel.1/scoreboard?lang=en&limit=25&dates=20230120-20230126

2023-01-21 17:54:24.199 DEBUG (MainThread) [custom_components.teamtracker] f1_verstappen: Getting state without date constraint for 'VER' from http://site.api.espn.com/apis/site/v2/sports/racing/f1/scoreboard?lang=en 2023-01-21 17:54:24.200 DEBUG (MainThread) [custom_components.teamtracker] Alcaraz: Getting state without date constraint for 'ALCARAZ' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=en 2023-01-21 17:54:24.201 DEBUG (MainThread) [custom_components.teamtracker] Tsitsipas: Getting state without date constraint for 'TSITSIPAS' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=en 2023-01-21 17:54:24.201 DEBUG (MainThread) [custom_components.teamtracker] Murray2: Getting state without date constraint for 'MURRAY' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=en 2023-01-21 17:54:24.202 DEBUG (MainThread) [custom_components.teamtracker] team_tracker_hamilton: Getting state without date constraint for 'HAMILTON' from http://site.api.espn.com/apis/site/v2/sports/racing/f1/scoreboard?lang=en 2023-01-21 17:54:24.203 DEBUG (MainThread) [custom_components.teamtracker] team_tracker_leclerc: Getting state without date constraint for 'LECLERC' from http://site.api.espn.com/apis/site/v2/sports/racing/f1/scoreboard?lang=en 2023-01-21 17:54:24.204 DEBUG (MainThread) [custom_components.teamtracker] Verstappen: Getting state without date constraint for 'VERSTAPPEN' from http://site.api.espn.com/apis/site/v2/sports/racing/f1/scoreboard?lang=en

Capture d’écran 2023-01-22 à 11 39 23

and there, my HA is in French. For the football, it's ok in french. i have exemple: Anderlecht or standard or barca or PSG but in tennis, nothing. and for the F1, i don't know now because the season is not started...

vasqued2 commented 1 year ago

You are definitely on the correct version. You are correct, only Tennis has a problem w/ French. The API for all of the other sports work just fine w/ it. It has nothing to do with whether or not you use the GUI or YAML to set up the sensor.

I just uploaded v0.6.4-beta2. It will print out more info in the debug logs. Go ahead and install it and paste the logs back in here. Definitely do a search for just one of your tennis sensors because it will be printing out more info for each sensor and I only need one. And only for the French which does not work.

schumi2309 commented 1 year ago

I'll install it and copy the info to you.

Once again, sorry to make you work just because of me!

vasqued2 commented 1 year ago

No worries. If you are having the problem, others will run into it somewhere too. I appreciate you doing all this work to help me track down the problem.

schumi2309 commented 1 year ago

that's all I have about Djokovic. FYI, in the details of the version in the log, it shows me 0.6.3 and not 0.6.4 beta 2 while in hacs, I'm fine in 0.6.4 beta 2

2023-01-22 14:27:33.427 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Data will be updated every 0:10:00 minutes 2023-01-22 14:27:45.850 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Getting state for 'DJOKOVIC' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr&limit=25&dates=20230121-20230127 2023-01-22 14:27:48.751 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Getting state without date constraint for 'DJOKOVIC' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr 2023-01-22 14:27:48.904 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: Rolex Shanghai Masters 2023-01-22 14:27:48.904 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: Rolex Shanghai Masters (TBD) 2023-01-22 14:27:48.905 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: China Open 2023-01-22 14:27:48.906 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: No competitor information 'DJOKOVIC' returned by API 2023-01-22 14:27:48.907 DEBUG (MainThread) [custom_components.teamtracker] Finished fetching Djokovic data in 15.481 seconds (success: True) 2023-01-22 14:27:49.816 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: Rolex Shanghai Masters 2023-01-22 14:27:49.816 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: Rolex Shanghai Masters (TBD) 2023-01-22 14:27:49.817 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: China Open 2023-01-22 14:27:49.818 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: No competitor information 'DJOKOVIC' returned by API 2023-01-22 14:27:49.818 DEBUG (MainThread) [custom_components.teamtracker] Finished fetching Djokovic data in 0.003 seconds (success: True)

vasqued2 commented 1 year ago

You are definitely running version v0.6.3. The logs don't have the additional debug info that would be here if you were running v0.6.4-beta2.

Did you restart after downloading the latest beta2 version?

If so, we will have to try to figure out why you aren't picking up the latest version.

vasqued2 commented 1 year ago

I think I made a mistake and uploaded the wrong version. Let me re-upload it and you can try again. Glad you caught it

vasqued2 commented 1 year ago

OK. I have the right version uploaded now. You will have to download v0.6.4-beta3. But it will show up in the logs as v0.6.4-beta2.

Sorry for causing the extra work. Definitely validate that you are now seeing the beta2 version in the logs and then post them like you did for the last one.

schumi2309 commented 1 year ago

it's good for the 0.6.4-beta2 (3)

2023-01-22 15:03:23.438 INFO (MainThread) [custom_components.teamtracker] TeamTracker version v0.6.4-beta2 is starting, if you have any issues please report them here: https://github.com/vasqued2/ha-teamtracker

2023-01-22 15:03:23.437 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Data will be updated every 0:10:00 minutes 2023-01-22 15:03:27.808 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Getting state for 'DJOKOVIC' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr&limit=25&dates=20230121-20230127 2023-01-22 15:03:27.990 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Data returned for 'DJOKOVIC' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr&limit=25&dates=20230121-20230127 2023-01-22 15:03:27.990 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Num_events '0' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr&limit=25&dates=20230121-20230127 2023-01-22 15:03:27.990 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: new url_parms '?lang=fr' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr&limit=25&dates=20230121-20230127 2023-01-22 15:03:29.762 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Getting state without date constraint for 'DJOKOVIC' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr 2023-01-22 15:03:29.865 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Data returned for 'DJOKOVIC' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr 2023-01-22 15:03:29.865 DEBUG (MainThread) [custom_components.teamtracker] Djokovic: Num_events '8' from http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr 2023-01-22 15:03:29.866 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: Rolex Shanghai Masters 2023-01-22 15:03:29.866 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: Rolex Shanghai Masters (TBD) 2023-01-22 15:03:29.867 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: China Open 2023-01-22 15:03:29.868 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: No competitor information 'DJOKOVIC' returned by API 2023-01-22 15:03:29.869 DEBUG (MainThread) [custom_components.teamtracker] Finished fetching Djokovic data in 6.432 seconds (success: True) 2023-01-22 15:03:30.334 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: Rolex Shanghai Masters 2023-01-22 15:03:30.334 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: Rolex Shanghai Masters (TBD) 2023-01-22 15:03:30.335 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: async_process_event() No competitions for this event: China Open 2023-01-22 15:03:30.336 DEBUG (MainThread) [custom_components.teamtracker.event] Djokovic: No competitor information 'DJOKOVIC' returned by API 2023-01-22 15:03:30.336 DEBUG (MainThread) [custom_components.teamtracker] Finished fetching Djokovic data in 0.002 seconds (success: True)

vasqued2 commented 1 year ago

It looks like the API is returning different information for you and me with the second call. If so, this is very strange. Enter the second API url http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard?lang=fr into a browser (or just click on it).

When I do, I get an error message.

{"code":2500,"detail":"http error: internal server error"}

When you do, it looks like you are getting a lot of information back about 8 different upcoming events, but not the current one.

First, I just want to validate that you get a lot more info back when you click on the second URL (the one w/o the dates) instead of the error message I get.

Then I would like you to try it one more time where you also drop the ?lang-fr so you would use just http://site.api.espn.com/apis/site/v2/sports/tennis/atp/scoreboard. In this one, it should return the current events and you should be able to search and find Nadal, Djokovic, etc. I just want to confirm it is pulling in the correct info.

If so, the problem is that the second URL is actually returning data for future events - wrong data - but data instead of an error message. The sensor assumes it's correct and doesn't even try the third URL.

schumi2309 commented 1 year ago

I may not understand everything. What exactly do you want me to test?

if it's just to click on the 2 links, neither works for me. it goes around in circles then page not found

vasqued2 commented 1 year ago

That's all I wanted you to do. What browser are you using?

schumi2309 commented 1 year ago

firefox same with chrome

vasqued2 commented 1 year ago

OK, I have made a beta4 version that should work when your language is set the French and the sport is tennis.

It's a hack that will override the language to 'en' when the language is 'fr' and the sport is 'tennis'. It won't override for any other sport or language, but since it seems like everything else is working, it will be good enough for now. I have no idea why the tennis API is behaving differently for you vs. me and no idea how to troubleshoot that further. But this version should work for you since we already know it works when your language is set to English.

Let me know if it does. If it doesn't, post the log info just like last time. If it works, we should see a line in the logs like the following: 2023-01-22 10:50:47.722 DEBUG (MainThread) [custom_components.teamtracker] tt_atp: Overriding language 'fr' to 'en' for 'tennis'

If you confirm it works, I'll post a link to two files you can translate if you would like me to include the translations in a future release.

Hope this works for you.

schumi2309 commented 1 year ago

Very Good. all my tennis sensors work after installing beta 4. Everything seems to be working fine to me. This is very good work my friend. Congratulations to you for your support and your patience with my big problem.

And that's when you want for the French translation. no worries for me.

schumi2309 commented 1 year ago

for more ease concerning all the work or others, I can provide you by email another means of communication (private). see what you prefer.

vasqued2 commented 1 year ago

Glad to hear it worked. I'll include it in the official v0.6.4 release. Thanks for your patience!

Here are the two files that you can translate. Just email the French translation of them to me at the yahoo.com email address in my profile and I will include them in the v0.6.4 release too. It should automatically pick them up for you in the next release.

Just translate the English phrase that comes after each ":" in the files.

File 1: https://github.com/vasqued2/ha-teamtracker/blob/master/custom_components/teamtracker/translations/en.json

File 2: https://github.com/vasqued2/ha-teamtracker-card/blob/main/dist/localize/languages/en.js

schumi2309 commented 1 year ago

I'll take care of it as soon as possible

vasqued2 commented 1 year ago

Thanks.  No rush

schumi2309 commented 1 year ago

the api would still not have a small problem? the djokovic match started at 9 am and I still have no results on HA.

image

image

See the clock on my phone !!!

image

schumi2309 commented 1 year ago

The match is over since 11:30 a.m. and it's 12:40 p.m. and the card is not yet closed.

Capture d’écran 2023-01-23 à 12 39 15

vasqued2 commented 1 year ago

I'm going to need to see the data as it comes in live to see if it's an issue with the card, sensor, API, or maybe even timezone mismatches.

schumi2309 commented 1 year ago

yes, no stress. I'll let you know what I see that doesn't work properly (bugs) just to let you know...

vasqued2 commented 1 year ago

The issue is w/ the ESPN API. It is still showing the Khachanov/Korda match as Scheduled instead of Completed. Last year the API was providing real-time updates during the games so not sure if the issues are specific to the Australian Open will impact all of the tournaments going forward. We will have to wait and see.

I will add this as a known defect w/ the ESPN APIs in the Wiki.


        {
          "id": "129736",
          "uid": "s:850~l:851~e:154-2023~c:129736",
          "date": "2023-01-24T03:00Z",
          "type": {
            "id": "1"
          },
          "timeValid": true,
          "neutralSite": false,
          "recent": false,
          "venue": {
            "address": {
              "summary": "Melbourne, Australia"
            },
            "indoor": false
          },
          "competitors": [
            {
              "id": "2367",
              "uid": "s:850~l:851~a:2367",
              "type": "athlete",
              "order": 1,
              "athlete": {
                "fullName": "Karen Khachanov",
                "displayName": "Karen Khachanov",
                "shortName": "K. Khachanov",
                "flag": {
                  "href": "https://a.espncdn.com/i/teamlogos/countries/500/rus.png",
                  "alt": "Russia",
                  "rel": [
                    "country-flag"
                  ]
                }
              },
              "tournamentSeed": 18
            },
            {
              "id": "3368",
              "uid": "s:850~l:851~a:3368",
              "type": "athlete",
              "order": 2,
              "athlete": {
                "fullName": "Sebastian Korda",
                "displayName": "Sebastian Korda",
                "shortName": "S. Korda",
                "flag": {
                  "href": "https://a.espncdn.com/i/teamlogos/countries/500/usa.png",
                  "alt": "USA",
                  "rel": [
                    "country-flag"
                  ]
                }
              },
              "tournamentSeed": 29
            }
          ],
          "status": {
            "period": 1,
            "type": {
              "id": "1",
              "name": "STATUS_SCHEDULED",
              "state": "pre",
              "completed": false,
              "description": "Scheduled",
              "detail": "Mon, January 23rd at 10:00 PM EST",
              "shortDetail": "1/23 - 10:00 PM EST"
            }
          },