I would always use templated sensors. I have everything done except the logos.
Sensor (should be in sensor.yaml if included or start with sensor: ):
##
## Belgium Football
##
- platform: rest
scan_interval: 36000
name: Belgian Pro League Standings
unique_id: sensor.belgian_pro_league_standings
resource: https://site.web.api.espn.com/apis/v2/sports/soccer/bel.1/standings
value_template: "{{ now() }}"
json_attributes:
Template (should be in template.yaml if included or start with template: ):
###
### Belgian Pro League
###
- name: Belgian Pro League
unique_id: sensor.belgian_pro_league
state: "{{ now() }}"
attributes:
entries: "{{ state_attr('sensor.belgian_pro_league_standings','children')[0]['standings']['entries'] }}"
Sample Dashboard (obviously requires decluttering templates and flex-table):
decluttering_templates:
bpl_settings:
card:
type: custom:flex-table-card
title: '[[title]]'
css:
table+: 'padding: 0px; width: 1600px;'
tbody tr td:first-child: 'width: 5%;'
tbody tr td:nth-child(2): 'width: 40%;'
tbody tr td:nth-child(n+3): 'width: 5%;'
tbody tr:hover: 'background-color: green!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;
}
entities:
include: '[[entity]]'
sort_by: entries
columns:
- name: Rank
data: entries
modify: x.stats.find(y=>y.abbreviation == 'R').displayValue
- name: Team
data: entries
modify: x.team.displayName
- name: G
data: entries
modify: x.stats.find(y=>y.abbreviation == 'F').displayValue
- name: DIFF
data: entries
modify: x.stats.find(y=>y.abbreviation == 'GD').displayValue
- name: Pts
data: entries
modify: x.stats.find(y=>y.shortDisplayName == 'P').displayValue
views:
- title: Belgian Pro League Standings
icon: mdi:soccer
type: panel
badges: []
cards:
- type: custom:decluttering-card
template: bpl_settings
variables:
- title: Belgian Pro League
- entity: sensor.belgian_pro_league
I will work on the image for you.
