Ok so it was my error or Home Assistant being vindictive 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> ' + "New " + '</div>';
else if (x.current > x.previous)
'<div><ha-icon icon="mdi:arrow-down" style="color:red;"></ha-icon> ' + "Dn "+ (x.current - x.previous) + '</div>';
else if (x.current < x.previous)
'<div><ha-icon icon="mdi:arrow-up" style="color:green;"></ha-icon> ' + "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;"> ' + 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;"> ' +
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;"> ' +
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;"> ' + 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 )
- 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