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

The API I use for this sensor does not.

There is a another API that provides league standings for at least some leagues. I was just starting to think through what functionality would make sense at a league level and seeing if the other API was robust enough to support it. I would likely create an entirely new sensor and card for league standings instead of making this one too complicated. I think the structure of this sensor has finally stabilized enough that it could be used for a second sensor w/o a ton of rework.

So maybe someday, but nothing imminent.

1 Like

Well, here’s a first vote for that feature request / new sensor request! :smiley:

Can you paste the full YAML for your automation and not just the template?

Mine always has. This is tonights view:

I got it going. Thank you for the great integration

How do you do this please?

OK, to start of course I have one sensor for every team in the NFL. Not all listed here but you get it:

- platform: teamtracker
  league_id: NFL
  team_id: DET
  name: Detroit Lions
- platform: teamtracker
  league_id: NFL
  team_id: GB
  name: Green Bay
- platform: teamtracker
  league_id: NFL
  team_id: CHI
  name: Chicago Bears
- platform: teamtracker
  league_id: NFL
  team_id: MIN
  name: Minnesota Vikings
- platform: teamtracker
  league_id: NFL
  team_id: BUF
  name: Buffalo Bills

Then I use auto-entities with a special trick to display home games. There should always be one home team. In essence, this makes it a “game-tracker” not a “team-tracker”:

type: custom:auto-entities
unique: true
show_empty: false
card:
  type: grid
  square: false
  columns: 4
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 the key here is the template filter for custom:auto-entities. It is filtering out only teams that are listed as playing at home. So right now you will only get the playoff games. Note that at the end I exclude the original team setup via the interface so I can track them all more easily by getting just the team names.

I was going to change this to use custom:layout-card so that it auto scales for the phone, pad and computer but this is normally only displayed on PADs at the house so a grid of 4 was fine.

1 Like

fantastic. Thank you!!!

Here’s a version that uses custom:layout-card if you have it installed. It better stacks the cards for view on all devices:

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

Phone:

Computer:

1 Like

Thank you so much for for this!!!

No problem. Not sure what might happen in superbowl but I assume one team is listed as home team

Is there a repository of examples for each attribute for certain leagues so I could plan my automations with correct information?

Anyone know if it possible to track more than one game ahead ? Like if you want the next 2 or 3 games?

The sensor can only return one game at a time.

This article explains how you can use google calendar to display additional future games if desired.

1 Like

Thank you for the clarification :slight_smile:

Hi @vasqued2
I haven’t been here on the forum for a while, but stumbled on your *-functionality when updating today.

I think it works great. Pretty much exactly what I was looking for. :+1:
I running it now. Will let you know if there are any issues.

Thanks for your great work.

1 Like

Hi,
I trying to add F1 team tracker for Ferrari and its drivers Charles Leclerc och Carlos Sainz but get NOT_FOUND.

I use

League: F1
Team: Ferrari

Can somebody please help me?

You’ve probably everything setup fine…the NOT_FOUND will stay like that in the ESPN API until shortly before the next race (or next match/game if another sport) so that’s all you’ll see in Home Assistant until near the first race.

(PS - hope alright to mention…this integration is fantastic for most sports but maybe not great for F1…API issue rather than the integration itself…search formula one card in the forum and there’s some very good options out there)

1 Like

Thank you.

Does this integration return preseason games or only regular season and postseason?