Real-Time Sports Scores w/ TeamTracker and TeamTracker-Card (Beta)

You milage may vary … as they say. But here ya go:

type: custom:tabbed-card
styles:
  '--mdc-theme-primary': green
  '--mdc-tab-text-label-color-default': gray
  '--mdc-typography-button-font-size': 12px
tabs:
  - attributes:
      label: NHL Standings
    card:
      type: markdown
      content: '**Coming Soon!**'
  - attributes:
      label: NHL Postgame
      icon: mdi:hockey-sticks
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: masonry
      card_param: cards
      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "NHL" -%}
            {%- if states(team) == "POST" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team }}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date
  - attributes:
      label: NHL Live
      icon: mdi:hockey-puck
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: masonry
      card_param: cards
      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "NHL" -%}
            {%- if states(team) == "IN" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team }}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date
  - attributes:
      label: NHL Pregame
      icon: mdi:blood-bag
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: masonry
      card_param: cards
      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "NHL" -%}
            {%- if states(team) == "PRE" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team }}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date
  - attributes:
      label: MLB Standings
    card:
      type: markdown
      content: '**Coming Soon!**'
  - attributes:
      label: MLB Postgame
      icon: mdi:baseball
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: masonry
      card_param: cards
      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "MLB" -%}
            {%- if states(team) == "POST" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team }}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date
  - attributes:
      label: MLB Live
      icon: mdi:baseball-bat
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: masonry
      card_param: cards
      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "MLB" -%}
            {%- if states(team) == "IN" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team }}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date
  - attributes:
      label: MLB Pregame
      icon: mdi:baseball-diamond
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: masonry
      card_param: cards
      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "MLB" -%}
            {%- if states(team) == "PRE" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team }}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date
  - attributes:
      label: NFL Standings
    card:
      type: markdown
      content: '**Coming Soon!**'
  - attributes:
      label: NFL Postgame
      icon: mdi:football-helmet
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: masonry
      card_param: cards
      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "NFL" -%}
            {%- if states(team) == "POST" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team }}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date
  - attributes:
      label: NFL Live
      icon: mdi:football
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: masonry
      card_param: cards
      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "NFL" -%}
            {%- if states(team) == "IN" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team }}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date
  - attributes:
      label: NFL Pregame
      icon: mdi:strategy
    card:
      type: custom:auto-entities
      unique: true
      show_empty: false
      card:
        type: custom:layout-card
        layout_type: masonry
      card_param: cards
      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "NFL" -%}
            {%- if states(team) == "PRE" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team }}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}
        exclude:
          - entity_id: '*team_tracker*'
      sort:
        method: attribute
        attribute: date

Note: I am workiong on standings right now, should be finished in a day or so with a nice interface

Great …thanks

So I have got MLS stats in but how do I get it to sort properly.

I used something similiar for my rest sensors…

Then I added the custom:flex-table-card

Used similiar code to the EPL standings card but if I add the

  • name: ‘#’
    id: place
    data: entries
    modify: x.stats[10].value
    align: center

It blows everything out of proportion unlike what they show.

Here’s here’s a link to the flex-table-card config I’m using for NHL and Soccer Standings. The REST sensor is linked from the Wiki page too. I’m pretty sure I used the same for MLS and EPL.

It’s all based on @kbrown01 earlier post.

Very nice. I ws doing it differently but I can work with this. I did not want 4 sensors for hockey. I want one. Yet I want them organized by conference and division. From this I assume I need four sensors, one for each division

I hadn’t thought about a single sensor for all NHL standings with different cards for each division but you should be able to do it.

It seems like you should be able to remove the children part from json_attributes_path in the sensor and add it to the modify sections in the flex-table-card. Then just use different index values in each card to pull out the division standings you want.

I haven’t figured out a way to do a single flex-table-card to break it out by divisions with headings separating them. If you find a way, I’d love to see it.

How are you doing the custom side panel? Are you doing based off of this?

Just a dashboard is all.

Ok thanks.

So I tried your code to show all MLS upcoming games but it displays them in one column.

type: custom:auto-entities
unique: true
show_empty: false
card:
  type: custom:layout-card
  layout_type: masonry
card_param: cards
filter:
  template: |
    {%- for team in integration_entities("teamtracker") -%}
      {%- if state_attr(team, "team_homeaway") == "home" -%}
        {{{"type": "custom:teamtracker-card",
          "entity": team }}},
      {%- endif -%}
    {%- endfor -%}
  exclude:
    - entity_id: '*team_tracker*'
sort:
  method: attribute
  attribute: date

Here is the full YAML for the Dashboard:

views:
  - theme: Backend-selected
    title: Sports
    type: panel
    icon: mdi:strategy
    badges: []
    cards:
      - type: custom:tabbed-card
        styles:
          '--mdc-theme-primary': green
          '--mdc-tab-text-label-color-default': gray
          '--mdc-typography-button-font-size': 12px
        tabs:
          - attributes:
              label: NHL Standings
            card:
              type: markdown
              content: '**Coming Soon!**'
          - attributes:
              label: NHL Postgame
              icon: mdi:hockey-sticks
            card:
              type: custom:auto-entities
              unique: true
              show_empty: false
              card:
                type: custom:layout-card
                layout_type: masonry
              card_param: cards
              filter:
                template: |
                  {%- for team in integration_entities("teamtracker") -%}
                    {%- if state_attr(team, "league") == "NHL" -%}
                    {%- if states(team) == "POST" -%}
                    {%- if state_attr(team, "team_homeaway") == "home" -%}
                      {{{"type": "custom:teamtracker-card",
                        "entity": team }}},
                    {%- endif -%}
                    {%- endif -%}
                    {%- endif -%}
                  {%- endfor -%}
                exclude:
                  - entity_id: '*team_tracker*'
              sort:
                method: attribute
                attribute: date
          - attributes:
              label: NHL Live
              icon: mdi:hockey-puck
            card:
              type: custom:auto-entities
              unique: true
              show_empty: false
              card:
                type: custom:layout-card
                layout_type: masonry
              card_param: cards
              filter:
                template: |
                  {%- for team in integration_entities("teamtracker") -%}
                    {%- if state_attr(team, "league") == "NHL" -%}
                    {%- if states(team) == "IN" -%}
                    {%- if state_attr(team, "team_homeaway") == "home" -%}
                      {{{"type": "custom:teamtracker-card",
                        "entity": team }}},
                    {%- endif -%}
                    {%- endif -%}
                    {%- endif -%}
                  {%- endfor -%}
                exclude:
                  - entity_id: '*team_tracker*'
              sort:
                method: attribute
                attribute: date
          - attributes:
              label: NHL Pregame
              icon: mdi:blood-bag
            card:
              type: custom:auto-entities
              unique: true
              show_empty: false
              card:
                type: custom:layout-card
                layout_type: masonry
              card_param: cards
              filter:
                template: |
                  {%- for team in integration_entities("teamtracker") -%}
                    {%- if state_attr(team, "league") == "NHL" -%}
                    {%- if states(team) == "PRE" -%}
                    {%- if state_attr(team, "team_homeaway") == "home" -%}
                      {{{"type": "custom:teamtracker-card",
                        "entity": team }}},
                    {%- endif -%}
                    {%- endif -%}
                    {%- endif -%}
                  {%- endfor -%}
                exclude:
                  - entity_id: '*team_tracker*'
              sort:
                method: attribute
                attribute: date
          - attributes:
              label: MLB Standings
            card:
              type: markdown
              content: '**Coming Soon!**'
          - attributes:
              label: MLB Postgame
              icon: mdi:baseball
            card:
              type: custom:auto-entities
              unique: true
              show_empty: false
              card:
                type: custom:layout-card
                layout_type: masonry
              card_param: cards
              filter:
                template: |
                  {%- for team in integration_entities("teamtracker") -%}
                    {%- if state_attr(team, "league") == "MLB" -%}
                    {%- if states(team) == "POST" -%}
                    {%- if state_attr(team, "team_homeaway") == "home" -%}
                      {{{"type": "custom:teamtracker-card",
                        "entity": team }}},
                    {%- endif -%}
                    {%- endif -%}
                    {%- endif -%}
                  {%- endfor -%}
                exclude:
                  - entity_id: '*team_tracker*'
              sort:
                method: attribute
                attribute: date
          - attributes:
              label: MLB Live
              icon: mdi:baseball-bat
            card:
              type: custom:auto-entities
              unique: true
              show_empty: false
              card:
                type: custom:layout-card
                layout_type: masonry
              card_param: cards
              filter:
                template: |
                  {%- for team in integration_entities("teamtracker") -%}
                    {%- if state_attr(team, "league") == "MLB" -%}
                    {%- if states(team) == "IN" -%}
                    {%- if state_attr(team, "team_homeaway") == "home" -%}
                      {{{"type": "custom:teamtracker-card",
                        "entity": team }}},
                    {%- endif -%}
                    {%- endif -%}
                    {%- endif -%}
                  {%- endfor -%}
                exclude:
                  - entity_id: '*team_tracker*'
              sort:
                method: attribute
                attribute: date
          - attributes:
              label: MLB Pregame
              icon: mdi:baseball-diamond
            card:
              type: custom:auto-entities
              unique: true
              show_empty: false
              card:
                type: custom:layout-card
                layout_type: masonry
              card_param: cards
              filter:
                template: |
                  {%- for team in integration_entities("teamtracker") -%}
                    {%- if state_attr(team, "league") == "MLB" -%}
                    {%- if states(team) == "PRE" -%}
                    {%- if state_attr(team, "team_homeaway") == "home" -%}
                      {{{"type": "custom:teamtracker-card",
                        "entity": team }}},
                    {%- endif -%}
                    {%- endif -%}
                    {%- endif -%}
                  {%- endfor -%}
                exclude:
                  - entity_id: '*team_tracker*'
              sort:
                method: attribute
                attribute: date
          - attributes:
              label: NFL Standings
            card:
              type: markdown
              content: '**Coming Soon!**'
          - attributes:
              label: NFL Postgame
              icon: mdi:football-helmet
            card:
              type: custom:auto-entities
              unique: true
              show_empty: false
              card:
                type: custom:layout-card
                layout_type: masonry
              card_param: cards
              filter:
                template: |
                  {%- for team in integration_entities("teamtracker") -%}
                    {%- if state_attr(team, "league") == "NFL" -%}
                    {%- if states(team) == "POST" -%}
                    {%- if state_attr(team, "team_homeaway") == "home" -%}
                      {{{"type": "custom:teamtracker-card",
                        "entity": team }}},
                    {%- endif -%}
                    {%- endif -%}
                    {%- endif -%}
                  {%- endfor -%}
                exclude:
                  - entity_id: '*team_tracker*'
              sort:
                method: attribute
                attribute: date
          - attributes:
              label: NFL Live
              icon: mdi:football
            card:
              type: custom:auto-entities
              unique: true
              show_empty: false
              card:
                type: custom:layout-card
                layout_type: masonry
              card_param: cards
              filter:
                template: |
                  {%- for team in integration_entities("teamtracker") -%}
                    {%- if state_attr(team, "league") == "NFL" -%}
                    {%- if states(team) == "IN" -%}
                    {%- if state_attr(team, "team_homeaway") == "home" -%}
                      {{{"type": "custom:teamtracker-card",
                        "entity": team }}},
                    {%- endif -%}
                    {%- endif -%}
                    {%- endif -%}
                  {%- endfor -%}
                exclude:
                  - entity_id: '*team_tracker*'
              sort:
                method: attribute
                attribute: date
          - attributes:
              label: NFL Pregame
              icon: mdi:strategy
            card:
              type: custom:auto-entities
              unique: true
              show_empty: false
              card:
                type: custom:layout-card
                layout_type: masonry
              card_param: cards
              filter:
                template: |
                  {%- for team in integration_entities("teamtracker") -%}
                    {%- if state_attr(team, "league") == "NFL" -%}
                    {%- if states(team) == "PRE" -%}
                    {%- if state_attr(team, "team_homeaway") == "home" -%}
                      {{{"type": "custom:teamtracker-card",
                        "entity": team }}},
                    {%- endif -%}
                    {%- endif -%}
                    {%- endif -%}
                  {%- endfor -%}
                exclude:
                  - entity_id: '*team_tracker*'
              sort:
                method: attribute
                attribute: date
title: Sports Scores
1 Like

Yeah I figured it out. Had to change my View setting to “Panel”

Now to figure out how to get the right settings for standings in the cutom:tabbed-card.

@vasqued2 … Good start. I use this for NHL and I can see the light.

- platform: rest
  scan_interval: 36000
  name: NHL Standings
  unique_id: sensor.nhl_standings
  resource: https://site.web.api.espn.com/apis/v2/sports/hockey/nhl/standings?type=2&level=2
  value_template: "{{ now() }}"
  json_attributes:
      - children

I may need one level more, I will need to check the actual result as that is Divisional. I am understanding this now.

Yes use 3 and 3 and you get by Conference and Division in the Conference.
Then this should be in four flex-tables not one. IN pseudo codehere …

East-ATL … children[0].children[0].standings.entries.team
East-MET… children[0].children[1].standings.entries.team
West-CEN … children[1].children[0].standings.entries.team
West-PAC … children[1].children[1].standings.entries.team

Ok so if I do this…

- platform: rest
    name: MLS_Standings_test
    scan_interval: 7200
    resource: https://site.web.api.espn.com/apis/v2/sports/soccer/usa.1/standings?type=0&level=0
    value_template: "{{ now() }}"
    json_attributes:
      - children   

Looks like this pulls all MLS teams broken up by conferences…but now how do I pull the data into the flex-table?

children:
  - uid: s:600~l:770~g:1
    id: '1'
    name: Eastern Conference
    abbreviation: East
    standings:
      id: '0'
      name: overall
      displayName: Overall Standings
      links:
        - language: en-US
          rel:
            - standings
            - desktop
          href: https://www.espn.com/soccer/table/_/league/usa.1
          text: Table
          shortText: Standings
          isExternal: false
          isPremium: false
      season: 2023
      seasonType: 1
      entries:
        - team:
            id: '182'
            uid: s:600~t:182
            location: Chicago Fire FC
            name: Chicago Fire FC
            abbreviation: CHI
            displayName: Chicago Fire FC
            shortDisplayName: Chicago
            isActive: true
            logos:
              - href: https://a.espncdn.com/i/teamlogos/soccer/500/182.png
     

No idea. I have tried dozens of combinations to flex-table and none work as they should. I am likely going to abandon it as it is lame and really can only handle data one level deep. If anyone has an example otherwise, I would love to see it but I can write jinja all dat long to get at everything, but the data selector just cannot more than one level.

Take the simplest of all examples as I see it:

type: custom:flex-table-card
title: Standings
sort_by: place
entities:
  include: sensor.nhl_standings
columns:
  - name: Name
    data: children
    modify: |
      '<div>' + x.name + '</div>'
    align: left

This works and gives you this:

image

So lets try to go one level deeper.

type: custom:flex-table-card
title: Standings
sort_by: place
entities:
  include: sensor.nhl_standings
columns:
  - name: Name
    data: children.children[0]
    modify: |
      '<div>' + x.name + '</div>'
    align: left

image

Yet it should work. Let’s prove it … let’s change the it just a bit

type: custom:flex-table-card
title: Standings
sort_by: place
entities:
  include: sensor.nhl_standings
columns:
  - name: Name
    data: children
    modify: |
      '<div>' + x.children[0].name + '</div>'
    align: left

image

And this shows two things.

(1) The data selector cannot be more than one level deep. If someone can prove it can, show me I would love to see it.
(2) This makes it totally unusable for this application because it will only iterate over the “data” which is children which will always be two in this case (one for each conference). And here is the proof for that:

type: custom:flex-table-card
title: Standings
sort_by: place
entities:
  include: sensor.nhl_standings
columns:
  - name: Name
    data: children
    modify: |
      '<div>' + x.children[0].standings.entries[0].team.name + '</div>'
    align: left

image

Two teams. Not every team because it iterates over the data: which has two conferences so you only get two teams. And because it appears (not as their documentation states) that you can put paths into the data: YAML, it does not work for anything more than one level.

In other words, someone show an example like this which I cannot find anywhere:

data: level1.level2.level3

While their documentation states you can, I am sorry … it does not work.

Now, I can easily do this in templates:

{% for entry in state_attr('sensor.nhl_standings','children')[0].children[0].standings.entries | list %}
{{ entry.team.name }}
{% endfor %}

So in templates one could easily build out what is needed. Problem is throwing that into Markdown a’int the prettiest things but I guess if one one has a solution then that is the way to go. In fact, the more I thin about it I think injecting a table in markdown is the way because one markdown card can have all the stats.

On to writing it

Here.

I suspected that was what would be needed. I would have preferred one sensor with the data and not four for the NHL. One sensor four flex tables each with different data:

The documentation alludes to this as possible by stating you can have paths in the data:

Is it not possible?

Specifically, I have this (abbreviated but enough to understand):

children:
  - uid: s:70~l:90~g:7
    id: '7'
    name: Eastern Conference
    abbreviation: East
    children:
      - uid: s:70~l:90~g:32
        id: '32'
        name: Atlantic Division
        abbreviation: ATL
        standings:
          id: '3'
          name: wildcard
          displayName: Wild Card Standings
          links:
            - language: en-US
              rel:
                - standings
                - desktop
              href: https://www.espn.com/nhl/standings/_/group/32
              text: Table
              shortText: Standings
              isExternal: false
              isPremium: false
          season: 2023
          seasonType: 2
          entries:
            - team:
                id: '2'
                uid: s:70~l:90~t:2
                location: Buffalo
                name: Sabres
                abbreviation: BUF
                displayName: Buffalo Sabres
                shortDisplayName: Sabres
                isActive: true

data: childern and x.name is correct and yields “Eastern Conference”, “Western Conference”)

Based on this from the documentation – “When accessing attributes, sometimes an attribute object will itself contain objects. In that case, you can access the lower object using dotted notation. eg: object1.object2.field1”

I would have exepected data:children.children to give me the four named divisions, or childern.children[0] give me the first. But alas it does not. It is just an error.

I assume this means that your sensor attributes are at the grouping level and the data: attribute is the row repeater and can only be one level under the sensor main attribute?

Can the flex-table-card do a sortby?

This could be a left field solution - but what about using Markdown?

resource: https://site.web.api.espn.com/apis/v2/sports/hockey/nhl/standings?type=0&level=4
sensor:
  name: scoreboard_nhl
  value_template: "{{ now() }}"
  json_attributes:
    - children
scan_interval: 3600
type: custom:vertical-stack-in-card
cards:
  - type: grid
    square: false
    columns: 1
    cards:
      - type: custom:mushroom-template-card
        primary: NHL (All Teams)
        icon: mdi:hockey-puck
        icon_color: green
  - type: markdown
    content: >-
      {% for conf in state_attr('sensor.scoreboard_nhl', 'children') %} {% for
      division in conf.children %}

      ### {{conf.name}}, {{division.name }}

      |Team|Logo|GP|W|L|PD|Pts|

      |:--|:--:|:--:|:--:|:--:|:--:|:--:|

      {%- for team in division.standings.entries %}

      |{{team.team.displayName}}|<img
      src="{{team.team.logos[1].href}}">|{{team.stats[3].value|int}}|{{team.stats[10].value|int}}|{{team.stats[4].value|int}}|{{team.stats[8].value|int}}:{{team.stats[7].value|int}}|{{team.stats[6].value|int}}|

      {%- endfor %}

      {% endfor %}

      {% endfor %}
    card_mod:
      style:
        ha-markdown: |
          ha-card.type-markdown { box-shadow: none; }
          .no-header {padding-top: 0px !important; }
        ha-markdown$: >
          table { width: 100%; padding: 16px; border-collapse: collapse;
          padding: 0px; }

          thead th { height: 1em; }

          tr td { padding-left: 0.5em; padding-right: 0.5em;  }

          th { padding-left: 0.5em; padding-right: 0.5em;  }

          tbody tr:nth-child(odd) { background-color:
          var(--table-row-background-color);  }

          tbody tr:nth-child(even) { background-color:
          var(--table-row-alternative-background-color);  }

          tbody tr td:nth-child(2) { width: 10%; }

          th ha-icon { height: 1em; vertical-align: top;  } 

EDIT - this code can help you find the right column number

{% set ns = namespace(count = 0) %}
{% for x in states.sensor.scoreboard_nhl.attributes.children[0].children[0].standings.entries[0].stats %}
{{ ns.count }} {{x.name}} {{x.displayValue}}
{%- set ns.count = ns.count+1 %}
{%- endfor %}

I already did the multiple sensor solution. Flex-table-card - #58 by kbrown01

No problem - perhaps someone else may benefit from the alternate approach

But of course! In fact if you look at the above I did say that Markdown can do it.
The issue though is that markdown was complex at best and would require a lot of card-mod/css styling to make it look decent, you have done a great job above for sure.

You approach could have another significant benefit that should be pointed out. Having all the data in one sensor by conference and division would allow you to have three markdown cards. One as you have done by division, one by conference and one overall with every team … all sorted by points and even a wild-card one by conference plus divisional leaders.

I was only hoping that all of that could be done with flex-table but alas, it does not seem that “flexy”.

As a side note I have that almost exact same “stat name finder” in my Developer tools. I did exactly that to figure out what all the stat names were and their index to plug in.