Sports Standings and Scores

I have again a problem with the output in the table.

This time theres a problem with the west central.

If I check with this:

{%- for state in states -%}
{%- if "sensor.nhl" in state.entity_id -%}
- {{state.entity_id + "\n"}}
{%- endif -%}
{%- endfor -%}

This the result:

- sensor.nhl_starting_goalies
- sensor.nhl_standings
- sensor.nhl_wildcard
- sensor.nhl_east_atlantic
- sensor.nhl_east_metropolitan
- sensor.nhl_west_central
- sensor.nhl_west_pacific
- sensor.nhl_wildcard_standings
- binary_sensor.nhl_east_atlantic
- binary_sensor.nhl_east_metropolitan
- binary_sensor.nhl_west_central
- binary_sensor.nhl_west_pacific
- sensor.nhl_po_games
- sensor.nhl_po_amer_games
- sensor.nhl_po_natl_games
- sensor.nhl_po_amer_wc_games
- sensor.nhl_po_natl_wc_games
- sensor.nhl_po_amer_div_games
- sensor.nhl_po_natl_div_games
- sensor.nhl_po_amer_leag_games
- sensor.nhl_po_natl_leag_games
- sensor.nhl_po_world_game
- sensor.nhl_po_tv_coverage
- sensor.nhl_playoff_seeds
- sensor.nhl_po_team_games

If I trey this code for the overall:

square: false
columns: 1
type: grid
cards:
  - type: custom:mushroom-title-card
    title: Overall
    alignment: center
  - type: custom:decluttering-card
    template: nhl_settings
    variables:
      - title: Overall
      - entity: sensor.nhl_*_*
      - attribute: entries
      - excluded_entities:
          - sensor.nhl_starting_goalies
          - sensor.nhl_wildcard_standings
          - binary_sensor.nhl_east_atlantic
          - binary_sensor.nhl_east_metropolitan
          - binary_sensor.nhl_west_central
          - binary_sensor.nhl_west_pacific
          - sensor.nhl_po_games
          - sensor.nhl_po_amer_games
          - sensor.nhl_po_natl_games
          - sensor.nhl_po_amer_wc_games
          - sensor.nhl_po_natl_wc_games
          - sensor.nhl_po_amer_div_games
          - sensor.nhl_po_natl_div_games
          - sensor.nhl_po_amer_leag_games
          - sensor.nhl_po_natl_leag_games
          - sensor.nhl_po_world_game
          - sensor.nhl_po_tv_coverage
          - sensor.nhl_playoff_seeds
          - sensor.nhl_po_team_games
      - sort: x.stats.find(y=>y.shortDisplayName == 'PTS').value

I got no output.

If I also add by excluded:

          - sensor.nhl_west_central

I got Output, but without the teams from the west_central

where is my error?

Havenā€™t seen the code posted yet, but I have been playing with WNBA numbers for fun. Data is a little different in WNBA and I am by no means an expert. Just figured that with the great work that @kbrown01 has done, I would add this piece.


Sensors.yaml code

###
## WNBA Standings
##
- platform: rest
  scan_interval: 36000
  name: WNBA Standings
  unique_id: sensor_wnba_standings
  resource: https://site.web.api.espn.com/apis/v2/sports/basketball/wnba/standings?seasontype=2&type=0&level=3
  value_template: "{{ now() }}"
  json_attributes:
      - children

## 
## WNBA Teams
##
- platform: teamtracker
  league_id: WNBA
  team_id: NY
  name: New York Liberty
- platform: teamtracker
  league_id: WNBA
  team_id: IND
  name: Indiana Fever
- platform: teamtracker
  league_id: WNBA
  team_id: SUN
  name: Connecticut Sun
- platform: teamtracker
  league_id: WNBA
  team_id: CHI
  name: Chicago Sky
- platform: teamtracker
  league_id: WNBA
  team_id: ATL
  name: Atlanta Dream
- platform: teamtracker
  league_id: WNBA
  team_id: WSH
  name: Washington Mystics
- platform: teamtracker
  league_id: WNBA
  team_id: MIN
  name: Minnesota Lynx
- platform: teamtracker
  league_id: WNBA
  team_id: SEA
  name: Seattle Storm
- platform: teamtracker
  league_id: WNBA
  team_id: LV
  name: Las Vegas Aces
- platform: teamtracker
  league_id: WNBA
  team_id: PHX
  name: Phoenix Mercury
- platform: teamtracker
  league_id: WNBA
  team_id: LA
  name: Los Angelese Sparks
- platform: teamtracker
  league_id: WNBA
  team_id: DAL
  name: Dallas Wings

template.yaml

   - name: WNBA Eastern 
      unique_id: sensor.wnba_eastern_conference
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.wnba_standings','children')[0]['standings']['entries'] }}"
              
    - name: WNBA Western 
      unique_id: sensor.wnba_western_conference
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.wnba_standings','children')[1]['standings']['entries'] }}"

decluttering_templates add:

  wnba_settings:
    card:
      type: custom:flex-table-card
      title: '[[title]]'
      css:
        table+: 'padding: 0px; width: 1600px;'
        tbody tr td:first-child: 'width: 1%;'
        tbody tr td:nth-child(2): 'width: 1%;'
        tbody tr td:nth-child(3): 'width: 8%;'
        tbody tr td:nth-child(n+4): 'width: 2%;'
        tbody tr:hover: 'background-color: green!important; color:white!important;'
        tbody tr td:nth-child(4): 'background-color: green; color: white;'
      card_mod:
        style:
          .: |
            ha-card {
              overflow: auto;
              }
          $: |
            .card-header {
               padding-top: 6px!important;
               padding-bottom: 4px!important;
               font-size: 14px!important;
               line-height: 14px!important;
               font-weight: bold!important;
             }
      sort_by: entries+
      entities:
        include: '[[entity]]'
      columns:
        - hidden: true
          data: entries
          modify: '[[sort]]'
        - name: C
          data: entries
          modify: >-
            if(typeof x.stats.find(y=>y.abbreviation == 'CLINCH') !==
            'undefined' ){x.stats.find(y=>y.abbreviation ==
            'SEED').displayValue}else{'-'}
        - name: Seed
          data: entries
          modify: >-
            if(typeof x.stats.find(y=>y.abbreviation == 'SEED') !== 'undefined'
            ){x.stats.find(y=>y.abbreviation == 'SEED').displayValue}else{'-'}
        - name: Team
          data: entries
          modify: >-
            '<div><img src="' + x.team.logos[0].href + '" style="height:
            20px;vertical-align:middle;">&nbsp;' + x.team.displayName + '</div>'
        - name: Overall
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'Total').displayValue
        - name: W
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'W').displayValue
        - name: L
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'L').displayValue
        - name: GB
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'GB').displayValue
        - name: HOME
          data: entries
          modify: x.stats.find(y=>y.shortDisplayName == 'HOME').displayValue
        - name: AWAY
          data: entries
          modify: x.stats.find(y=>y.shortDisplayName == 'AWAY').displayValue
        - name: DIV
          data: entries
          modify: x.stats.find(y=>y.shortDisplayName == 'DIV').displayValue
        - name: CONF
          data: entries
          modify: x.stats.find(y=>y.shortDisplayName == 'CONF').displayValue
        - name: PPG
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'PPG').displayValue
        - name: OPP PPG
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'OPP PPG').displayValue
        - name: DIFF
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'DIFF').displayValue
        - name: STRK
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'STRK').displayValue
        - name: L10
          data: entries
          modify: x.stats.find(y=>y.shortDisplayName == 'L10').displayValue

card/tab code:

            - attributes:
                label: WNBA
                icon: mdi:basketball
              card:
                type: custom:mod-card
                card_mod:
                  style:
                    tabbed-card $: |
                      mwc-tab {
                        background: var(--ha-card-background, var(--card-background-color, white) );
                        border-color: var(--ha-card-border-color, var(--divider-color, #e0e0e0) );
                        border-width: 2px;
                        border-top-left-radius: 20px;
                        border-top-right-radius: 20px;
                        border-style: solid;
                        overflow: hidden;
                        width: 25%;
                      }
                      mwc-tab[active] {
                        background: #EBFFD8 !important;
                      }
                card:
                  type: custom:tabbed-card
                  styles:
                    '--mdc-theme-primary': green
                    '--mdc-tab-text-label-color-default': silver
                    '--mdc-typography-button-font-size': 12px
                  tabs:
                    - attributes:
                        label: Standings
                        icon: mdi:ballot
                      card:
                        type: custom:mod-card
                        card_mod:
                          style:
                            tabbed-card $: |
                              mwc-tab {
                                background: var(--ha-card-background, var(--card-background-color, white) );
                                border-color: var(--ha-card-border-color, var(--divider-color, #e0e0e0) );
                                border-width: 2px;
                                border-top-left-radius: 20px;
                                border-top-right-radius: 20px;
                                border-style: solid;
                                overflow: hidden;
                                width: 25%;
                              }
                              mwc-tab[active] {
                                background: #EBFFD8 !important;
                              }
                        card:
                          type: custom:tabbed-card
                          styles:
                            '--mdc-theme-primary': green
                            '--mdc-tab-text-label-color-default': silver
                            '--mdc-typography-button-font-size': 12px
                          tabs:
                            - attributes:
                                label: Divisional
                              card:
                                type: custom:stack-in-card
                                mode: vertical
                                cards:
                                  - type: custom:decluttering-card
                                    template: wnba_settings
                                    variables:
                                      - title: Eastern Conference
                                      - entity: sensor.wnba_eastern*
                                      - sort: >-
                                          x.stats.find(y=>y.abbreviation ==
                                          'GB').value
                                  - type: custom:decluttering-card
                                    template: wnba_settings
                                    variables:
                                      - title: Western Conference
                                      - entity: sensor.wnba_western*
                                      - sort: >-
                                          x.stats.find(y=>y.abbreviation ==
                                          'GB').value
                            - attributes:
                                label: Overall
                              card:
                                type: custom:decluttering-card
                                template: wnba_settings
                                variables:
                                  - title: Overall
                                  - entity: sensor.wnba_*_*
                                  - sort: >-
                                      x.stats.find(y=>y.abbreviation ==
                                      'SEED').value
                            - attributes:
                                label: Playoffs
                              card:
                                type: markdown
                                content: coming soon!
                    - attributes:
                        label: Postgame
                        icon: mdi:basketball
                      card:
                        type: custom:decluttering-card
                        template: game_stats
                        variables:
                          - sport: WNBA
                          - status: POST
                    - attributes:
                        label: Live
                        icon: mdi:basketball-hoop
                      card:
                        type: custom:decluttering-card
                        template: game_stats
                        variables:
                          - sport: WNBA
                          - status: IN
                    - attributes:
                        label: Pregame
                        icon: mdi:account-details
                      card:
                        type: custom:decluttering-card
                        template: game_stats
                        variables:
                          - sport: WNBA
                          - status: PRE

Hope this helps and would love to see improvements Iā€™m sure someone will add.

1 Like

What is your width set to in views? I think kbrown01ā€™s default it 25%. Try 20% that what the bottom jpg is set on my pc.


no none an idea where my mistake are?

Dude hell of an advice!! Never thought that this could be the mistake in my configuation.
Thanks a lot!

I do not think you have a mistake. I have no time to analyze at the moment but the data for west central look wrong coming from ESPN. I change my URL to get the data to

https://site.web.api.espn.com/apis/v2/sports/hockey/nhl/standings?seasontype=1&type=0&level=3

With seasontype = 1 then you get preseason stats. You have to remember that NHL isn;t playing yet and so ESPN can give erroneous data. Even with preseaon stats I get no west central but not blank page when going to preseason.

I can see likely something wrong in the stats, look at this image of the raw JSON from ESPN:

You can see that the West Central is missing something that the others are not.

Thank you for you answer.

Then Iā€™ll just wait until the season starts again.

@kbrown01 - what app are you using on that screen shot?

That is oXygen Editor.

1 Like

Asking for guidance - I donā€™t know how to put the NCAAF Top 25 into separate sensors.

NCAAF Top 25 is updated weekly and this is the link I am using: https://site.api.espn.com/apis/site/v2/sports/football/college-football/rankings?seasontype=2&type=0&level=3

It is broken down into 3 categories(rankings):

  • AP Poll (rankings[0])
  • AFCA Coaches Poll (rankings[1])
  • FCS Coaches Poll (rankings[2])

In each of the rankings there are 25 ā€œranksā€. How do I group all of the ranks[0-24] into 3 individual sensors?

Here are some screen shots and code I have been trying - thanks for helping:

## NCAA Football Rankings
###
- platform: rest
  scan_interval: 36000
  name: NCAAf rank 
  unique_id: sensor.ncaaf_rank
  #resource: https://site.api.espn.com/apis/site/v2/sports/football/college-football/rankings
  resource: https://site.api.espn.com/apis/site/v2/sports/football/college-football/rankings?seasontype=2&type=0&level=3
  value_template: "{{ now() }}"
  json_attributes:
      - rankings
    - name: NCAA Football Top 25
      unique_id: sensor.ncaa_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[0]['ranks']}}"

I end up getting everything in the api put into that sensor

Funny, working on a similar project right now :slight_smile:
Iā€™m still stuck in correctly showing the conference standings but the rankings are definitely next.

Maybe you have to add a filter for each ranking (code: name/shortName):

  • AP Poll
  • AFCA Coaches Poll
  • FCS Coaches Poll

Talking about College Football:

This is my standings code, which is however not showing any team:

            - attributes:
                label: NCAAF
                icon: mdi:football
              card:
                type: custom:mod-card
                card_mod:
                  style:
                    tabbed-card $: |
                      mwc-tab {
                        background: var(--ha-card-background, var(--card-background-color, white) );
                        border-color: var(--ha-card-border-color, var(--divider-color, #e0e0e0) );
                        border-width: 2px;
                        border-top-left-radius: 20px;
                        border-top-right-radius: 20px;
                        border-style: solid;
                        overflow: hidden;
                        width: 20%;
                      }
                      mwc-tab[active] {
                        background: #EBFFD8 !important;
                      }
                card:
                  type: custom:tabbed-card
                  styles:
                    '--mdc-theme-primary': green
                    '--mdc-tab-text-label-color-default': silver
                    '--mdc-typography-button-font-size': 12px
                  tabs:
                    - attributes:
                        label: Standings
                        icon: mdi:ballot
                      card:
                        type: custom:mod-card
                        card_mod:
                          style:
                            tabbed-card $: |
                              mwc-tab {
                                background: var(--ha-card-background, var(--card-background-color, white) );
                                border-color: var(--ha-card-border-color, var(--divider-color, #e0e0e0) );
                                border-width: 2px;
                                border-top-left-radius: 20px;
                                border-top-right-radius: 20px;
                                border-style: solid;
                                overflow: hidden;
                                width: 20%;
                              }
                              mwc-tab[active] {
                                background: #EBFFD8 !important;
                              }
                        card:
                          type: custom:tabbed-card
                          styles:
                            '--mdc-theme-primary': green
                            '--mdc-tab-text-label-color-default': silver
                            '--mdc-typography-button-font-size': 12px
                          tabs:
                            - attributes:
                                label: Conferences
                              card:
                                type: custom:stack-in-card
                                mode: vertical
                                cards:
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: American
                                      - entity: >-
                                          sensor.ncaaf_american_athletic_conference
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: ACC
                                      - entity: sensor.ncaaf_atlantic_coast_conference
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: Big 12
                                      - entity: sensor.ncaaf_big_12_conference
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: Big Ten
                                      - entity: sensor.ncaaf_big_ten_conference
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: C-USA
                                      - entity: sensor.ncaaf_conference_usa
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: FBS Ind.
                                      - entity: sensor.ncaaf_fbs_independents
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: MAC
                                      - entity: sensor.ncaaf_mid_american_conference
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: MWC
                                      - entity: sensor.ncaaf_mountain_west_conference
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: Pac-12
                                      - entity: sensor.ncaaf_pac_12_conference
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: SEC
                                      - entity: sensor.ncaaf_southeastern_conference
                                  - type: custom:decluttering-card
                                    template: ncaaf_settings
                                    variables:
                                      - title: Sun Belt
                                      - entity: sensor.ncaaf_sun_belt_conference
                            - attributes:
                                label: Rankings
                              card:
                                type: custom:stack-in-card
                                mode: vertical
                                cards: null
                    - attributes:
                        label: Pregame
                        icon: mdi:football-helmet
                      card:
                        type: custom:decluttering-card
                        template: game_stats
                        variables:
                          - sport: NCAAF
                          - status: PRE
                    - attributes:
                        label: Live
                        icon: mdi:football
                      card:
                        type: custom:decluttering-card
                        template: game_stats
                        variables:
                          - sport: NCAAF
                          - status: IN
                    - attributes:
                        label: Postgame
                        icon: mdi:strategy
                      card:
                        type: custom:decluttering-card
                        template: game_stats
                        variables:
                          - sport: NCAAF
                          - status: POST
                    - attributes:
                        label: Top 25
                        icon: mdi:strategy
                      card:
                        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, "league") == "NCAAF" -%}
                              {%- if state_attr(team, "team_rank") is not none -%}
                              {{{"type": "custom:teamtracker-card",
                              "entity": team,
                              "home_side": "right"}}},
                              {%- endif -%}
                              {%- endif -%}
                            {%- endfor -%}
                          exclude:
                            - entity_id: '*team_tracker*'
                        sort:
                          attribute: date
                          method: attribute
                        home_side: left

Ok so it was my error or Home Assistant being vindictive :wink: and renaming my sensor. Here is the NCAAf Top 25 Code for anyone who wants it and I will try to pretty it up.

Updated - 9-16-2024: - only changes are to dashboard and new section groups.yaml below - some new glamor pics

Preseason had Div II and Div III but donā€™t see them now.

Here is what is in my sensors.yaml file

##
## NCAA Football Rankings
###
- platform: rest
  scan_interval: 36000
  name: NCAAf rank 
  unique_id: sensor.ncaaf_rank
  #resource: https://site.api.espn.com/apis/site/v2/sports/football/college-football/rankings
  resource: https://site.api.espn.com/apis/site/v2/sports/football/college-football/rankings?seasontype=2&type=0&level=3
  value_template: "{{ now() }}"
  json_attributes:
      - rankings

Here is what is in my template.yaml file:

##NCAA Men's Football AP Poll
    - name: NCAA AP Poll Football Top 25
      unique_id: sensor.ncaa_ap_poll_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[0]['ranks']}}"
 
  ##NCAA Men's Football AFCA Coaches Poll        
    - name: NCAA AFCA Coaches Poll Football Top 25
      unique_id: sensor.ncaa_Coaches_poll_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[1]['ranks']}}"
 
  ##NCAA Men's Football AFCA Coaches Poll        
    - name: NCAA FCS Football Top 25
      unique_id: sensor.ncaa_FCS_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[2]['ranks']}}"
  ##found in pre-season not now        
    - name: NCAA AFCA DIV II Football Top 25
      unique_id: sensor.ncaa_AFCA_DIV_II_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[3]['ranks']}}"
  ##found in pre-season not now
    - name: NCAA AFCA Div III Coaches Poll Football Top 25
      unique_id: sensor.ncaa_AFCA_DIV_III_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[4]['ranks']}}"

Here is my test dashboard code:

decluttering_templates:
  ncaa_top25_settings:
    card:
      type: custom:flex-table-card
      title: '[[title]]'
      css:
        table+: 'padding: 0px; width: 100%;border-collapse: collapse; margin-top:12px;'
        tbody tr td:first-child: 'width: 1%;'
        tbody tr td:nth-child(2): 'width: 2%;'
        tbody tr td:nth-child(3): 'width: 1%;'
        tbody tr td:nth-child(4): 'width: 2%;'
        tbody tr td:nth-child(n+5): 'width: .5%;'
        tbody tr:hover: 'background-color: black!important; color:white!important;'
        tbody tr td:nth-child(7): 'background-color: green; color: white;'
      card_mod:
        style:
          .: |
            ha-card {
              overflow: auto;
              }
          $: |
            .card-header {
               padding-top: 6px!important;
               padding-bottom: 4px!important;
               font-size: 14px!important;
               line-height: 14px!important;
               font-weight: bold!important;
             }
      sort_by: entries+
      entities:
        include: '[[entity]]'
        exclude: '[[excluded_entities]]'
      columns:
        - name: Rank
          data: '[[attribute]]'
          modify: x.current
        - name: Up-Down
          data: '[[attribute]]'
          modify: |-
            if (x.current == x.previous)
              '<ha-icon icon="mdi:minus" >'
            else if (x.current =="0")
              '<ha-icon icon="mdi:bomb" style="color:red;" >'
            else if (x.previous == "0")
              '<div><ha-icon icon="mdi:hand-clap" style="color:blue;"></ha-icon>&nbsp;' +  "New " + '</div>';
            else if (x.current > x.previous)
              '<div><ha-icon icon="mdi:arrow-down" style="color:red;"></ha-icon>&nbsp;' +  "Dn "+ (x.current - x.previous) + '</div>';
            else if (x.current < x.previous)
              '<div><ha-icon icon="mdi:arrow-up" style="color:green;"></ha-icon>&nbsp;' + "Up "+ (x.previous - x.current) + '</div>';
        - name: Record
          data: '[[attribute]]'
          modify: x.recordSummary
        - name: Team
          data: '[[attribute]]'
          modify: >-
            '<div><img src="' + x.team.logos[0].href + '" style="height:
            20px;vertical-align:middle;">&nbsp;' + x.team.nickname + '</div>'
        - name: 1st Place Votes
          data: '[[attribute]]'
          modify: x.firstPlaceVotes
        - name: Previous Rank
          data: '[[attribute]]'
          modify: x.previous
        - name: Points
          data: '[[attribute]]'
          modify: x.points
  ncaa_conference_settings:
    card:
      type: custom:flex-table-card
      title: '[[title]]'
      css:
        table+: 'padding: 0px; width: 1000px;'
        tbody tr td:first-child: 'width: 5%;'
        tbody tr td:nth-child(2): 'width: 5%;'
        tbody tr td:nth-child(3): 'width: 5%;'
        tbody tr td:nth-child(4): 'width: 5%;'
        tbody tr td:nth-child(n+5): 'width: .5%;'
        tbody tr:hover: 'background-color: black!important; color:white!important;'
        tbody tr td:nth-child(7): 'background-color: green; color: white;'
      card_mod:
        style:
          .: |
            ha-card {
              overflow: auto;
              }
          $: |
            .card-header {
               padding-top: 6px!important;
               padding-bottom: 4px!important;
               font-size: 14px!important;
               line-height: 14px!important;
               font-weight: bold!important;
             }
      sort_by: events+
      entities:
        include: '[[entity]]'
        exclude: '[[excluded_entities]]'
      columns:
        - name: Game Time
          data: '[[attribute]]'
          modify: x.date.split('T')[0]
        - name: Teams
          data: '[[attribute]]'
          modify: x.shortName
        - name: Site
          data: '[[attribute]]'
          modify: >-
            x.competitions[0].venue.fullName + " " +
            x.competitions[0].venue.address.city +"," +
            x.competitions[0].venue.address.state
        - name: Home Team
          data: '[[attribute]]'
          modify: >-
            '<div><img src="' + x.competitions[0].competitors[0].team.logo + '"
            style="height: 20px;vertical-align:middle;">&nbsp;' +
            x.competitions[0].competitors[0].team.displayName + '</div>'
        - name: Record
          data: '[[attribute]]'
          modify: x.competitions[0].competitors[0].records[0].summary
        - name: Conference
          data: '[[attribute]]'
          modify: x.competitions[0].competitors[0].team.conferenceId
        - name: Away Team
          data: '[[attribute]]'
          modify: >-
            '<div><img src="' + x.competitions[0].competitors[1].team.logo + '"
            style="height: 20px;vertical-align:middle;">&nbsp;' +
            x.competitions[0].competitors[1].team.displayName + '</div>'
        - name: Record
          data: '[[attribute]]'
          modify: x.competitions[0].competitors[1].records[0].summary
        - name: Conference
          data: '[[attribute]]'
          modify: x.competitions[0].competitors[1].team.conferenceId
  ncaa_football_standings:
    card:
      type: custom:flex-table-card
      title: '[[title]]'
      css:
        table+: 'padding: 0px; width: 1000px;'
        tbody tr td:first-child: 'width: 2%;'
        tbody tr td:nth-child(2): 'width: 5%;'
        tbody tr td:nth-child(n+3): 'width: 2%;'
        tbody tr:hover: 'background-color: black!important; color:white!important;'
        tbody tr td:nth-child(5): 'background-color: green; color: white;'
      card_mod:
        style:
          .: |
            ha-card {
              overflow: auto;
              }
          $: |
            .card-header {
               padding-top: 6px!important;
               padding-bottom: 4px!important;
               font-size: 14px!important;
               line-height: 14px!important;
               font-weight: bold!important;
             }
      sort_by: entries+
      entities:
        include: '[[entity]]'
      columns:
        - name: Seed
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'SEED').displayValue
        - name: Team
          data: entries
          modify: >-
            '<div><img src="' + x.team.logos[0].href + '" style="height:
            20px;vertical-align:middle;">&nbsp;' + x.team.displayName +
            '</div>'  
        - name: Overall
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'overall').displayValue
        - name: GB
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'GB').displayValue
        - name: Wins
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'W').value
        - name: Conf Record
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'CONF').displayValue
        - name: Streak
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'STRK').value
  game_stats:
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: grid
        layout:
          grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))
      card_param: cards
      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "[[sport]]" -%}
            {%- if states(team) == "[[status]]" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
            {%- if team in state_attr('sensor.nfl_red_zone','teams') -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team,
                "card_mod": {"style": "ha-card {\n\n    color:  black; \n    background-color:  #ffcccc; \n    box-shadow: 0 0 10px 5px red;\n}\n"},
                "home_side": "right"}}},
            {%- else -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team, "card_mod": {"style": "ha-card { font-size: .7em; line-height: .7em; width: 280px;}"},"conference_id":[[conference]],
                "home_side": "right"}}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date
  ncaaf_conference_game_stats:
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: grid
        layout:
          grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))
      card_param: cards
      filter:
        template: |
          {%- for team in state_attr('[[group]]','entity_id')-%}
               {{{"type": "custom:teamtracker-card","entity": team,
               "card_mod": {"style": "ha-card { font-size: .7em; line-height: .7em; width: 280px;}"},
               "home_side": "right"}}},
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date
views:
  - theme: Backend-selected
    title: Sports
    type: panel
    icon: mdi:strategy
    badges: []
    cards:
      - type: custom:mod-card
        card_mod:
          style:
            tabbed-card $: |
              mwc-tab {
                background: black;
                color: silver;
                border-color: var(--ha-card-border-color, var(--divider-color, #e0e0e0));
                border-width: 2px;
                border-style: solid;
                overflow: hidden;
                width: 20%;
              }
              mwc-tab[active] {
                background: white !important;
                color: black !important;
              }
        card:
          type: custom:tabbed-card
          styles:
            '--mdc-theme-primary': black
            '--mdc-tab-text-label-color-default': silver
            '--mdc-typography-button-font-size': 12px
          tabs:
            - attributes:
                label: NCAA
                icon: mdi:school
              card:
                type: custom:mod-card
                card_mod:
                  style:
                    tabbed-card $: |
                      mwc-tab {
                        background: black;
                        border-color: silver;
                        border-width: 2px;
                        border-top-left-radius: 20px;
                        border-top-right-radius: 20px;
                        border-style: solid;
                        overflow: hidden;
                        width: 15%;
                      }
                      mwc-tab[active] {
                        background: white !important;
                        color: black !important
                      }
                card:
                  type: custom:tabbed-card
                  styles:
                    '--mdc-theme-primary': black
                    '--mdc-tab-text-label-color-default': silver
                    '--mdc-typography-button-font-size': 12px
                  tabs:
                    - attributes:
                        label: NCAA Football
                        icon: mdi:football
                      card:
                        type: custom:mod-card
                        card_mod:
                          style:
                            tabbed-card $: |
                              mwc-tab {
                                background: black;
                                border-color: silver;
                                border-width: 2px;
                                border-top-left-radius: 20px;
                                border-top-right-radius: 20px;
                                border-style: solid;
                                overflow: hidden;
                                width: 25%;
                              }
                              mwc-tab[active] {
                                background: white !important;
                                color: black !important;
                              }
                        card:
                          type: custom:tabbed-card
                          styles:
                            '--mdc-theme-primary': black
                            '--mdc-tab-text-label-color-default': silver
                            '--mdc-typography-button-font-size': 12px
                          tabs:
                            - attributes:
                                label: Top 25 Standings (AP-Coaches-FCS Polls)
                                icon: mdi:account-group
                              card:
                                type: horizontal-stack
                                cards:
                                  - type: vertical-stack
                                    cards:
                                      - type: markdown
                                        content: >
                                          <h4 style="text-align:center;"> {{
                                          state_attr('sensor.ncaaf_rank',
                                          'rankings')[0]['headline'] }} - 
                                          {{as_timestamp(state_attr('sensor.ncaaf_rank','rankings')[0]['date'])
                                          | timestamp_custom('%m/%d/%Y') }}</h4>
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Top 25 AFCA AP Poll
                                          - entity: sensor.ncaa_ap_poll_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Dropped Out Top 25 AP Poll
                                          - entity: >-
                                              sensor.ncaa_ap_poll_dropped_out_of_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Others Getting Votes 25 AP Poll
                                          - entity: >-
                                              sensor.ncaa_ap_poll_others_football_top_25
                                          - attribute: entries
                                  - type: vertical-stack
                                    cards:
                                      - type: markdown
                                        content: >
                                          <h4 style="text-align:center;"> {{
                                          state_attr('sensor.ncaaf_rank',
                                          'rankings')[1]['headline'] }} - 
                                          {{as_timestamp(state_attr('sensor.ncaaf_rank','rankings')[1]['date'])
                                          | timestamp_custom('%m/%d/%Y') }}</h4>
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Top 25 AFCA Coaches Poll
                                          - entity: >-
                                              sensor.ncaa_afca_coaches_poll_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: >-
                                              NCAA Dropped Out Top 25 AFCA Coaches
                                              Poll
                                          - entity: >-
                                              sensor.ncaa_afca_coaches_poll_dropped_out_of_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: >-
                                              NCAA Others Getting Votes 25 AFCA
                                              Coaches Poll
                                          - entity: >-
                                              sensor.ncaa_afca_coaches_poll_others_football_top_25
                                          - attribute: entries
                                  - type: vertical-stack
                                    cards:
                                      - type: markdown
                                        content: >
                                          <h4 style="text-align:center;"> {{
                                          state_attr('sensor.ncaaf_rank',
                                          'rankings')[2]['headline'] }} -  {{
                                          as_timestamp(state_attr('sensor.ncaaf_rank',
                                          'rankings')[2]['date']) |
                                          timestamp_custom('%m/%d/%Y') }}</h4>
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Top 25 FCS Coaches Poll
                                          - entity: sensor.ncaa_fcs_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Dropped Out Top 25 FCS Coaches Poll
                                          - entity: >-
                                              sensor.ncaa_fcs_coaches_poll_dropped_out_of_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: >-
                                              NCAA Others Getting Votes 25FCS Coaches
                                              Poll
                                          - entity: >-
                                              sensor.ncaa_fcs_coaches_poll_others_football_top_25
                                          - attribute: entries
                            - attributes:
                                label: Big 12 Conference
                                icon: mdi:account-group
                              card:
                                type: horizontal-stack
                                cards:
                                  - type: vertical-stack
                                    cards:
                                      - type: custom:decluttering-card
                                        template: ncaa_conference_settings
                                        variables:
                                          - title: NCAA Big 12 Conference
                                          - entity: sensor.ncaaf_big_12_games
                                          - attribute: events
                                      - type: markdown
                                        content: |
                                          <h1>Big 12 conference</h1>
                                      - type: custom:decluttering-card
                                        template: ncaaf_conference_game_stats
                                        variables:
                                          - group: group.big_12_conference_teams_group
                                  - type: vertical-stack
                                    cards:
                                      - type: markdown
                                        content: |
                                          <h1>NCAA Games Live</h1>
                                      - type: custom:decluttering-card
                                        template: game_stats
                                        variables:
                                          - sport: NCAAF
                                          - sport_path: football
                                          - league_path: college-football
                                          - conferenceid: 4
                                          - status: IN
                                          - conference: '4'
                                      - type: markdown
                                        content: |
                                          <h1>NCAA Games Coming-up</h1>
                                      - type: custom:decluttering-card
                                        template: game_stats
                                        variables:
                                          - sport: NCAAF
                                          - sport_path: football
                                          - league_path: college-football
                                          - conferenceid: 4
                                          - status: PRE
                                          - conference: '4'
                                      - type: markdown
                                        content: |
                                          <h1>NCAA Games Completed</h1>
                                      - type: custom:decluttering-card
                                        template: game_stats
                                        variables:
                                          - sport: NCAAF
                                          - sport_path: football
                                          - league_path: college-football
                                          - conferenceid: 4
                                          - status: POST
                                          - conference: '4'
                            - attributes:
                                label: NCAA Football Conferences
                                icon: mdi:account-group
                              card:
                                type: horizontal-stack
                                cards:
                                  - type: vertical-stack
                                    cards:
                                      - type: custom:decluttering-card
                                        template: ncaa_football_standings
                                        variables:
                                          - title: Big 12 Conference
                                          - entity: sensor.big_12_conference
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_football_standings
                                        variables:
                                          - title: Big Ten Conference
                                          - entity: sensor.big_ten_conference
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_football_standings
                                        variables:
                                          - title: Atlantic Coast Conference
                                          - entity: sensor.atlantic_coast_conference
                                          - attribute: entries
                            - attributes:
                                label: Placeholder (future)
                                icon: mdi:account-group
                              card:
                                type: horizontal-stack
                                cards:
                                  - type: vertical-stack
                                    cards: null
title: NCAA Sports Standings and Scores

Will try to work on the other later - but would love to see someoneā€™s finished NCAA code or if anyone has the teamtracker platforms entered and would like to share it would be appreciated.

Update: Made a couple changes to decluttering card and added movement arrows and more changes to look

**Update: Add moves up/down and some other cosmetic changes and fixed headlines

Update - 9-16-2024

  • mostly cosmetic changes like fixing the date issue I had on pulling Polls (say that 6 times fast :wink: )
  • also I notice like most that ESPN brings in the FCS polls later so they will eventually populate
    -I have been trying to create conference only tabbed, kind of a quick hit of all that conferences info and I was hoping to use the teamtracker ā€œconference_idā€ as a filter but I canā€™t seem to figure that out yet - maybe someone has an idea @kbrown01 or @vasqued2 . So what I am doing is creating a group and then just passing the group to teamtracker. Here is an example - this is in my groups.yaml file
Big_12_Conference_teams_group:
    name: "Big 12 Conference Teams"
    entities:
      - sensor.arizona_state_university
      - sensor.university_of_arizona
      - sensor.brighan_young_university
      - sensor.kansas_state_university
      - sensor.oklahoma_state_university
      - sensor.university_of_utah
      - sensor.baylor_university
      - sensor.iowa_state_university
      - sensor.university_of_cincinnati
      - sensor.university_of_colorado_boulder
      - sensor.texas_tech_university
      - sensor.university_of_houston
      - sensor.university_of_kansas
      - sensor.texas_christian_university
      - sensor.university_of_central_florida
      - sensor.west_virginia_university

-I plan on trying to combine the game_stats template with the one I created for passing the groups list (ncaaf_conference_game_stats). I seem to be doing a good job of cluttering my decluttering card.
-new code is posted above

  • You can see in the big 12 conference a couple things that need fixed and have been changed. Making the cards smaller because I am mostly on a pc and the conference only cards. They are showing duplicates when they are conference games and will look to fix (unless someone has a quick fix - Unique is set to true. You can see where I am heading here.

Thanks to all and if you are new read this thread and the one below from the beginning I know it was like being in a class https://community.home-assistant.io/t/real-time-sports-scores-w-teamtracker-and-teamtracker-card-beta/456923

Somehow not working for me, but I think itā€™s on my end tho :slight_smile:

What are you seeing? Are your sensors populated? HA sometimes alters the sensor name from what it should be. I have no idea why but I go into Settings>Automations>Entities to confirm the sensor is named what I am sending to the decluttering-card and I go into states to make sure that sensor is populated. Here is one of the sensors in my example that is being called:sensor.ncaa_ap_poll_football_top_25

Updates - mostly just playing with formatting and added dropped out/others getting votes - just dashboard code is changing:

**Update2:**Added in more sensors for Dropped Out/Others in the AFCA Coaches and FCS Coaches Polls. FCS is not showing dropped out in the api - maybe it will update this weekend.
Sensors.yaml hasnā€™t changed
Template.yaml code is here:

################################################ AP Poll #####################################
  ##NCAA Men's Football AP Poll
    - name: NCAA AP Poll Football Top 25
      unique_id: sensor.ncaa_ap_poll_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[0]['ranks']}}"
 
  ##NCAA Men's Football Dropped out of AP Poll  
    - name: NCAA AP Poll Dropped out of Football Top 25
      unique_id: sensor.ncaa_ap_poll_dropped_out_of_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[0]['droppedOut']}}"
  
  ##NCAA Men's Football Others Getting Votes AP Poll  
    - name: NCAA AP Poll Others Football Top 25
      unique_id: sensor.ncaa_ap_poll_others_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[0]['others']}}"

################################################ AFCA Coaches Poll #####################################
  ##NCAA Men's Football AFCA Coaches Poll        
    - name: NCAA AFCA Coaches Poll Football Top 25
      unique_id: sensor.ncaa_Coaches_poll_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[1]['ranks']}}"

  ##NCAA Men's Football Dropped out of AFCA Coaches Poll        
    - name: NCAA AFCA Coaches Poll Dropped out of Football Top 25
      unique_id: sensor.ncaa_afca_coaches_poll_dropped_out_of_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[1]['droppedOut']}}"
  
  ##NCAA Men's Football Others Getting Votes AFCA Coaches Poll        
    - name: NCAA AFCA Coaches Poll Others Football Top 25
      unique_id: sensor.ncaa_afca_coaches_poll_others_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[1]['others']}}"

################################################ AP Poll ##################################### 
  ##NCAA Men's Football FCS Coaches Poll        
    - name: NCAA FCS Football Top 25
      unique_id: sensor.ncaa_FCS_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[2]['ranks']}}"
          
  ##NCAA Men's Football Dropped out of FCS Coaches Poll   
    - name: NCAA FCS Coaches Poll Dropped out of Football Top 25
      unique_id: sensor.ncaa_fcs_coaches_poll_dropped_out_of_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[2]['droppedOut']}}"
  
  ##NCAA Men's Football Others Getting Votes FCS Coaches Poll  
    - name: NCAA FCS Coaches Poll Others Football Top 25
      unique_id: sensor.ncaa_fcs_coaches_poll_others_football_top_25
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[2]['others']}}"          
          
          
################################################ Preseason stuff #####################################          
  ###found in pre-season not now        
    #- name: NCAA AFCA DIV II Football Top 25
      #unique_id: sensor.ncaa_AFCA_DIV_II_football_top_25
      #state: "{{ now() }}"
      #attributes:
          #entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[3]['ranks']}}"
  ###found in pre-season not now
    #- name: NCAA AFCA Div III Coaches Poll Football Top 25
      #unique_id: sensor.ncaa_AFCA_DIV_III_football_top_25
      #state: "{{ now() }}"
      #attributes:
          #entries: "{{ state_attr('sensor.ncaaf_rank','rankings')[4]['ranks']}}"
  

#####################################################################################

Here is the dashboard:

decluttering_templates:
  ncaa_top25_settings:
    card:
      type: custom:flex-table-card
      title: '[[title]]'
      css:
        table+: 'padding: 0px; width: 600px;'
        tbody tr td:first-child: 'width: 1%;'
        tbody tr td:nth-child(2): 'width: 2%;'
        tbody tr td:nth-child(3): 'width: 1%;'
        tbody tr td:nth-child(4): 'width: 2%;'
        tbody tr td:nth-child(n+5): 'width: .5%;'
        tbody tr:hover: 'background-color: green!important; color:white!important;'
        tbody tr td:nth-child(7): 'background-color: green; color: white;'
      card_mod:
        style:
          .: |
            ha-card {
              overflow: auto;
              }
          $: |
            .card-header {
               padding-top: 6px!important;
               padding-bottom: 4px!important;
               font-size: 14px!important;
               line-height: 14px!important;
               font-weight: bold!important;
             }
      sort_by: entries+
      entities:
        include: '[[entity]]'
        exclude: '[[excluded_entities]]'
      columns:
        - name: Rank
          data: '[[attribute]]'
          modify: x.current
        - name: Up-Down
          data: '[[attribute]]'
          modify: |-
            if (x.current == x.previous)
              '<ha-icon icon="mdi:minus" >'
            else if (x.current =="0")
              '<ha-icon icon="mdi:bomb" >'
            else if (x.previous == "0")
              '<div><ha-icon icon="mdi:hand-clap" style="color:blue;"></ha-icon>&nbsp;' +  "New " + '</div>';
            else if (x.current > x.previous)
              '<div><ha-icon icon="mdi:arrow-down" style="color:red;"></ha-icon>&nbsp;' +  "Dn "+ (x.current - x.previous) + '</div>';
            else if (x.current < x.previous)
              '<div><ha-icon icon="mdi:arrow-up" style="color:green;"></ha-icon>&nbsp;' + "Up "+ (x.previous - x.current) + '</div>';
        - name: Record
          data: '[[attribute]]'
          modify: x.recordSummary
        - name: Team
          data: '[[attribute]]'
          modify: >-
            '<div><img src="' + x.team.logos[0].href + '" style="height:
            20px;vertical-align:middle;">&nbsp;' + x.team.nickname + '</div>'
        - name: 1st Place Votes
          data: '[[attribute]]'
          modify: x.firstPlaceVotes
        - name: Previous Rank
          data: '[[attribute]]'
          modify: x.previous
        - name: Points
          data: '[[attribute]]'
          modify: x.points
  ncaa_conference_settings:
    card:
      type: custom:flex-table-card
      title: '[[title]]'
      css:
        table+: 'padding: 0px; width: 600px;'
        tbody tr td:first-child: 'width: 5%;'
        tbody tr td:nth-child(2): 'width: 5%;'
        tbody tr td:nth-child(3): 'width: 5%;'
        tbody tr td:nth-child(4): 'width: 5%;'
        tbody tr td:nth-child(n+5): 'width: .5%;'
        tbody tr:hover: 'background-color: green!important; color:white!important;'
        tbody tr td:nth-child(7): 'background-color: green; color: white;'
      card_mod:
        style:
          .: |
            ha-card {
              overflow: auto;
              }
          $: |
            .card-header {
               padding-top: 6px!important;
               padding-bottom: 4px!important;
               font-size: 14px!important;
               line-height: 14px!important;
               font-weight: bold!important;
             }
      sort_by: events+
      entities:
        include: '[[entity]]'
        exclude: '[[excluded_entities]]'
      columns:
        - name: Is in Conference
          data: '[[attribute]]'
          modify: x.name
        - name: Site
          data: '[[attribute]]'
          modify: x.shortName
        - name: Team Name
          data: '[[attribute]]'
          modify: x.competitions[0].competitors[0].team.displayName
        - name: Conference
          data: '[[attribute]]'
          modify: x.competitions[0].competitors[0].team.conferenceId
        - name: Team
          data: '[[attribute]]'
          modify: >-
            '<div><img src="' + x.competitions[0].competitors[0].team.logo.href
            + '" style="height: 20px;vertical-align:middle;">&nbsp;' +
            x.competitions[0].competitors[0].team.displayName + '</div>'
        - name: Record
          data: '[[attribute]]'
          modify: x.competitions[0].competitors[0].records[0].summary
views:
  - theme: Backend-selected
    title: Sports
    type: panel
    icon: mdi:strategy
    badges: []
    cards:
      - type: custom:mod-card
        card_mod:
          style:
            tabbed-card $: |
              mwc-tab {
                background: var(--ha-card-background, var(--card-background-color, white) );
                border-color: var(--ha-card-border-color, var(--divider-color, #e0e0e0) );
                border-width: 2px;
                border-top-left-radius: 20px;
                border-top-right-radius: 20px;
                border-style: solid;
                overflow: hidden;
                width: 20%;
              }
              mwc-tab[active] {
                background: #EBFFD8 !important;
              }
        card:
          type: custom:tabbed-card
          styles:
            '--mdc-theme-primary': green
            '--mdc-tab-text-label-color-default': silver
            '--mdc-typography-button-font-size': 12px
          tabs:
            - attributes:
                label: NCAA
                icon: mdi:football
              card:
                type: custom:mod-card
                card_mod:
                  style:
                    tabbed-card $: |
                      mwc-tab {
                        background: var(--ha-card-background, var(--card-background-color, white) );
                        border-color: var(--ha-card-border-color, var(--divider-color, #e0e0e0) );
                        border-width: 2px;
                        border-top-left-radius: 20px;
                        border-top-right-radius: 20px;
                        border-style: solid;
                        overflow: hidden;
                        width: 15%;
                      }
                      mwc-tab[active] {
                        background: #EBFFD8 !important;
                      }
                card:
                  type: custom:tabbed-card
                  styles:
                    '--mdc-theme-primary': green
                    '--mdc-tab-text-label-color-default': silver
                    '--mdc-typography-button-font-size': 12px
                  tabs:
                    - attributes:
                        label: Top 25 Standings
                        icon: mdi:ballot
                      card:
                        type: custom:mod-card
                        card_mod:
                          style:
                            tabbed-card $: |
                              mwc-tab {
                                background: var(--ha-card-background, var(--card-background-color, white) );
                                border-color: var(--ha-card-border-color, var(--divider-color, #e0e0e0) );
                                border-width: 2px;
                                border-top-left-radius: 20px;
                                border-top-right-radius: 20px;
                                border-style: solid;
                                overflow: hidden;
                                width: 25%;
                              }
                              mwc-tab[active] {
                                background: #EBFFD8 !important;
                              }
                        card:
                          type: custom:tabbed-card
                          styles:
                            '--mdc-theme-primary': green
                            '--mdc-tab-text-label-color-default': silver
                            '--mdc-typography-button-font-size': 12px
                          tabs:
                            - attributes:
                                label: AP-Coaches Polls
                                icon: mdi:account-group
                              card:
                                type: horizontal-stack
                                cards:
                                  - type: vertical-stack
                                    cards:
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Top 25 AP Poll
                                          - entity: sensor.ncaa_ap_poll_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Dropped Out Top 25 AP Poll
                                          - entity: >-
                                              sensor.ncaa_ap_poll_dropped_out_of_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Others Getting Votes 25 AP Poll
                                          - entity: >-
                                              sensor.ncaa_ap_poll_others_football_top_25
                                          - attribute: entries
                                  - type: vertical-stack
                                    cards:
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Top 25 AFCA Coaches Poll
                                          - entity: >-
                                              sensor.ncaa_afca_coaches_poll_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: >-
                                              NCAA Dropped Out Top 25 AFCA Coaches
                                              Poll
                                          - entity: >-
                                              sensor.ncaa_afca_coaches_poll_dropped_out_of_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: >-
                                              NCAA Others Getting Votes 25 AFCA
                                              Coaches Poll
                                          - entity: >-
                                              sensor.ncaa_afca_coaches_poll_others_football_top_25
                                          - attribute: entries
                                  - type: vertical-stack
                                    cards:
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Top 25 FCS Coaches Poll
                                          - entity: sensor.ncaa_fcs_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: NCAA Dropped Out Top 25 FCS Coaches Poll
                                          - entity: >-
                                              sensor.ncaa_fcs_coaches_poll_dropped_out_of_football_top_25
                                          - attribute: entries
                                      - type: custom:decluttering-card
                                        template: ncaa_top25_settings
                                        variables:
                                          - title: >-
                                              NCAA Others Getting Votes 25FCS Coaches
                                              Poll
                                          - entity: >-
                                              sensor.ncaa_fcs_coaches_poll_others_football_top_25
                                          - attribute: entries
                            - attributes:
                                label: Big 12 Conference
                                icon: mdi:account-group
                              card:
                                type: horizontal-stack
                                cards:
                                  - type: vertical-stack
                                    cards:
                                      - type: custom:decluttering-card
                                        template: ncaa_conference_settings
                                        variables:
                                          - title: NCAA Big 12 Conference
                                          - entity: sensor.ncaaf_big_12_games
                                          - attribute: events
title: NCAA Sports Standings and Scores

Here is what it looks like:

For those that want to help I am trying to get conference standings (liike NFL/NBA/etc.) but I donā€™t think ESPN has an API. So one thought I started playing with was trying to pull Win/Loss records out of the group apiā€™s.
I am starting with Big 12 - here is the link - https://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?groups=4

The code that is in the dashboard at the bottom and in the decluttering card are in the back of the napkin stage right now. But if you want to help :wink: here is the sensor.yaml

########
##NCAA Football League schedules
####
##### Big 12
- platform: rest
  scan_interval: 36000
  name: NCAAf Big 12 Games 
  unique_id: sensor.ncaaf_big_12_games
  resource: https://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard?groups=4
  value_template: "{{ now() }}"
  json_attributes:
      - events  
  

Here is the template.yaml code:

########
##NCAA Football League schedules
#### Big 12
    - name: NCAA Weekly Big 12 Games
      unique_id: sensor.ncaa_weekly_big_12_games
      state: "{{ now() }}"
      attributes:
          entries: "{{ state_attr('sensor.ncaaf_big_12_games','events')[0]['competitions'][0]['competitors']}}"

Again back of napkin but this is what it gives right now

This is great work, thaks to @bburwell and others for making this better! I am back from my European jaunt, and itā€™s suddenly time from harvest for the winery. Iā€™ll come up for air on occasion but all your participation helps in making this great.

Appreciate the comments but I canā€™t express how grateful I am for what you built. I simply dotted the i on a couple projects. Between what you did @kbrown01 and @Ildar_Gabdullinā€™s magnificent flex-table-card I am looking forward to the projects that will be created. Thanks to you both for your contributions!!! You both should get together and create a Master Class on Jinja2, JSON, CSS and Home Assistant.

2 Likes

Got it fixed. Had a typo in my sensor.yaml and didnā€™t even notice that the sensor didnā€™t populate.

Can you post your dropped out and others getting votes templates?

Just updated over code above. Should have all of the dropped out/others and I have added it for both Coaches polls as well.