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

0.7.3 and clearing frontend cache on the app fixed it. Thanks! I’ll have to double check the companion app for macOS and on google chrome (experienced this issue there as well) but I’m guessing it is fixed as well.

Hi,

I’m trying to set up a custom API config for NRL (rugby league). I found this link below.

https://www.espn.com.au/rugby-league/fixtures/_/league/3

When I plug in the information, it returns NOT_FOUND.

  - platform: teamtracker
    league_id: 3
    team_id: BRO
    sport_path: rugby-league
    league_path:  nrl
    name: nrl_bro

Any tips to get this working?

Thank you!

league_id should be XXX
league_path should be 3

Ugh simple fix. Thank you!!

I just released v0.8.0 of both the sensor and the card.

v0.8.0 of the card is a major refactor. I tested a lot of different configurations and believe I have resolved all of the issues but please let me know if you notice any.

I also made several changes to make the card more compatible with card-mod. Details and examples on on this Wiki page.

v0.8.0 of the sensor requires valid league_id values in YAML to pass the Configuration Test prior to rebooting. Prior to v0.8.0, this was not enforced.

4 Likes

Hey folks. I’d like to take a moment to thank everyone who has contributed to this. Thanks to this integration / card, some additional contributions in this thread, and ballpark images here, I’ve been able to create light and dark versions the MLB dashboard I’ve been working toward since I started with Home Assistant.

I only really track two different teams, but here are a few screenshots, for anyone who is interested:

1 Like

Very nice! Would you be willing to share your code for your Lovelace? Thx!

With the Women’s World Cup approaching, I thought I would post instructions for adding teams to Team Tracker.
The ESPN API url is https://site.api.espn.com/apis/site/v2/sports/soccer/FIFA.WWC/scoreboard.
From the interface, Settings > Integrations. Click Add Integration and choose Team Tracker. For League, choose Custom. For Team, choose the correct abbreviation from ESPN’s Women’s World Cup Scores page. Give your tracker a meaningful Friendly Name and click Submit.
A second screen is displayed, enter soccer for Sport Path and FIFA.WWC for League Path.

Note, only the first day’s games are currently in the API feed but they should appear as we get closer to the tournament.

3 Likes

Sure. It’s a lot, and it depends on some template sensors and input booleans, but here it is:

https://hastebin.com/share/utafiyuyop.yaml

1 Like

I’m in love with this all-in-one solution! I’m trying to set up an input_select for the teams i follow because it changes depending on the game im watching. i have it control a siren light when the team scores. Here’s where im stuck. and i think its a template error on my part but could be wrong.

sensor:
  - platform: teamtracker
      league_id: "NFL"
      team_id: "{{ states.input_select.nfl_teams1.state }}"
      name: "NFL1"

say team_id is CHI or any team. the sensor.nfl1 shows an attribute of “team_abbr: {{ STATES.INPUT_SELECT.NBA_TEAMS2.STATE }}” instead of that input_select results of CHI or any team.

can this sensor do templates like that?

The sensors are created when Home Assistant starts, so I’m thinking that probably won’t work.

What you easily could do, though, is to create sensors for all the teams you care about, then switch between them with the input select for whatever you are doing.

Or, depending on how many teams you are following, you could do what I do. I have something similar set up, but only for two teams. I have static sensors and automations for each, but they only trigger the lights and sirens if the associated input boolean is turned on. This works, even if my two teams are playing each other.

How can I follow EuroLeague?

How do you find the right team id? This is my sensor

  - platform: teamtracker
    league_id: "XXX"
    team_id: "148"
    sport_path: "soccer"
    league_path: "ned.1"
    name: "PSV"

Use PSV as the team_id. Looks like that got lost in the README in an update. I will add back in. Thanks

I am not aware of any API for EuroLeague

I am not sure if something like this has been posted or not.

I want to share our situation and what I have coded for it.

We do not track all MLB teams. Just some of them. I use auto-entities to build the card. Of course, if two teams we are tracking play each other, we get two teamtracker-cards.

Thanks to @kbrown01 for the original auto-entities template I started with. I have built upon that to build a namespace with team_sensor from the teamtracker integration and the event_name from the sensor.

I feed that through unique on the event_name which removes the duplicates. Then build the teamtracker-card from that.

I hope someone finds this useful.

          - type: custom:auto-entities
            card:
              type: entities
            show_empty: false
            filter:
              template: |
                {%- set ns = namespace(items=[]) -%}
                {%- for team in integration_entities("teamtracker") -%}
                  {%- if state_attr(team, "league") == "MLB" -%}
                    {%- set ns.items = ns.items + [{"team_sensor": team, "event_name": state_attr(team, "event_name")}] -%}
                  {%- endif -%}
                {%- endfor -%}
                {%- for team in ns.items|unique(attribute="event_name") -%}
                  {{{"type": "custom:teamtracker-card","entity": team.team_sensor, "home_side": "right" }}},
                {%- endfor -%}
              exclude:
                - entity_id: '*team_tracker*'
            options: null
            sort:
              method: attribute
              attribute: team_id
3 Likes

Nice addition if you only have certain teams you follow!!!

This is really useful thank you! Cards look fantastic

I was wondering if anyone had any advice on
automations with the sensor. I have a WLED light strip and would like to use the “team colors” attribute (hex codes) when a game starts. Any ideas on how to do this?
Would it be easier to create a preset manually for the team colours then turn this on when a game starts? Thanks inadvance

1 Like

Can anyone help with why my tennis tracker doesn’t work?

  - platform: teamtracker
    league_id: "XXX"
    team_id: "3782"
    sport_path: "tennis"
    league_path: "all"
    name: "teamCarlosNew"

API call does work
http://sports.core.api.espn.com/v2/sports/tennis/leagues/all/seasons/2023/athletes/3782

Thanks in advance

For sports involving individual athletes, you should use the athlete’s name as the Team ID. You should use as much as is needed to uniquely identify the desired athlete.