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

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.

Hello,

I am trying to add the UFC to the home assistant. The standard integration is quite easy. It only shows the next card of the next event. I would like to see all the items on the next card.

I have however searched through a lot of topics. I haven’t found the solution yet. I don’t believe i am the only one that would like to see the complete CARD of the Upcoming event. I don’t have an athlete i wish to follow.

Does anyone have a proper solution for this.

Thank you so much for helping.

Kind regards

Trying to add Turkish Football League for standing etc. and Galatasaray as team.

Trying to find Sport path and league path.

For Custom League:

is this the league path:

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

Can you guys help me me sort this.

thank you

league path is just tur.1

so sport path is soccer

So, if multiple teams do not have an upcoming game, you only get one of them since there is no event name for any of them and this removes dupes on ‘None’.

So, I made a change. If event name does not exist, I use team_abbr. That gives all teams that we track whether they are playing or not.

- 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 event_name = state_attr(team, "event_name") if state_attr(team, "event_name") else state_attr(team, "team_abbr") -%}
              {%- set ns.items = ns.items + [{"team_sensor": team, "event_name": 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

yml örneğini paylaşıyorum

teamtracker:

  • platform: teamtracker
    league_id: “tur.1”
    team_id: “432”
    sport_path: “soccer”
    league_path: “superlig”
    name: “galatasaray”
    ac_mode: false

Thanks for this guide, Had to do this now that leeds have been relegated…pfft.

I guess its easier now for Sheff U

1 Like

Did you manage to get this working ? I want to get Middlesbrough scores in hassio, can you help ?

Yes it works and tried it with Middlesbrough - no issues either.

Try this.

Click on the ESPN integration within Device and services.

click add and enter the following entries case sensitive.
Legaue : XXX
Team: MID
friendly name: team_mfc
press submit to enter the next page
sportspath: soccer
Leaguepath: eng.2

click submit and your all good.

Works amazing !!! Cheers matey. Also added the team tracker card. Any tips on getting notifications on goals ?