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> ' + "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: 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;"> ' +
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 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