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.
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.
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)