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

has anyone of you also integrated the tables in the dashboard? or just the individual schedules

Support for preseason games depends entirely on what ESPN supports.

As a general rule of thumb, if ESPN displays info/updates for preseason games on its website, then the info will likely also be available through the API for the sensor.

I know the NFL, NHL, and NBA preseason games showed up. Not sure about any others. Since support for most sports was added in the middle of their seasons, we will all find out together.

Teamtracker v0.6.x and earlier will stop working starting with HA 2023.03. You must upgrade to v0.7.x before taking the HA upgrade to ensure continued operation.

v0.6.x and prior relied on async_setup_platforms(), which is being deprecated in HA 2023.03. Thanks to @RobertD502 for bringing this to my attention and submitting the fix.

v0.7.0, which was just released, eliminates this dependency. It will be necessary to upgrade to v0.7.0 or later to ensure continued operation of the sensor in HA 2023.03 and beyond.

If any major defects are found in v0.7.0, I will address them before the HA 2023.03 release. All other changes will be held to ensure a stable v0.7.x baseline, as it will be impossible to revert back to prior versions of the sensor once the upgrade to HA 2023.03 is taken.

I would like to create an automation for the final score (if my team wins) that would play an audio file. I can do it except for the value template I’d need.

The trigger would be the game changing to ‘post’ and then I would want the condition to be if the team score is greater than the opponent score.

I’ve been playing in the template editor trying to figure it out but I’m not too good with coding yet. This is what I have so far:

{{ states.sensor.tracker_lakers.attributes["team_score"]}} - {{states.sensor.tracker_lakers.attributes["opponent_score"]}} 

This will post the scores but I’m pretty sure there needs to be some sort of ‘if statement’ and a greater than sign but I’m not sure how to write it. Could someone help me out?

Try something like the following for the condition

{{ state_attr('sensor.tt_nba', 'team_score') > state_attr('sensor.tt_nba', 'opponent_score') }}

Hoping for some help here. Im trying at add a card for a team in the Scottish league 1 (sco.3 on ESPN). I have the API address for the league and the ID of the team, but whats the API I would use for the sport? I have tried…

https://site.api.espn.com/apis/site/v2/sports/soccer

and it successfully adds the tracker but the API isnt pulling any data. Any ideas? The team ID im using is 265.

try using

- platform: teamtracker
  league_id: "XXX"
  team_id: "DFA"
  sport_path: "soccer"
  league_path: "sco.3"
  name: "dunfermline test tracker yaml"

Screenshot 2023-02-03 122635

obviously you can change the name :wink:

@vasqued2

HA core 2023.2.1 seems to have messed with the card

2023.2.1
Screenshot 2023-02-03 123027

previous version (2023.1.7)
Screenshot 2023-02-03 123044

I’ve rolled my test instance back to 2023.2.0 but its still the same. I don’t remember it being broken before updating last night.

Don’t think it’s a Core issue…I’ve seen that periodically with the card over last while (wasn’t regular enough to report) but haven’t seen it on 2023.2.0 or 2023.2.1 and not there now for matches tomorrow :+1:t2:

The front end has an old version of the language file in cache. For some reason HA doesn’t always refresh the language files when it refreshes the card. I’ve never heard of it going from working to not working before though. Although it is possible for it to work on one front end and but not on another because they have different versions of the language files in cache.

Clear your cache and then restart the app or refresh your browser. That will force it to pull in the new files.

2 Likes

I put teamtracker card and google calendar integration together, is there a way to see the next games if I click on “next game”? and can I change the format of the date?
In addition, is it possible to remove the small space between the two cards?

img

The card shows whatever game the API returns. When the API returns the prior game vs. next upcoming game varies by sport. There is no way to change this.

The date format is based on the locale of the frontend device. Locale is determined by the language selected for your front end profile. There is no place in the front end profile specify a date format independently of the selected language.

Hi,
I am a bit new to HA - where exactly do I post the code?
I have everything setup, but need to hide the away team (duplicates)

I use auto-entities and a template, so the filtering is in the card entities generation itself:

      - type: custom:auto-entities
        unique: true
        show_empty: false
        card:
          type: custom:layout-card
          layout_type: masonry
        card_param: cards
        filter:
          template: |
            {%- for team in integration_entities("teamtracker") -%}
              {%- if state_attr(team, "team_homeaway") == "home" -%}
                {{{"type": "custom:teamtracker-card",
                  "entity": team }}},
              {%- endif -%}
            {%- endfor -%}
          exclude:
            - entity_id: '*team_tracker*'
        sort:
          method: attribute
          attribute: date

Essentially that filters all teamtracker entities and selects only those with “team_homeaway” == “home”. The one exclude above just excludes the original team I created when the entity was created because I have all the NFL teams in YAML.

Now, be careful. I do this for American Football because I want to see every team. But I do not following every hockey team. I would not want to hide my favorite teams just because they are not playing at home. You could add additional tests in that filter and make it for your sports or have additional auto-entities or includes for other teams.

1 Like

Perfect thanks. I was missing the auto-entities.
Working now - from UK EPL (so only a maximum of 10 games)


Looks ok to me

1 Like

Very nice!

I use a one card panel dashboard, I only posted the cards themselves, overall it is this:

  - theme: Backend-selected
    title: Sports
    path: sports
    icon: mdi:football
    layout:
      max-columns: 1
    type: panel
    badges: []
    cards:
      - type: custom:auto-entities
        unique: true
        show_empty: false
        card:
          type: custom:layout-card
          layout_type: masonry
        card_param: cards
        filter:
          template: |
            {%- for team in integration_entities("teamtracker") -%}
              {%- if state_attr(team, "team_homeaway") == "home" -%}
                {{{"type": "custom:teamtracker-card",
                  "entity": team }}},
              {%- endif -%}
            {%- endfor -%}
          exclude:
            - entity_id: '*team_tracker*'
        sort:
          method: attribute
          attribute: date

Thanks for this! I’d never used auto-entities before and it makes everything so much easier.

How can I find the Athlete’s abbreviation for a tennis player like Rafeael Nadal. I used the “inspect method” on the site but things like “261” of “rafael-nadal” of “nad” or “nadr” do not work.

Use his last name or some substring of it. NADAL will work.

However, based on the info that is coming back from the API, he is not playing in any event this week. He is not register as a competitor for the Argentina Open, Delray Beach Open, or the Amro Open.

So you will probably get status of NOT_FOUND. If you input the name of someone competing this week, you should get a hit.

1 Like