Sports Standings and Scores

Are you sure the out of memory issue is HA?

Plex on my Synology had what others considered a ‘memory leak’. But, really, not all paths were mapped to somewhere on the NAS. So, it was sucking up memory.

I think I still have something doing it on Plex. But, have not found it yet. It is nowhere near as bad as I originally had.

Not saying yours is Plex. But, could be similar.

Hello, and as always, thank you!!

I’ve been messing around with the templates to tweak some of my households interests. A few of these questions will be 50/50 TeamTracker and this groups awesome work.

  1. If I add multiple sports that don’t fall under traditional TeamTracker and use XXX instead of NHL, NFL, NBA etc… Will I run into challenges using PRE/POST/LIVE for the next non-traditional sport added? In this example, I’ve added English Level Two soccer (eng.4 from ESPN).

  2. I have a standings table I’m mostly happy with and sorting correctly. Can someone help me add code that would identify groupings? 1-3, 4-7, 8-22, 23-24 in the image I’m attaching relates to promotion, compete for promotion, status quo and relegation. I’m unclear if this is done with extra sorting in the sport’s flex-table or if it becomes extra lines within the standings card?

  el2_settings:
    card:
      type: custom:flex-table-card
      css:
        table+: 'padding: 0px; width: 1600px;'
        tbody tr td:first-child: 'width: 2%;'
        tbody tr td:nth-child(2): 'width: 15%;'
        tbody tr td:nth-child(n+3): 'width: 4%;'
        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;
             }
      entities:
        include: '[[entity]]'
      sort_by: entries-
      columns:
        - hidden: true
          data: entries
        - name: <div>Rank</div>
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'R').displayValue
        - name: <div>Team</div>
          data: entries
          modify: |-
            if (typeof x.team.logos !== 'undefined')
              '<div><img src="' + x.team.logos[0].href + '" style="height:20px;vertical-align:middle;">&nbsp;' + x.team.displayName + '</div>'
            else
              '<div>' + x.team.displayName + '</div>'
        - name: <div>Matches Played</div>
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'GP').displayValue
        - name: <div>Wins</div>
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'W').displayValue             
        - name: <div>Draws</div>
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'D').displayValue  
        - name: <div>Losses</div>
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'L').displayValue  
        - name: <div>Points</div>
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'P').displayValue 
        - name: <div>Goals For</div>
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'F').displayValue  
        - name: <div>Goals Against</div>
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'A').displayValue  
        - name: <div>Difference</div>
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'GD').displayValue
        - name: <div>Overall</div>
          data: entries
          modify: x.stats.find(y=>y.abbreviation == 'Total').displayValue
                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: Standings
                        icon: mdi:ballot
                      card:
                        type: custom:decluttering-card
                        template: el2_settings
                        variables:
                          - entity: sensor.english_league_two
                          - attributes: entries
  1. For the NHL Schedule (SOS), daily face-off was instead of ESPN. Can any schedule be used, or do I need to identify only sites that have API hooks? I’d like to create a schedule for EL2, mostly to learn how to create one for other sports in the future.

For #1, I would think no problem as long as you are calling them correctly. The code which displays the TeamTracker cards does take in the league (a.k.a. NFL) it also only has home teams so to not double up teams. As long as you can do those, you should be OK. If you use the version that does “Red Zone” coloring of the TeamTracker cards, that applies to NFL only and should not be included in other leagues.

For #2, I need a picture of what you mean. It is not clear to me are these positions of rank that you want to highlight differently or are they some divisional thing or?

For #3, I chose to use Daily Faceoff as that is what I used just on the web. It doesn’t have an API perse, but the raw data for the page is injected in the page in JSON embedded in a script tag. The sensor code uses multiscrape to scrape the JSON data out and make the sensors. If you have some source of a page that displays what you want, then I would open that page using developer’s tools on your browser. Look at what is loaded and see if some JSON is not being read in (then you can get its URL) or like Daily Faceoff, it could be embedded in the page in a script tag. If there is nothing but raw HTML, I would find another source of the information because you will spend forever trying to scrape that much data from pure HTML.

More on #2 … if you look at the NHL Wildcard sensors, this is how they are built:

  - name: NHL Wildcard Standings
    unique_id: sensor.nhl_wildcard_standings
    state: "{{ now() }}"
    attributes:
      east_atlantic_top: "{{ state_attr('sensor.nhl_wildcard','overall')[0]['children'][0]['standings']['entries'] }}"
      east_metropolitan_top: "{{ state_attr('sensor.nhl_wildcard','overall')[0]['children'][1]['standings']['entries'] }}"
      east_wildcard: "{{ state_attr('sensor.nhl_wildcard','children')[0]['standings']['entries'][:2] }}"
      east_hunt: >
          {% set hteams = namespace(hteam=[]) %}
          {% for team in state_attr('sensor.nhl_wildcard','children')[0]['standings']['entries'][2:] %}
            {% for stat in team['stats'] | selectattr('name','eq','clincher') %}
            {% else %}
                  {% set hteams.hteam = hteams.hteam + [team] %}
            {% endfor %}
          {% endfor %}
          {{ hteams.hteam }}
      east_eliminated: >
        {% set eteams = namespace(eteam=[]) %}
        {% for team in state_attr('sensor.nhl_wildcard','children')[0]['standings']['entries'][2:] %}
          {% for stat in team['stats'] %}
            {% if stat.name == 'clincher' %}
                {% set eteams.eteam = eteams.eteam + [team] %}
            {% endif %}
          {% endfor %}
        {% endfor %}
        {{ eteams.eteam }}
      west_central_top: "{{ state_attr('sensor.nhl_wildcard','overall')[1]['children'][0]['standings']['entries'] }}"
      west_pacific_top: "{{ state_attr('sensor.nhl_wildcard','overall')[1]['children'][1]['standings']['entries'] }}"
      west_wildcard: "{{ state_attr('sensor.nhl_wildcard','children')[1]['standings']['entries'][:2] }}"
      west_hunt: >
          {% set hteams = namespace(hteam=[]) %}
          {% for team in state_attr('sensor.nhl_wildcard','children')[1]['standings']['entries'][2:] %}
            {% for stat in team['stats'] | selectattr('name','eq','clincher') %}
            {% else %}
                  {% set hteams.hteam = hteams.hteam + [team] %}
            {% endfor %}
          {% endfor %}
          {{ hteams.hteam }}
      west_eliminated: >
        {% set eteams = namespace(eteam=[]) %}
        {% for team in state_attr('sensor.nhl_wildcard','children')[1]['standings']['entries'][2:] %}
          {% for stat in team['stats'] %}
            {% if stat.name == 'clincher' %}
                {% set eteams.eteam = eteams.eteam + [team] %}
            {% endif %}
          {% endfor %}
        {% endfor %}
        {{ eteams.eteam }}

You can see that they are reorganized by using positional things on the dict like [:2] or in your case perhaps [0:2], [3-6], [7:21],[22:] … as a zero-indexed position if that is what you want.

This is great feedback! Thank you!!

The following table is taken from skysports. They are just adding a bolded line between the groupings. That may be the easiest way as the ranking will change, but the season only has the same 24 teams. I may be overcomplicating what I want to do.

If I can define the table background by row. That would work.

OK.

All is CSS. You have to have collapsed borders and then you can select the children rows with CSS for borders. This:

        table+: 'padding: 0px; width: 100%; border-collapse: collapse;'
        tbody tr td:first-child: 'width: 2%;'
        tbody tr td:nth-child(2): 'width: 15%;'
        tbody tr td:nth-child(n+3): 'width: 4%;'
        tbody tr:nth-child(3): 'border-bottom: 1px solid black!important;'

Looks like this:

So the third child row has a black border. so the two things here are:

        table+: 'padding: 0px; width: 100%; border-collapse: collapse;'
        tbody tr:nth-child(3): 'border-bottom: 1px solid black!important;'

Just add the #'s you want … “3”, “7”, “22”

        table+: 'padding: 0px; width: 100%; border-collapse: collapse;'
        tbody tr:nth-child(3): 'border-bottom: 1px solid black!important;'
        tbody tr:nth-child(7): 'border-bottom: 1px solid black!important;'
        tbody tr:nth-child(22): 'border-bottom: 1px solid black!important;'

Side note: using collapsed borders can screw up padding a bit. It you then have padding needs you apply them to the td. Here is 3, 7, 22 in the NHL stats:

It might be Plex. I have the Plex meets HA (HACS) and have seen some PlexAPI error messages in the HA log. I will have to investigate more if my QNAP server runs out of 32GB RAM due to python again. I thought the container would have prevented an issue like that.

If you figure anything out with Plex and can share, I would appreciate it.

I almost have it done. I am in the middle of looking back at my base playoff seed sensor/attributes because it is a bit convoluted and I know it can be more concise and I think it is causing an issue with TV info for the upcoming Ravens/Texans game. The data for WildCard and Division game are working, but I need to work on the League and Super Bowl (cards are not showing up yet).

I also need to make sure MLB still works (they share the same declutter template and button_card_templates). Had to figure out how to import MLB playoff data from last year first (success). I do not have the NHL data from last spring, but I tried to incorporate it into the same declutter/button cards.

Preview - NFL

Preview - MLB

Thank you! I’m going to update my dashboard first thing in the morning.

Hi,

I’m looking for simple HTML application to display the NFL playoff bracket using the ESPN API data. I’ve been searching the internet but have been unsuccessful finding much.

I found an application but I believe its purpose is to manually create the bracket.

I saw @kbrown01 mentioned developing a playoff bracket previously.

Does anyone know anything out there?

Thanks!

I mentioned that I was thinking about it! But I have had no time to implement anything.

The biggest problem is reseeding, so in reality you can only display one week of games plus past games. You cannot predict what to display … for example WHEN GB beats SF and my LIONS beat TAMPA … Lions will play GB in Detroit. But if GB loses to SF and the LIONS win, the LIONS play SF in SF.

Standard brackets like NCAA with no reseeds can be drawn immediately.

Gotcha. Would be useful, at least for myself, to have the current playoff week as a compact card.

Thanks. Go Lions!

You could do current playoff week by extracting data available in the TeamTracker entities for the PRE settings. This is how mine looks now:

But looking at one of those teams like the Lions, you can get this information:

attribution: Data provided by ESPN
sport: football
league: NFL
league_logo: https://a.espncdn.com/i/teamlogos/leagues/500/nfl.png
team_abbr: DET
opponent_abbr: TB
event_name: TB @ DET
date: 2024-01-21T20:00Z
kickoff_in: in 2 days
venue: Ford Field
location: Detroit, MI
tv_network: NBC
odds: DET -6.5
overunder: 49.5
team_name: Lions
team_id: "8"
team_record: 12-5
team_rank: null
team_homeaway: home
team_logo: https://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/det.png
team_colors:
  - "#0076b6"
  - "#bbbbbb"
team_score: "0"
team_win_probability: null
team_winner: null
team_timeouts: null
opponent_name: Buccaneers
opponent_id: "27"
opponent_record: 9-8
opponent_rank: null
opponent_homeaway: away
opponent_logo: https://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/tb.png
opponent_colors:
  - "#bd1c36"
  - "#3e3a35"
opponent_score: "0"
opponent_win_probability: null
opponent_winner: null
opponent_timeouts: null
quarter: 0
clock: 1/21 - 3:00 PM EST
possession: null
last_play: null
down_distance_text: null
outs: null
balls: null
strikes: null
on_first: null
on_second: null
on_third: null
team_shots_on_target: null
team_total_shots: null
opponent_shots_on_target: null
opponent_total_shots: null
team_sets_won: null
opponent_sets_won: null
last_update: "2024-01-18 13:54:49-08:00"
api_message: Cached data
icon: mdi:football
friendly_name: Detroit Lions

So you could extract that information into whatever you like to draw something you like. Of course that is not giving you past games, just the current upcoming games. It would also only work after ESPN updates the stats so like Monday it could draw these games.

I have a working MLB and NFL playoff bracket, but I need to finish testing and then document how people can add to their rest/template/dashboards. I hope to share it soon.

Thanks for the option! My dashboard has limited space and the team tracker cards don’t quite fit in, so I’m looking for a compact solution

Amazing looking forward to seeing that :smiley:

Define a “compact” solution … you cannot want a bracket -style layout and want a compact solution.

If you only want a simple list/table like:

A Team B Team
C Team D Team

Then you have everything to build that with what I posted and using a simple markdown card.

This is my first time sharing with the community. Here are my REST sensors, template sensors, decluttering templates, button card templates, groups, and dashboard cards for the Playoff Brackets - NFL, MLB, and NHL. I use a Home Assistant split configuration, so if you do not, you may need to modify code to match your setup. I used kbrown01’s code as a basis and then added/modified for my family’s benefit (only NHL, MLB, and NFL), so I will not post my entire configuration here. I am also not currently a github user, so I will split the information into 3 separate posts by sport. This is all based on ESPN feeds, which are subject to change.

There are additional dependencies I use for the playoff brackets - mushroom-title-card (piitaya) and button-card (RomRider). Both are available in HACS. If you do not have HACS due to your Home Assistant setup, set it up following their instructions. As part of the dashboard layout-cards, I have used mediaquery for displaying on phones and tablets. It is generic, so if it does not suit your devices, please consult thomasloven’s layout-card instructions in HACs.

I was able to find some MLB and NHL playoff data from last year and test it. It should work next year unless ESPN changes the format of their feeds.

Here is the generic code that currently works for the NFL, NHL, and MLB data for the REST/template sensors and groups I will post for the 3 sports. You need to add this to your lovelace dashboard card(s), according to your setup.

General - Shared across NFL, MLB, and NHL

Button Card Templates

button_card_templates:
  game_winner_btn:
    show_state: false
    show_name: true
    styles:
      card:
        - border: 3px solid green
  nostat_btn:
    show_state: false
    show_name: true
  playing_btn:
    show_state: false
    show_label: true
    show_name: true
    styles:
      card:
        - border: 3px solid yellow
  wip_btn:
    show_state: false
    show_name: true
    show_label: true
    styles:
      card:
        - padding: 10px
        - font-size: 20px
  live_btn:
    show_state: false
    show_name: true
    show_label: true
    styles:
      card:
        - border: 3px solid yellow
        - padding: 10px!important
  tbd_btn:
    show_state: false
    show_name: true
    show_label: true
    styles:
      card:
        - padding: 10px
  live_tv_btn:
    show_state: false
    show_name: true
    show_label: false
    styles:
      card:
        - border: 3px solid yellow
        - padding: 10px
        - font-size: 20px
  tv_btn:
    show_state: false
    show_name: true
    show_label: true
    styles:
      card:
        - border: 1px solid red
        - padding: 10px
        - font-size: 20px
  final_score_btn:
    show_state: false
    show_name: true
    show_label: true
    styles:
      card:
        - border: 3px solid green

Decluttering Templates - po_game_info corrected for Live Scores (1/29/2024)

  forecast_title:
    card:
      type: custom:mushroom-title-card
      title: '[[forecast_label]]'
      card_mod:
        style: |
          ha-card {
            .title {
              font-size: 24px;
              color: #6CB4EE;
              font-weight: bold;
              border: 1px solid white;
              padding: 3px;
              padding-bottom: -16px!important;
            }
          }
  po_level_title:
    card:
      type: custom:mushroom-title-card
      title: '[[po_level]]'
      card_mod:
        style: |
          ha-card {
            .title {
                font-size: 20px;
                color: #6CB4EE;
                background-color: #505050;
                font-weight: bold;
                border: 1px solid white;
                padding: 3px;
                text-align: center;
            }
  po_league_title:
    card:
      type: custom:mushroom-title-card
      title: '[[po_league]]'
      card_mod:
        style: |
          ha-card {
            .title {
                font-size: 20px;
                color: #6CB4EE;
                font-weight: bold;
                border-bottom: 1px solid white;
                padding: 3px;
                margin: 1px;
            }
            border-radius: 5px!important;
            padding: 3px!important;
            margin: 1px!important;
          }
  po_game_title:
    card:
      type: custom:mushroom-title-card
      title: Game [[po_game]]
      alignment: center
      card_mod:
        style: |
          ha-card {
            .title {
                font-size: 20px;
                color: #6CB4EE;
                font-weight: bold;
            }
            padding: 3px!important;
            margin: 1px!important;
          }

  po_games:
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:stack-in-card
        mode: horizontal
      card_param: cards
      filter:
        template: >
          {% set ns = namespace(results=[], winner='', logo='', tmpl= '',
          name_info='',
            game_info='', tv_tmpl= '',dt_tm='', tv='TBD', weather='', ag='',odds='',
            winner_txt='',score_txt='',teams_txt='',wip_txt='') -%}

          {%- set po_teams = "[[playoff_teams]]" -%} {%- set po_schedule =
          "[[playoff_schedule]]" -%} {%- set gnum = "[[game_num]]" | int %} {%-
          set snum = "[[series_num]]" | int %} {%- set attr = "[[attribute]]"
          -%} {%- set sport = "[[sport]]" -%}

          {% set games = ['away', 'home'] -%}

          {% if sport == 'NFL' %}
            {%- set div_games = (state_attr(po_schedule, 'entries') |
              selectattr('seriesNumber','eq', snum) |  selectattr('gameNumber','eq',
              gnum) | list)[0] -%}
          {% else -%}
            {% set tmp_games = (state_attr(po_schedule, 'entries') | selectattr('seriesNumber','eq', snum) |
              selectattr('gameNumber','eq', gnum) | list) %}
            {% set last =  (tmp_games | count) - 1 %}
            {% set div_games = tmp_games[last] %}

            {% if div_games['home'] != div_games.home_advantage %}
              {% set games = ['home', 'away'] -%}
            {% endif %}
          {% endif %}

          {%- if div_games.seriesStatus == 'Final' -%}
              {%- set ns.winner = div_games.winner -%}
          {% endif -%}

          {% for team in games %}
            {%- set tday = as_local(now() ).strftime('%Y-%m-%d') %}
            {%- set time_now = as_local(now() ).strftime('%Y-%m-%d %H:%M:%S') %}
            {%- set game_day = div_games.date -%}
            {%- set game_time = div_games.gm_dte -%}
            {%- set team_name = div_games[team] -%}
            {%- set sense_nm = 'sensor.' + team_name | lower | replace(' ','_') -%}
            {%- set ns.logo = (state_attr(po_teams, attr) | selectattr('team.name','eq', team_name) |
              map(attribute='team.logo') | list)[0] -%}

            {%- if team_name == ns.winner -%}
              {%- set ns.tmpl = 'game_winner_btn' -%}
            {%- elif team_name == 'TBD' -%}
              {%- set sense_nm = po_teams -%}
              {%- set ns.logo = '/local/icons/sports/nfl.svg' %}
              {%- set ns.tmpl = 'nostat_btn' -%}
            {%- elif tday > game_day -%}
              {%- set ns.tmpl = 'nostat_btn' -%}
            {%- elif game_time < time_now -%}
              {%- set ns.tmpl = 'playing_btn' -%}
            {% else %}
            {%- endif -%}

            {%- set ns.results = ns.results + [{
                "type": "custom:button-card",
                "name": team_name,
                "entity": sense_nm,
                "layout": "name_state",
                "show_entity_picture": true,
                "entity_picture": ns.logo,
                "template": ns.tmpl,
                }]
              %}
          {%- endfor -%} {{ ns.results }}
   po_game_info:
    card:
      type: custom:auto-entities
      unique: true
      show_empty: true
      card:
        type: custom:stack-in-card
        mode: vertical
      card_param: cards
      filter:
        template: >
          {% set ns = namespace(results=[], winner='', logo='', tmpl= '',
            name_info='', game_info='', tv_tmpl= '',dt_tm='', tv='TBD',
            weather='', odds='', winner_txt='',score_txt='',teams_txt='',
            wip_txt='') -%}
          {%- set po_schedule = "[[playoff_schedule]]" -%}  {%- set tv_schedule
          = "[[tv_schedule]]" -%}

          {%- set gnum = "[[game_num]]" | int %}  {%- set snum =
          "[[series_num]]" | int %}           {%- set po_teams =
          "[[playoff_teams]]" -%} {%- set sport = "[[sport]]" -%}

          {%- set tv_games = state_attr(tv_schedule, 'entries') | list -%}

          {% if sport == 'NFL' %}
            {%- set div_games = (state_attr(po_schedule, 'entries') |
              selectattr('seriesNumber','eq', snum) |  selectattr('gameNumber','eq',
              gnum) | list)[0] -%}
          {% else -%}
            {% set tmp_games = (state_attr(po_schedule, 'entries') | selectattr('seriesNumber','eq', snum) |
              selectattr('gameNumber','eq', gnum) | list) %}
            {% set last =  (tmp_games | count) - 1 %}
            {% set div_games = tmp_games[last] %}
          {% endif %}

          {%- if div_games.seriesStatus == 'Final' -%}
              {%- set ns.winner = div_games.winner -%}
          {% endif -%}

          {%- set home_team = div_games.home -%}  {%- set away_team =
          div_games.away -%} {%- set tdaytm = as_local(now()
          ).strftime('%Y-%m-%d %H:%M:%S') %} {%- set tday = as_local(now()
          ).strftime('%Y-%m-%d') %}

          {%- if sport == 'NFL' -%}
            {%- set ns.winner_txt = "<span style='color: cyan; font-weight: bold;font-size:20px;'>{win}</span>" -%}
            {%- set ns.score_txt = "<br />Score: <span style='color: cyan; font-weight: bold;font-size:20px;'>{ascore}</span> vs <span style='color: cyan; font-weight: bold;font-size:20px;'>{home_score}</span>" -%}
            {%- set ns.teams_txt = "<span style='color: cyan; font-weight: bold;font-size:20px;'>{ateam} vs {hteam}</span>" -%}
            {%- set ns.wip_txt = "<span style='color: cyan; font-weight: bold;font-size:20px;'>{arec}</span>&nbsp;&nbsp; Regular Season &nbsp;&nbsp;<span style='color: cyan; font-weight: bold;font-size:20px;'>{hrec}</span><br />" -%}

            {%- if ns.winner == home_team or ns.winner == away_team -%}
              {%- set away_score = (div_games.away_score | string) -%}
              {%- set home_score = (div_games.home_score | string) -%}
              {%- set ns.name_info = ns.winner_txt.format(win=ns.winner) -%}
              {%- set ns.game_info = ns.score_txt.format(ascore=away_score, home_score=home_score) -%}
              {%- set ns.tmpl = "final_score_btn" -%}
            {%- elif home_team == 'TBD' and away_team == 'TBD' -%}
              {%- set ns.tmpl = "tbd_btn" -%}
            {%- elif home_team == 'TBD' or away_team == 'TBD' -%}
              {%- if home_team != 'TBD' -%}
                {%- set home_rec = (state_attr(po_teams, 'entries') |
                  selectattr('team.name','eq', home_team) | map(attribute='team.home_rec') | list)[0] -%}
                {%- set away_rec = 'TBD' -%}
              {% endif -%}
              {%- if away_team != 'TBD' -%}
                {%- set away_rec = (state_attr(po_teams, 'entries') |
                  selectattr('team.name','eq', away_team) | map(attribute='team.away_rec') | list)[0] -%}
                {%- set home_rec = 'TBD' -%}
              {% endif -%}

              {%- set ns.name_info = ns.teams_txt.format(ateam=away_team, hteam=home_team) -%}
              {%- set ns.game_info = ns.wip_txt.format(arec=away_rec,hrec=home_rec) -%}
              {%- set ns.tmpl = "tbd_btn" -%}
            {%- else -%}
              {%- set game_time = div_games.gm_dte -%}
              {%- set away_score = (div_games.away_score | string) -%}
              {%- set home_score = (div_games.home_score | string) -%}
              {%- set home_rec = (state_attr(po_teams, 'entries') |
                selectattr('team.name','eq', home_team) | map(attribute='team.home_rec') | list)[0] -%}
              {%- set away_rec = (state_attr(po_teams, 'entries') |
                selectattr('team.name','eq', away_team) | map(attribute='team.away_rec') | list)[0] -%}
              {%- set ns.name_info = ns.wip_txt.format(arec=away_rec,hrec=home_rec) -%}

              {% if (tday == div_games.date) and (game_time < tdaytm) -%}
                {% set ns.tmpl = "live_btn" -%}
                {%- set away_id = 'sensor.' + away_team | lower | replace(' ','_') -%}
                {%- set home_id = 'sensor.' + home_team | lower | replace(' ','_') -%}
                {%- set away_score = state_attr(away_id, 'team_score') -%}
                {%- set home_score = state_attr(home_id, 'team_score') -%}
                {%- set ns.game_info = ns.score_txt.format(ascore=away_score, home_score=home_score) -%}
              {%- else -%}
                {%- set ns.tmpl = "wip_btn" -%}
              {%- endif -%}
            {%- endif -%}
          {%- else -%}
            {%- set game_time = div_games.gm_dte -%}
            {%- set ns.winner_txt = "<span style='color: cyan; font-weight: bold;font-size:20px;'>{win}</span>" -%}
            {%- set ns.win_games_txt = "<br /><span style='color: cyan; font-weight: bold;font-size:20px;'>{agames}</span>&nbsp;&nbsp; games to &nbsp;&nbsp;<span style='color: cyan; font-weight: bold;font-size:20px;'>{hgames}</span>" -%}
            {%- set ns.score_txt = "<br />Live Score: <span style='color: cyan; font-weight: bold;font-size:20px;'>{ascore}</span>&nbsp;&nbsp;<span style='color: yellow; font-weight: bold;font-size:20px;'>Live</span>&nbsp;&nbsp;<span style='color: cyan; font-weight: bold;font-size:20px;'>{home_score}</span>" -%}
            {%- set ns.wip_txt = "<span style='color: cyan; font-weight: bold;font-size:20px;'>{arec}</span>&nbsp;&nbsp; Regular Season &nbsp;&nbsp;<span style='color: cyan; font-weight: bold;font-size:20px;'>{hrec}</span><br />" -%}

            {%- set ns.teams_txt = "<span style='color: cyan; font-weight: bold;font-size:20px;'>{ateam} vs {hteam}</span>" -%}

            {%- set away_score = (div_games.away_score | string) -%}
            {%- set home_score = (div_games.home_score | string) -%}
            {%- set home_rec = (state_attr(po_teams, 'entries') |
              selectattr('team.name','eq', home_team) | map(attribute='team.home_rec') | list)[0] -%}
            {%- set away_rec = (state_attr(po_teams, 'entries') |
              selectattr('team.name','eq', away_team) | map(attribute='team.away_rec') | list)[0] -%}
            {%- set ns.name_info = ns.wip_txt.format(arec=away_rec,hrec=home_rec) -%}
            {%- set away_wins = (div_games.away_wins | string) -%}
            {%- set home_wins = (div_games.home_wins | string) -%}
            {%- set ns.game_info = ns.win_games_txt.format(agames=away_wins, hgames=home_wins) -%}

            {%- if ns.winner != '' -%}
              {%- set ns.name_info = ns.winner_txt.format(win=ns.winner) -%}
              {%- set ns.tmpl = "final_score_btn" -%}
            {%- else -%}
              {% if (tday == div_games.date) and (game_time < tdaytm) -%}
                {% set ns.tmpl = "live_btn" -%}
                {%- set away_id = 'sensor.' + away_team | lower | replace(' ','_') -%}
                {%- set home_id = 'sensor.' + home_team | lower | replace(' ','_') -%}
                {%- set away_score = state_attr(away_id, 'team_score') -%}
                {%- set home_score = state_attr(home_id, 'team_score') -%}
                {%- set ns.game_info = ns.game_info + ns.score_txt.format(ascore=away_score, home_score=home_score) -%}
              {%- else -%}
                {%- set ns.tmpl = "wip_btn" -%}
              {%- endif -%}
            {%- endif -%}
          {%- endif -%}

          {%- if ns.tmpl == 'tbd_btn' -%}
            {%- set ns.results = ns.results + [{
                "type": "custom:button-card",
                "layout": "name_state",
                "label": ns.game_info,
                "template": ns.tmpl,
                }]
            -%}
          {%- elif ns.tmpl == 'wip_btn' -%}
            {%- set ns.results = ns.results + [{
                "type": "custom:button-card",
                "layout": "name_state",
                "name": ns.name_info,
                "label": ns.game_info,
                "template": ns.tmpl,
                }]
            -%}
          {%- else -%}
            {%- set ns.results = ns.results + [{
                "type": "custom:button-card",
                "layout": "name_state",
                "name": ns.name_info,
                "label": ns.game_info,
                "template": ns.tmpl,
                }]
            -%}
          {%- endif -%}

          {%- if ns.winner == '' -%}
            {%- set tv_txt = "<span style='color: cyan; font-weight: bold;font-size:20px;'>{tv} {dte}</span><br /><br />" -%}
            {%- set odds_txt = "<span style='color: cyan; font-weight: bold;font-size:16px;'>{odds}</span><br /><br />" -%}
            {%- set weather_txt = "<span style='color: orange; font-weight: bold; font-size:18px;'>Forecast: {weather}</span>" -%}
            {%- set game_time = div_games.gm_dte -%}

            {% if (tday == div_games.date) and (game_time < tdaytm) -%}
              {%- set ns.tmpl = "live_tv_btn" -%}
            {%- else -%}
              {%- set ns.tmpl = "tv_btn" -%}
            {%- endif -%}

            {%- set ns.dt_tm = " on " + div_games.dte -%}

            {% if div_games is search(home_team) -%}
              {%- set ns.odds = odds_txt.format(odds=div_games.odds) -%}
              {%- set ns.weather = weather_txt.format(weather=div_games.weather) -%}
            {%- endif -%}

            {% if tv_games is search(home_team) -%}
              {% set tmp_tv = (tv_games | selectattr('home','eq', home_team) |
                selectattr('gm_dte','eq', game_time) | map(attribute='tv') | list)[0] -%}
              {%- if tmp_tv is defined -%}
                {%- if tmp_tv is list -%}
                  {%- if tmp_tv | count != 0 -%}
                    {%- set ns.tv = tmp_tv[0] -%}
                  {%- endif -%}
                {%- else -%}
                  {%- set ns.tv = tmp_tv -%}
                {%- endif -%}
              {%- endif -%}
            {%- endif -%}

            {%- set tv_name = tv_txt.format(tv=ns.tv,dte=ns.dt_tm) -%}
            {%- set tv_label = ns.odds + ns.weather -%}

            {%- set ns.results = ns.results + [{
                "type": "custom:button-card",
                "layout": "name_state",
                "name": tv_name,
                "label": tv_label,
                "template": ns.tmpl,
                }]
            -%}
          {%- endif -%} {{ ns.results }}

Part 1 of 4

NFL

NFL - Groups

nfl_teams:
  name: nfl_teams
  entities:
    - sensor.arizona_cardinals
    - sensor.atlanta_falcons
    - sensor.baltimore_ravens
    - sensor.buffalo_bills
    - sensor.carolina_panthers
    - sensor.chicago_bears
    - sensor.cincinnati_bengals
    - sensor.cleveland_browns
    - sensor.dallas_cowboys
    - sensor.denver_broncos
    - sensor.detroit_lions
    - sensor.green_bay_packers
    - sensor.houston_texans
    - sensor.indianapolis_colts
    - sensor.jacksonville_jaguars
    - sensor.kansas_city_chiefs
    - sensor.las_vegas_raiders
    - sensor.los_angeles_chargers
    - sensor.los_angeles_rams
    - sensor.miami_dolphins
    - sensor.minnesota_vikings
    - sensor.new_england_patriots
    - sensor.new_orleans_saints
    - sensor.new_york_giants
    - sensor.new_york_jets
    - sensor.philadelphia_eagles
    - sensor.pittsburg_steelers
    - sensor.san_francisco_49ers
    - sensor.seattle_seahawks
    - sensor.tampa_bay_buccaneers
    - sensor.tennessee_titans
    - sensor.washington_commanders

nfl_al_teams:
  name: nfl_al_teams
  entities:
    - sensor.baltimore_ravens
    - sensor.buffalo_bills
    - sensor.cincinnati_bengals
    - sensor.cleveland_browns
    - sensor.denver_broncos
    - sensor.houston_texans
    - sensor.indianapolis_colts
    - sensor.jacksonville_jaguars
    - sensor.kansas_city_chiefs
    - sensor.las_vegas_raiders
    - sensor.los_angeles_chargers
    - sensor.miami_dolphins
    - sensor.new_england_patriots
    - sensor.new_york_jets
    - sensor.pittsburg_steelers
    - sensor.tennessee_titans

nfl_nl_teams:
  name: nfl_nl_teams
  entities:
    - sensor.arizona_cardinals
    - sensor.atlanta_falcons
    - sensor.carolina_panthers
    - sensor.chicago_bears
    - sensor.dallas_cowboys
    - sensor.detroit_lions
    - sensor.green_bay_packers
    - sensor.los_angeles_rams
    - sensor.minnesota_vikings
    - sensor.new_orleans_saints
    - sensor.new_york_giants
    - sensor.philadelphia_eagles
    - sensor.san_francisco_49ers
    - sensor.seattle_seahawks
    - sensor.tampa_bay_buccaneers
    - sensor.washington_commanders

NFL - REST sensors

##
## Wildcards
##
- resource: https://site.web.api.espn.com/apis/v2/sports/football/nfl/standings?region=us&lang=en&contentorigin=espn&type=3&level=2&sort=playoffseed%3Aasc%2Cpoints%3Adesc%2Cgamesplayed%3Aasc%2Crotwins%3Adesc&seasontype=2
  # every 10 hours
  scan_interval: 36000
  sensor:
    - name: "NFL Wildcard"
      unique_id: nfl_wildcard
      icon: mdi:baseball
      json_attributes:
        - children
        - overall
      value_template: "{{ now() }}"

##
## Playoff Standings
##
- resource: https://site.web.api.espn.com/apis/v2/sports/football/nfl/standings?region=us&lang=en&contentorigin=espn&type=3&level=3&sort=playoffseed:asc,points:desc,gamesplayed:asc,rotwins:desc&seasontype=2
  # every 10 hours
  scan_interval: 36000
  sensor:
    - name: "NFL PO Standings"
      unique_id: nfl_po_standings
      icon: mdi:football
      json_attributes:
        - children
        - overall
      value_template: "{{ now() }}"
##
## Playoff Standings- Postseason
##
- resource_template: "https://site.api.espn.com/apis/site/v2/sports/football/nfl/scoreboard?limit=1000&dates={{ now().year }}"
  # every 10 hours
  scan_interval: 36000
  sensor:
    - name: "NFL Standings Postseason"
      unique_id: nfl_standings_postseason
      json_attributes:
        - leagues
        - events
      value_template: "{{ now() }}"

##
## Schedule
##
- resource: https://site.api.espn.com/apis/site/v2/sports/football/nfl/scoreboard
  # every 24 hours
  scan_interval: 86400
  sensor:
    - name: "NFL Schedule"
      unique_id: nfl_schedule
      icon: mdi:football
      json_attributes:
        - events
      value_template: "{{ now() }}"

NFL - Template Sensors

###
### TV Coverage
###
- sensor:
    - name: NFL PO TV Coverage
      unique_id: nfl_po_tv_coverage
      device_class: timestamp
      icon: mdi:baseball
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set ns = namespace(results=[], tv_channels=[], game_ctr=0, ctr=0, home='', away='') -%}
          {%- set po_tv = state_attr("sensor.nfl_schedule", 'events') | list %}
          {% for po_tv_sched in po_tv %}
            {%- set ns.tv_channels = [] -%}
            {% for game in po_tv_sched['competitions'] %}
              {% set gm_dte = as_local(as_datetime(game.startDate)).strftime('%Y-%m-%d %H:%M:%S') %}
              {% set game_dte =  as_local(as_datetime(game.startDate)).strftime('%b %d') %}
              {% set game_time =  as_local(as_datetime(game.startDate)).strftime('%I:%M %p') %}
              {% for channel in game['broadcasts'] %}
                {%- set ns.tv_channels = ns.tv_channels + [channel.names[0]] -%}
              {% endfor -%}

              {%- set ns.ctr = 0 %}
              {% for team in game['competitors'] %}
                {%- if team.homeAway == 'home' %}
                  {%- set ns.home = team.team.displayName %}
                {% else -%}
                  {%- set ns.away = team.team.displayName %}
                {% endif -%}

                {%- if ns.ctr == 1 %}
                  {% set ns.results = ns.results + [{'date': game_dte, 'time': game_time, 'home': ns.home, 'away': ns.away, 'tv': ns.tv_channels, 'gm_dte': gm_dte}] %}
                {% endif -%}
                {%- set ns.ctr = ns.ctr + 1 %}
              {% endfor -%}
            {%- set ns.game_ctr = ns.game_ctr + 1 %}
            {%- endfor -%}
          {%- endfor -%}
          {{ ns.results }}

###
### National Football League
###
###
### Obtain Playoff Seeds, Playoff Games by League, and Teams by "Bracket" (WildCard, Division, League, "World")
###

###
### Wildcards - Used in Playoffs Tab to Forecast until the Playoff season starts
###
- sensor:
    - name: NFL Wildcard Standings
      unique_id: sensor.nfl_wildcard_standings
      state: "{{ now() }}"
      attributes:
        nfl_afc_east_top: "{{ state_attr('sensor.nfl_po_standings','children')[0]['standings']['entries'][:1] }}"
        nfl_afc_north_top: "{{ state_attr('sensor.nfl_po_standings','children')[0]['children'][1]['standings']['entries'][:1] }}"
        nfl_afc_south_top: "{{ state_attr('sensor.nfl_po_standings','children')[0]['children'][2]['standings']['entries'][:1] }}"
        nfl_afc_west_top: "{{ state_attr('sensor.nfl_po_standings','children')[0]['children'][3]['standings']['entries'][:1] }}"
        nfl_afc_wc: >
          {% set afc_east_top = state_attr('sensor.nfl_po_standings','children')[0]['children'][0]['standings']['entries'] %}
          {% set afc_north_top = state_attr('sensor.nfl_po_standings','children')[0]['children'][1]['standings']['entries'] %}
          {% set afc_south_top = state_attr('sensor.nfl_po_standings','children')[0]['children'][2]['standings']['entries'] %}
          {% set afc_west_top = state_attr('sensor.nfl_po_standings','children')[0]['children'][3]['standings']['entries'] %}
          {% set afc_east_name = afc_east_top[:1][0].team.displayName %}
          {% set afc_north_name = afc_north_top[:1][0].team.displayName %}
          {% set afc_south_name = afc_south_top[:1][0].team.displayName %}
          {% set afc_west_name = afc_west_top[:1][0].team.displayName %}
          {% set amer_all = state_attr('sensor.nfl_wildcard','children')[0]['standings']['entries'] %}
          {% set afc_wc = amer_all |
            rejectattr('team.displayName', 'eq', afc_east_name) |
            rejectattr('team.displayName', 'eq', afc_north_name) |
            rejectattr('team.displayName', 'eq', afc_south_name) |
            rejectattr('team.displayName', 'eq', afc_west_name) | list  %}
          {{ afc_wc[:3] }}
        nfl_afc_hunt: >
          {% set afc_east_top = state_attr('sensor.nfl_po_standings','children')[0]['children'][0]['standings']['entries'] %}
          {% set afc_north_top = state_attr('sensor.nfl_po_standings','children')[0]['children'][1]['standings']['entries'] %}
          {% set afc_south_top = state_attr('sensor.nfl_po_standings','children')[0]['children'][2]['standings']['entries'] %}
          {% set afc_west_top = state_attr('sensor.nfl_po_standings','children')[0]['children'][3]['standings']['entries'] %}
          {% set afc_east_name = afc_east_top[:1][0].team.displayName %}
          {% set afc_north_name = afc_north_top[:1][0].team.displayName %}
          {% set afc_south_name = afc_south_top[:1][0].team.displayName %}
          {% set afc_west_name = afc_west_top[:1][0].team.displayName %}
          {% set amer_all = state_attr('sensor.nfl_wildcard','children')[0]['standings']['entries'] %}

          {% set amer_wc = amer_all |
            rejectattr('team.displayName', 'eq', afc_east_name) |
            rejectattr('team.displayName', 'eq', afc_north_name) |
            rejectattr('team.displayName', 'eq', afc_south_name) |
            rejectattr('team.displayName', 'eq', afc_west_name) | list  %}
          {% set wc = amer_wc[:3] %}
          {% set wc_east_one_name = wc[0].team.displayName %}
          {% set wc_east_two_name = wc[1].team.displayName %}
          {% set wc_east_three_name = wc[2].team.displayName %}
          {% set amer_hunt = amer_all |
            rejectattr('team.displayName', 'eq', afc_east_name) |
            rejectattr('team.displayName', 'eq', afc_north_name) |
            rejectattr('team.displayName', 'eq', afc_south_name) |
            rejectattr('team.displayName', 'eq', afc_west_name) |
            rejectattr('team.displayName', 'eq', wc_east_one_name) |
            rejectattr('team.displayName', 'eq', wc_east_two_name) |
            rejectattr('team.displayName', 'eq', wc_east_three_name) | list  %}
          {{ amer_hunt[:2] }}
        nfl_afc_eliminated: >
          {%- set wc_teams = state_attr('sensor.nfl_wildcard','children')[0]['standings']['entries'] |
              sort(attribute="stats.playoffSeed") -%}
          {{ wc_teams[9:] }}
        nfl_nfc_east_top: "{{ state_attr('sensor.nfl_po_standings','children')[1]['children'][0]['standings']['entries'][:1] }}"
        nfl_nfc_north_top: "{{ state_attr('sensor.nfl_po_standings','children')[1]['children'][1]['standings']['entries'][:1] }}"
        nfl_nfc_south_top: "{{ state_attr('sensor.nfl_po_standings','children')[1]['children'][2]['standings']['entries'][:1] }}"
        nfl_nfc_west_top: "{{ state_attr('sensor.nfl_po_standings','children')[1]['children'][3]['standings']['entries'][:1] }}"
        nfl_nfc_wc: >
          {% set nfc_east_top = state_attr('sensor.nfl_po_standings','children')[1]['children'][0]['standings']['entries'] %}
          {% set nfc_north_top = state_attr('sensor.nfl_po_standings','children')[1]['children'][1]['standings']['entries'] %}
          {% set nfc_south_top = state_attr('sensor.nfl_po_standings','children')[1]['children'][2]['standings']['entries'] %}
          {% set nfc_west_top = state_attr('sensor.nfl_po_standings','children')[1]['children'][3]['standings']['entries'] %}
          {% set nfc_east_name = nfc_east_top[:1][0].team.displayName %}
          {% set nfc_north_name = nfc_north_top[:1][0].team.displayName %}
          {% set nfc_south_name = nfc_south_top[:1][0].team.displayName %}
          {% set nfc_west_name = nfc_west_top[:1][0].team.displayName %}
          {% set amer_all = state_attr('sensor.nfl_wildcard','children')[1]['standings']['entries'] %}
          {% set nfc_wc = amer_all |
            rejectattr('team.displayName', 'eq', nfc_east_name) |
            rejectattr('team.displayName', 'eq', nfc_north_name) |
            rejectattr('team.displayName', 'eq', nfc_south_name) |
            rejectattr('team.displayName', 'eq', nfc_west_name) | list  %}
          {{ nfc_wc[:3] }}
        nfl_nfc_hunt: >
          {% set nfc_east_top = state_attr('sensor.nfl_po_standings','children')[1]['children'][0]['standings']['entries'] %}
          {% set nfc_north_top = state_attr('sensor.nfl_po_standings','children')[1]['children'][1]['standings']['entries'] %}
          {% set nfc_south_top = state_attr('sensor.nfl_po_standings','children')[1]['children'][2]['standings']['entries'] %}
          {% set nfc_west_top = state_attr('sensor.nfl_po_standings','children')[1]['children'][3]['standings']['entries'] %}
          {% set nfc_east_name = nfc_east_top[:1][0].team.displayName %}
          {% set nfc_north_name = nfc_north_top[:1][0].team.displayName %}
          {% set nfc_south_name = nfc_south_top[:1][0].team.displayName %}
          {% set nfc_west_name = nfc_west_top[:1][0].team.displayName %}
          {% set amer_all = state_attr('sensor.nfl_wildcard','children')[1]['standings']['entries'] %}

          {% set amer_wc = amer_all |
            rejectattr('team.displayName', 'eq', nfc_east_name) |
            rejectattr('team.displayName', 'eq', nfc_north_name) |
            rejectattr('team.displayName', 'eq', nfc_south_name) |
            rejectattr('team.displayName', 'eq', nfc_west_name) | list  %}
          {% set wc = amer_wc[:3] %}
          {% set wc_east_one_name = wc[0].team.displayName %}
          {% set wc_east_two_name = wc[1].team.displayName %}
          {% set wc_east_three_name = wc[2].team.displayName %}
          {% set amer_hunt = amer_all |
            rejectattr('team.displayName', 'eq', nfc_east_name) |
            rejectattr('team.displayName', 'eq', nfc_north_name) |
            rejectattr('team.displayName', 'eq', nfc_south_name) |
            rejectattr('team.displayName', 'eq', nfc_west_name) |
            rejectattr('team.displayName', 'eq', wc_east_one_name) |
            rejectattr('team.displayName', 'eq', wc_east_two_name) |
            rejectattr('team.displayName', 'eq', wc_east_three_name) | list  %}
          {{ amer_hunt[:2] }}
        nfl_nfc_eliminated: >
          {%- set wc_teams = state_attr('sensor.nfl_wildcard','children')[1]['standings']['entries'] |
              sort(attribute="stats.playoffSeed") -%}
          {{ wc_teams[9:] }}
        entries: >
          {%- set ns = namespace(ateams=[],nteams=[],afce_team=[],nfce_team=[],results=[]) -%}
          {%- set elim_def = 'Eliminated from Playoff Contention' -%}
          {%- set al_dict = {'league':'AL'} -%}
          {%- set nl_dict = {'league':'NL'} -%}

          {%- set ns.ateams = ns.ateams + state_attr('sensor.nfl_standings','children')[0]['children'][0]['standings']['entries'] -%}
          {%- set ns.ateams = ns.ateams + state_attr('sensor.nfl_standings','children')[0]['children'][1]['standings']['entries'] -%}
          {%- set ns.ateams = ns.ateams + state_attr('sensor.nfl_standings','children')[0]['children'][2]['standings']['entries'] -%}
          {%- set ns.ateams = ns.ateams + state_attr('sensor.nfl_standings','children')[0]['children'][3]['standings']['entries'] -%}

          {% set ns.nteams = ns.nteams + state_attr('sensor.nfl_standings','children')[1]['children'][0]['standings']['entries'] %}
          {% set ns.nteams = ns.nteams + state_attr('sensor.nfl_standings','children')[1]['children'][1]['standings']['entries'] %}
          {% set ns.nteams = ns.nteams + state_attr('sensor.nfl_standings','children')[1]['children'][2]['standings']['entries'] %}
          {% set ns.nteams = ns.nteams + state_attr('sensor.nfl_standings','children')[1]['children'][3]['standings']['entries'] %}

          {%- for team in ns.ateams -%}
            {%- set po_stat = team.stats | selectattr('name','eq','clincher') | map(attribute='description') | list -%}
            {%- if po_stat[0] != elim_def -%}
              {%- set rec_dict = dict(team.items(), **al_dict) -%}
              {%- set ns.afce_team = ns.afce_team + [rec_dict] -%}
            {%- endif -%}
          {%- endfor -%}

          {%- for team in ns.nteams -%}
            {%- set po_stat = team.stats | selectattr('name','eq','clincher') | map(attribute='description') | list -%}
            {%- if po_stat[0] != elim_def -%}
              {%- set rec_dict = dict(team.items(), **nl_dict) -%}
              {%- set ns.nfce_team = ns.nfce_team + [rec_dict] -%}
            {%- endif %}
          {%- endfor %}
          {%- set tmp_teams = ns.afce_team + ns.nfce_team -%}
          {{ tmp_teams }}

# ###
# ### Playoffs Seeds
# ###
- sensor:
    - name: NFL Playoff Seeds
      unique_id: sensor.nfl_playoff_seeds
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set ns = namespace(results=[], tmp_recs=[]) -%}
          {%- for team in state_attr('sensor.nfl_wildcard_standings', 'entries') -%}
            {%- set position = team.stats | selectattr('name','eq','clincher') | map(attribute='description') | list -%}
            {%- set home_rec = team.stats | selectattr('name','eq','Home') | map(attribute='displayValue') | list -%}
            {%- set away_rec = team.stats | selectattr('name','eq','Road') | map(attribute='displayValue') | list -%}
            {%- set seed_val = team.stats | selectattr('name','eq','playoffSeed') | map(attribute='value') | list -%}
            {%- set seed = seed_val[0] | int  -%}
            {%- set logo = team.team.logos[0].href -%}
            {%- set ns.results = ns.results + [{ 'team': {'name': team.team.displayName, 'league':team.league, 'seed': seed,
              'po_status': position[0],'home_rec': home_rec[0], 'away_rec': away_rec[0],'logo': logo}}] -%}
          {%- endfor -%}
          {%- set ns.tmp_recs = ns.results | sort(attribute='team.league,team.seed') -%}
          {{ ns.tmp_recs }}
        po_amer_wc_seeds: >
          {%- set ns = namespace(results=[], amer_result=[], ctr=0) -%}
          {%- for team in state_attr('sensor.nfl_wildcard_standings', 'entries') | selectattr('league','eq','AL') | list -%}
            {%- set position = team.stats | selectattr('name','eq','clincher') | map(attribute='description') | list -%}
            {%- set home_rec = team.stats | selectattr('name','eq','Home') | map(attribute='displayValue') | list -%}
            {%- set away_rec = team.stats | selectattr('name','eq','Road') | map(attribute='displayValue') | list -%}
            {%- set seed_val = team.stats | selectattr('name','eq','playoffSeed') | map(attribute='value') | list -%}
            {%- set seed = seed_val[0] | int  -%}
            {%- set logo = team.team.logos[0].href -%}
            {%- set ns.results = ns.results + [{ 'team': {'name': team.team.displayName, 'league': team.league,
              'seed': seed, 'po_status': position[0], 'home_rec': home_rec[0], 'away_rec': away_rec[0],
              'logo': logo}}] -%}
          {%- endfor -%}
          {% set ns.amer_result = ns.results | sort(attribute='team.seed') %}
          {{ ns.amer_result }}
        po_natl_wc_seeds: >
          {%- set ns = namespace(results=[], natl_result=[], ctr=0) -%}
          {%- for team in state_attr('sensor.nfl_wildcard_standings', 'entries') | selectattr('league','eq','NL') | list -%}
            {%- set position = team.stats | selectattr('name','eq','clincher') | map(attribute='description') | list -%}
            {%- set home_rec = team.stats | selectattr('name','eq','Home') | map(attribute='displayValue') | list -%}
            {%- set away_rec = team.stats | selectattr('name','eq','Road') | map(attribute='displayValue') | list -%}
            {%- set seed_val = team.stats | selectattr('name','eq','playoffSeed') | map(attribute='value') | list -%}
            {%- set seed = seed_val[0] | int  -%}
            {%- set logo = team.team.logos[0].href -%}
            {%- set ns.results = ns.results + [{ 'team': {'name': team.team.displayName, 'league': team.league,
              'seed': seed, 'po_status': position[0], 'home_rec': home_rec[0], 'away_rec': away_rec[0],
              'logo': logo}}] -%}
          {%- endfor -%}
          {% set ns.natl_result = ns.results | sort(attribute='team.seed') %}
          {{ ns.natl_result }}

###
### Playoffs - Games
###
- sensor:
    - name: NFL PO Games
      unique_id: sensor.nfl_po_games
      device_class: timestamp
      icon: mdi:football
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set ns = namespace(results=[],sorted=[],gtype='',leag='',agctr=1,nlctr=1,gctr=1,ser_gm=1,tv='',weather='',odds='',hscore=0,ascore=0,winner='') -%}
          {%- set po_schedule = state_attr("sensor.nfl_standings_postseason", 'events') -%}
          {%- set po_sched_teams = po_schedule | selectattr('season.slug','eq','post-season') | sort(attribute='date') | list -%}
          {%- set tday = as_local(now()).strftime('%Y-%m-%d') -%}
          {%- set seeds = 'sensor.nfl_playoff_seeds' -%}
          {%- set al_teams =  expand('group.nfl_al_teams') | map(attribute='attributes.friendly_name') | list -%}
          {%- set nl_teams =  expand('group.nfl_nl_teams') | map(attribute='attributes.friendly_name') | list -%}
          {%- set tmp_teams = ['TBD','AFC','NFC'] -%}

          {% for evt in po_sched_teams -%}
            {% if evt.competitions[0].notes[0].headline is search('Pro Bowl') %}
              {%- continue -%}
            {%- else -%}
              {%- set game_dte = '{}'.format(evt.competitions[0].date) | as_datetime | as_timestamp | timestamp_custom('%b %d at %I:%M %p') -%}
              {%- set game_day = as_local(as_datetime(evt.competitions[0].date)).strftime('%Y-%m-%d') -%}
              {%- set gm_dte = as_local(as_datetime(evt.competitions[0].date)).strftime('%Y-%m-%d %H:%M:%S') -%}
              {% if evt.competitions[0].notes[0].headline is search('Super Bowl') %}
                {%- set ns.gtype = 'Super Bowl' -%}
                {%- set ns.series = 4 -%}
              {%- elif evt.competitions[0].notes[0].headline is search('Championship') -%}
                {%- set ns.gtype = 'Championship' -%}
                {%- set ns.series = 3 -%}
              {%- elif evt.competitions[0].notes[0].headline is search('Divisional Playoffs') -%}
                {%- set ns.gtype = 'Divisional Playoffs' -%}
                {%- set ns.series = 2 -%}
              {%- else -%}
                {%- set ns.gtype = 'Wild Card' -%}
                {%- set ns.series = 1 -%}
              {%- endif -%}

              {% if evt.competitions[0].broadcasts | length != 0 %}
                {%- set ns.tv = evt.competitions[0].broadcasts[0].names[0] -%}
              {%- else -%}
                {%- set ns.tv = 'N/A' -%}
              {%- endif -%}

              {%- if game_day == tday %}
                {%- set ns.stat = 'Ongoing' -%}
              {%- elif game_day <= tday %}
                {%- set ns.stat = 'Final' -%}
              {%- else -%}
                {%- set ns.stat = 'Ongoing' -%}
              {% endif %}

              {% if evt.weather is defined %}
                {%- set ns.weather = evt.weather.displayValue + " " + (evt.weather.temperature | string) -%}
              {%- else -%}
                {%- set ns.weather = '' -%}
              {% endif %}

              {% for game in evt.competitions -%}
                {%- if game.odds is defined -%}
                  {%- set ns.odds = game.odds[0].provider.name +": "+ game.odds[0].details +" OverUnder: "+ (game.odds[0].overUnder  | string) + " Spread: "+ (game.odds[0].spread | string)-%}
                {%- else -%}
                  {%- set ns.odds = 'N/A' -%}
                {%- endif -%}

                {%- set ns.winner = '' -%}
                {%- for team in game['competitors'] -%}
                    {%- set team_name = team.team.displayName -%}
                    {%- if team.homeAway == 'home' -%}
                      {%- if team_name in tmp_teams -%}
                        {%- set ns.home = 'TBD' -%}
                      {%- else -%}
                        {% set ns.home = team_name -%}

                        {%- if ns.stat == 'Final' and team.score is defined -%}
                          {%- set ns.hscore = team.score | int -%}
                        {%- else -%}
                          {%- set ns.hscore = 0 -%}
                        {%- endif -%}
                      {%- endif -%}
                    {%- else -%}
                      {%- if team_name in tmp_teams -%}
                        {%- set ns.away = 'TBD' -%}
                      {%- else -%}
                        {%- set ns.away = team_name -%}

                        {%- if ns.stat == 'Final' and team.score is defined -%}
                          {%- set ns.ascore = team.score | int -%}
                        {%- else -%}
                          {%- set ns.ascore = 0 -%}
                        {%- endif -%}
                      {%- endif -%}
                    {%- endif -%}

                    {%- if team_name in tmp_teams and evt.competitions[0].notes[0].headline is search('AFC Championship') %}
                        {%- set ns.leag = 'AL' -%}
                    {% elif  team_name in tmp_teams and evt.competitions[0].notes[0].headline is search('NFC Championship') %}
                        {%- set ns.leag = 'NL' -%}
                    {%- else -%}
                      {%- if team_name in al_teams -%}
                        {%- set ns.leag = 'AL' -%}
                      {%- elif team_name in nl_teams -%}
                        {%- set ns.leag = 'NL' -%}
                      {%- else -%}
                        {%- continue -%}
                      {%- endif -%}
                    {%- endif -%}
                {% endfor -%}

                {%- if ns.stat == 'Final' -%}
                  {%- if ns.hscore > ns.ascore -%}
                    {%- set ns.winner = ns.home -%}
                    {%- set ns.loser = ns.away -%}
                  {%- else -%}
                    {%- set ns.winner = ns.away -%}
                    {%- set ns.loser = ns.home -%}
                  {%- endif -%}
                {%- else -%}
                  {%- set ns.winner = '' -%}
                  {%- set ns.loser = '' -%}
                {%- endif -%}

                {%- if ns.leag == 'AL' -%}
                  {%- set ns.gctr = ns.agctr -%}
                  {%- set ns.agctr = ns.agctr + 1 -%}
                {%- elif ns.leag == 'NL' -%}
                  {%- set ns.gctr = ns.nlctr -%}
                  {%- set ns.nlctr = ns.nlctr + 1 -%}
                {%- else -%}
                  {%- continue -%}
                {%- endif -%}

                {%- set ns.results = ns.results + [{'date': game_day,'dte': game_dte,'Game': ns.gtype,'seriesStatus': ns.stat,'league': ns.leag,
                  'gm_dte': gm_dte, 'winner': ns.winner,'loser': ns.loser,'home': ns.home,'away': ns.away,'home_score': ns.hscore,'away_score': ns.ascore,
                  'seriesNumber': ns.series, 'gameNumber': ns.gctr, 'gamesInSeries': "1", 'seriesGameNumber':"1",'odds':ns.odds,'weather':ns.weather}] -%}
              {%- endfor -%}
            {%- endif -%}
          {% endfor -%}
          {{ ns.results }}

- sensor:
    - name: NFL PO Amer Games
      unique_id: sensor.nfl_po_amer_games
      device_class: timestamp
      icon: mdi:football
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set po_schedule = state_attr("sensor.nfl_po_games", 'entries') -%}
          {%- set po_sched_teams = po_schedule | selectattr('league','eq','AL') | list -%}
          {{ po_sched_teams }}

- sensor:
    - name: NFL PO Natl Games
      unique_id: sensor.nfl_po_natl_games
      device_class: timestamp
      icon: mdi:football
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set po_schedule = state_attr("sensor.nfl_po_games", 'entries') -%}
          {%- set po_sched_teams = po_schedule | selectattr('league','eq','NL') | list -%}
          {{ po_sched_teams }}

###
### Playoffs - Wildcard Games
###
- sensor:
    - name: NFL PO Amer WC Games
      unique_id: sensor.nfl_po_amer_wc_games
      device_class: timestamp
      icon: mdi:baseball
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set po_schedule = state_attr("sensor.nfl_po_amer_games", 'entries') -%}
          {%- set po_sched_teams = po_schedule | selectattr('league','eq','AL') | list -%}
          {{ po_sched_teams }}

- sensor:
    - name: NFL PO Natl WC Games
      unique_id: sensor.nfl_po_natl_wc_games
      device_class: timestamp
      icon: mdi:baseball
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set po_schedule = state_attr("sensor.nfl_po_natl_games", 'entries') -%}
          {%- set po_sched_teams = po_schedule | selectattr('league','eq','NL') | list -%}
          {{ po_sched_teams }}

###
### Playoffs - Division Games
###
- sensor:
    - name: NFL PO Amer Div Games
      unique_id: sensor.nfl_po_amer_div_games
      device_class: timestamp
      icon: mdi:football
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set po_sched_teams = state_attr("sensor.nfl_po_amer_games", 'entries') -%}
          {%- set results = po_sched_teams | selectattr('Game','eq', 'Divisional Playoffs') | list %}
          {{ results }}

- sensor:
    - name: NFL PO Natl Div Games
      unique_id: sensor.nfl_po_natl_div_games
      device_class: timestamp
      icon: mdi:football
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set po_sched_teams = state_attr("sensor.nfl_po_natl_games", 'entries') -%}
          {%- set results = po_sched_teams | selectattr('Game','eq', 'Divisional Playoffs') | list %}
          {{ results }}

###
### Playoffs - League Games
###
- sensor:
    - name: NFL PO Amer Leag Games
      unique_id: nfl_po_amer_leag_games
      device_class: timestamp
      icon: mdi:football
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set po_sched_teams = state_attr("sensor.nfl_po_amer_games", 'entries') -%}
          {%- set results = po_sched_teams | selectattr('Game','eq', 'Championship') | list %}
          {{ results }}

- sensor:
    - name: NFL PO Natl Leag Games
      unique_id: nfl_po_natl_leag_games
      device_class: timestamp
      icon: mdi:football
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set po_sched_teams = state_attr("sensor.nfl_po_natl_games" , 'entries') -%}
          {%- set results = po_sched_teams | selectattr('Game','eq', 'Championship') | list %}
          {{ results }}

###
### Playoffs - World Game
###
- sensor:
    - name: NFL PO World Game
      unique_id: nfl_po_world_game
      device_class: timestamp
      icon: mdi:football
      state: "{{ now() }}"
      attributes:
        entries: >
          {%- set po_sched_teams = state_attr("sensor.nfl_po_games" , 'entries') -%}
          {%- set results = po_sched_teams | selectattr('Game','eq', 'Super Bowl') | list %}
          {{ results }}

Part 2.1 of 4 (dashboard would not fit)

NFL - Dashboard Code

type: custom:layout-card
layout_type: grid
layout:
    grid-template-columns: 25% 25% 25% 25%
    grid-template-rows: auto
    grid-template-areas: |
    "col1 col2 col3 col4"
    mediaquery:
    '(max-width: 450px)':
        grid-template-columns: 100%
        grid-template-areas: |
        "col1"
        "col2"
        "col3"
        "col4"
    '(max-width: 1200px)':
        grid-template-columns: 50% 50%
        grid-template-areas: |
        "col1 col2"
        "col3 col4"
cards:
    - type: vertical-stack
    cards:
        - type: custom:decluttering-card
        template: po_level_title
        variables:
            - sport: NFL
            - po_level: Wild Card
        - type: custom:decluttering-card
        template: po_league_title
        variables:
            - sport: NFL
            - po_league: American
        - type: custom:decluttering-card
        template: po_game_title
        variables:
            - sport: NFL
            - po_game: 1
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: AL
                - game_num: 1
                - series_num: 1
                - attribute: po_amer_wc_seeds
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_amer_wc_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: AL
            - game_num: 1
            - series_num: 1
            - attribute: po_amer_wc_seeds
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_amer_wc_games
            - tv_schedule: sensor.nfl_po_tv_coverage
        - type: custom:decluttering-card
        template: po_game_title
        variables:
            - sport: NFL
            - po_game: 2
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: AL
                - game_num: 2
                - series_num: 1
                - attribute: po_amer_wc_seeds
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_amer_wc_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: AL
            - game_num: 2
            - series_num: 1
            - attribute: po_amer_wc_seeds
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_amer_wc_games
            - tv_schedule: sensor.nfl_po_tv_coverage
        - type: custom:decluttering-card
        template: po_game_title
        variables:
            - sport: NFL
            - po_game: 3
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: AL
                - game_num: 3
                - series_num: 1
                - attribute: po_amer_wc_seeds
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_amer_wc_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: AL
            - game_num: 3
            - series_num: 1
            - attribute: po_amer_wc_seeds
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_amer_wc_games
            - tv_schedule: sensor.nfl_po_tv_coverage
        - type: custom:decluttering-card
        template: po_league_title
        variables:
            - sport: NFL
            - po_league: National
        - type: custom:decluttering-card
        template: po_game_title
        variables:
            - sport: NFL
            - po_game: 1
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: NL
                - game_num: 1
                - series_num: 1
                - attribute: po_natl_wc_seeds
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_natl_wc_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: NL
            - game_num: 1
            - series_num: 1
            - attribute: po_natl_wc_seeds
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_natl_wc_games
            - tv_schedule: sensor.nfl_po_tv_coverage
        - type: custom:decluttering-card
        template: po_game_title
        variables:
            - sport: NFL
            - po_game: 2
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: NL
                - game_num: 2
                - series_num: 1
                - attribute: po_natl_wc_seeds
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_natl_wc_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: NL
            - game_num: 2
            - series_num: 1
            - attribute: po_natl_wc_seeds
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_natl_wc_games
            - tv_schedule: sensor.nfl_po_tv_coverage
        - type: custom:decluttering-card
        template: po_game_title
        variables:
            - sport: NFL
            - po_game: 3
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: NL
                - game_num: 3
                - series_num: 1
                - attribute: po_natl_wc_seeds
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_natl_wc_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: NL
            - game_num: 3
            - series_num: 1
            - attribute: po_natl_wc_seeds
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_natl_wc_games
            - tv_schedule: sensor.nfl_po_tv_coverage
    view_layout:
        grid-area: col1
        show: always
    - type: vertical-stack
    cards:
        - type: custom:decluttering-card
        template: po_level_title
        variables:
            - sport: NFL
            - po_level: Division
        - type: custom:decluttering-card
        template: po_league_title
        variables:
            - sport: NFL
            - po_league: American
        - type: custom:decluttering-card
        template: po_game_title
        variables:
            - sport: NFL
            - po_game: 1
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: AL
                - game_num: 4
                - series_num: 2
                - attribute: entries
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_amer_div_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: AL
            - game_num: 4
            - series_num: 2
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_amer_div_games
            - tv_schedule: sensor.nfl_po_tv_coverage
        - type: custom:decluttering-card
        template: po_game_title
        variables:
            - sport: NFL
            - po_game: 2
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: AL
                - game_num: 5
                - series_num: 2
                - attribute: entries
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_amer_div_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: AL
            - game_num: 5
            - series_num: 2
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_amer_div_games
            - tv_schedule: sensor.nfl_po_tv_coverage
        - type: custom:decluttering-card
        template: po_league_title
        variables:
            - sport: NFL
            - po_league: National
        - type: custom:decluttering-card
        template: po_game_title
        variables:
            - sport: NFL
            - po_game: 1
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: NL
                - game_num: 4
                - series_num: 2
                - attribute: entries
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_natl_div_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: NL
            - game_num: 4
            - series_num: 2
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_natl_div_games
            - tv_schedule: sensor.nfl_po_tv_coverage
        - type: custom:decluttering-card
        template: po_game_title
        variables:
            - sport: NFL
            - po_game: 2
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: NL
                - game_num: 5
                - series_num: 2
                - attribute: entries
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_natl_div_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: NL
            - game_num: 5
            - series_num: 2
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_natl_div_games
            - tv_schedule: sensor.nfl_po_tv_coverage
    view_layout:
        grid-area: col2
        show: always
    - type: vertical-stack
    cards:
        - type: custom:decluttering-card
        template: po_level_title
        variables:
            - sport: NFL
            - po_level: League
        - type: custom:decluttering-card
        template: po_league_title
        variables:
            - sport: NFL
            - po_league: American
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: AL
                - game_num: 6
                - series_num: 3
                - attribute: entries
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_amer_leag_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: AL
            - game_num: 6
            - series_num: 3
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_amer_leag_games
            - tv_schedule: sensor.nfl_po_tv_coverage
        - type: custom:decluttering-card
        template: po_league_title
        variables:
            - sport: NFL
            - po_league: National
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - league: NL
                - game_num: 6
                - series_num: 3
                - attribute: entries
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_natl_leag_games
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - league: NL
            - game_num: 6
            - series_num: 3
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_natl_leag_games
            - tv_schedule: sensor.nfl_po_tv_coverage
    view_layout:
        grid-area: col3
        show: always
    - type: vertical-stack
    cards:
        - type: custom:decluttering-card
        template: po_level_title
        variables:
            - sport: NFL
            - po_level: Super Bowl
        - type: horizontal-stack
        cards:
            - type: custom:decluttering-card
            template: po_games
            variables:
                - sport: NFL
                - game_num: 7
                - series_num: 4
                - attribute: entries
                - playoff_teams: sensor.nfl_playoff_seeds
                - playoff_schedule: sensor.nfl_po_world_game
        - type: custom:decluttering-card
        template: po_game_info
        variables:
            - sport: NFL
            - game_num: 7
            - series_num: 4
            - playoff_teams: sensor.nfl_playoff_seeds
            - playoff_schedule: sensor.nfl_po_world_game
            - tv_schedule: sensor.nfl_po_tv_coverage
    view_layout:
        grid-area: col4
        show: always

Part 2.2 of 4

Can’t add MLB right now. The forum software says I need to wait for someone to reply.

Be happy to reply. Send us a picture too. Afterall they are worth 1000 words!