Sports Standings and Scores

I don’t know why, because I re-downloaded the code from Github, but it was different. I copied the code from your post. It works now.

Thank you very much.

Do I need to check anything else in the Stanley Cup area?

Nothing is posted in the API yet for the Stanley cup and when we get the teams it should populate.

If you wanted to take a look at it you could probably use last year’s data. You would need to change the Python API pull to last years. It should be commented out in the nhl-1st-grok.py file.

Ok thanks for the answer

Figured I’d bump the group activity.

NBA/NFL are loading correctly and I have added, albeit late, UEFA Champions.

Still need to work on formatting and I am sure I need to adjust titles, but putting it out there.

A Couple screen shots:
NBA


NHL

UEFA

As a side I was playing around the soccer promotions and may add them to my github in the future but still a copule hiccups - Leg 2 in first round for example on this screen shot. Here is what I am getting right now:

Enjoy and I would love to see additions and improvements

Such great additions, I am doing a new music project using similar flex-tables …

Goal … Jukebox for quests at parties and our winery.

Nice! Are you thinking about posting the code here or on your github?

Git … when I am ready. Still trying to find out how to make a link (probabaly need to use like with param).

In the image, every row in search should be clickable to run a script to add that item to the queue. Haven’t figured out that yet (best way).

Not sure if you want them to be able to click/tap on any part of the row or you can just add another column to each row for ‘add to playlist’ like here:

How to use an URL in flex-table-card? - Configuration / Frontend - Home Assistant Community

Solved … this could be used in the Sports tables too I’ll bet. You can make a cell clickable to run some script like this:

                  - name: Queue
                    data: song_search
                    modify: >-
                      '<div style="text-align:center"><ha-icon
                      icon="mdi:plus"></div>'
                    tap_action:
                      action: perform-action
                      perform_action: spotifyplus.add_player_queue_items
                      target: {}
                      data:
                        entity_id: media_player.spotifyplus_kevin_brown
                        uris: cell[0]

RCJukebox-ezgif.com-video-to-gif-converter

@jeffcrum … key is being able to run a service. Probably could have went the webhook route, but this is cleaner

1 Like

It’s been 18d so figured I would bump this group again :wink:

Playing with FIFA World Cup to get ready for next year (2022 data for now) and since FIFA Club World Cup is going on and FIFA has moved Club to mostly the same format as FIFA World CUp I have been playing with it as well. Not sure how much time I am going to put into it but I have put all of the code I am using right now in my Github site under Soccer - FIFA World Cup & Club World Cup section.

I have tried to layout how I am getting the data in the readme so hopefully that spells out what I am doing.

Lots of moving parts and I am using Flextable probably not how it is intended (I blame @ehcah ) but it is giving me what I am looking for on a quick dashboard.

I would love to have anyone/everyone improve this code

Here are a couple Screen Shots:

Update 6-22-2025 - Fixed names to get rid of TBD, Added Concacaf and a couple other fixes

For anyone following the NHL, pre-season started over the weekend. However, my pre-season stats are all blank. The ESPN API appears to have data, but it’s not populating in the card for me. Is it a similar issue to what happened a year ago? Sports Standings and Scores - #611 by squirtbrnr

If you do a find in the endpoint for children, you will see it is currently empty.

Yes, there is a lot of data in there. But not the data we are looking for.

1 Like

Not sure how your setup is with NHL and grabbing data but you need to adjust the conferences so they grab the preseason data as well. The standard NHL conference setup is grabbing the regular season data and is empty(0) now. Pre-season has data. I don’t follow NHL but to test I added on today. So I created new sensors for the pre-season data using seasontype=1 vs seasontype=2 I am showing this for pre-season:

The Code changes I made to get the pre-season data is here:

###
### NHL Divisions Pre-Season
###


- platform: rest
  scan_interval: 604800
  name: NHL West Central Preseason
  unique_id: sensor.nhl_west_central_preseason
  resource: https://site.web.api.espn.com/apis/v2/sports/hockey/nhl/standings?seasontype=1&type=0&level=3
  value_template: "{{ now() }}"
  json_attributes_path: "$.[1]['children'][0]['standings']"
  json_attributes: 
   - entries   
  

- platform: rest
  scan_interval: 604800
  name: NHL West Pacific Preseason
  unique_id: sensor.nhl_west_pacific_preseason
  resource: https://site.web.api.espn.com/apis/v2/sports/hockey/nhl/standings?seasontype=1&type=0&level=3
  value_template: "{{ now() }}"
  json_attributes_path: "$.[1]['children'][1]['standings']"
  json_attributes: 
   - entries   
  

- platform: rest
  scan_interval: 604800
  name: NHL East Atlantic Preseason
  unique_id: sensor.nhl_east_atlantic_preseason
  resource: https://site.web.api.espn.com/apis/v2/sports/hockey/nhl/standings?seasontype=1&type=0&level=3
  value_template: "{{ now() }}"
  json_attributes_path: "$.[0]['children'][0]['standings']"
  json_attributes: 
   - entries   
  

- platform: rest
  scan_interval: 604800
  name: NHL East Metropolitan Preseason
  unique_id: sensor.nhl_east_metropolitan_preseason
  resource: https://site.web.api.espn.com/apis/v2/sports/hockey/nhl/standings?seasontype=1&type=0&level=3
  value_template: "{{ now() }}"
  json_attributes_path: "$.[0]['children'][1]['standings']"
  json_attributes: 
   - entries   

For those that are using my playoff python files and dashboard the MLB is starting to populate the api. The MLB playoffs will need to have this years dates inserted. I have updated the mlb_sensors.yaml post season playoffs sensor with the following:

resource: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard?dates=20250929-20251024

and the mlb-1st-grok.py python file as well with:

API_URL = "https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard?dates=20250929-20251024"

This is what I am seeing right now:

I need to work on the format/layout (but I just dont have the time to play yet) but I would love to see any customizations of this that I could incorporate.

Hi, ich leben in Deutschland und freue mich gerade über die geballten Informationen für den US-Sport. Ich sehe alle Standings, aber leider nichts unter postgame, live, pregame und unter starting goalies bekomme ich noch fehler angezeigt. Nach 2 Tagen des Suchens weiß ich nicht mehr weiter. Hast du eine Idee woran es noch liegen kann?

Maybe I’m missing something here, but I cannot for the life of me get this or the GROK dashboard to populate. I’ve gone back over all of the previous posts to see if there’s something I missed but that all seems to be correct. I’ve triple checked the sensors and they are correct. I’ve checked to be sure the JSON files are populated and they have current data in them. But the dash boards seem to be ignoring the sensor calls in them in order to populate. Any thoughts or help on this would be very much appreciated.

Not sure. A couple things:

  1. I put the latest code up on Github (in dashboards). Github desktop is being funky and created a 2nd directory but you will see 2 files: Playoffs Dashboard & Playoffs using Python Pulls. 1st one is what you are looking at just using regular rest sensors, 2nd one makes python calls and breaks the data up. I’ll put pictures below.
  2. Test and see if you get what I am showing below. If so then my code changes hopefully fixed it. You also need to make sure that in the mlb post season playoffs sensor is changed for this year. I updated the sensor but here is the code:
######################## Post Season Playoffs 
- platform: rest
  scan_interval: 604800
  name: MLB Playoffs WorldSeries
  unique_id: sensor.mlb_playoffs_worldseries
  #2024 Dataresource: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard?dates=20241001-20241030
  resource: https://site.api.espn.com/apis/site/v2/sports/baseball/mlb/scoreboard?dates=20250929-20251031
  value_template: "{{ now() }}"
  json_attributes:
      - leagues
      - events


3. If you are going to go the python pull route you will also need to make sure that the dates are updated for 2025. Here is what I am showing for the Playoffs using python pulls for MLB

One additional item: Have you added the pieces to the template.yaml file?
You should have this in the template.yaml file:

##########  MLB Playoff ##############################################################
- name: mlb_playoff_filtered_events
  unique_id: sensor.mlb_playoff_filtered_events
  state: "{{ now() }}"
  attributes:
    
    al_wild_card: >
      {% set region = 'ALWC' %}
      {% set filtered_ids = namespace(ids=[]) %}
      {% set filtered_events = namespace(events=[]) %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.competitions %}
          {% for competition in event.competitions %}
            {% if competition.notes and competition.notes[0].headline | regex_search(region, ignorecase=True) %}
              {% set filtered_ids.ids = filtered_ids.ids + [competition.id] %}
            {% endif %}
          {% endfor %}
        {% endif %}
      {% endfor %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.id in filtered_ids.ids %}
          {% set filtered_events.events = filtered_events.events + [event] %}
        {% endif %}
      {% endfor %}
      {{ filtered_events.events }}      
    nl_wild_card: >
      {% set region = 'NLWC' %}
      {% set filtered_ids = namespace(ids=[]) %}
      {% set filtered_events = namespace(events=[]) %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.competitions %}
          {% for competition in event.competitions %}
            {% if competition.notes and competition.notes[0].headline | regex_search(region, ignorecase=True) %}
              {% set filtered_ids.ids = filtered_ids.ids + [competition.id] %}
            {% endif %}
          {% endfor %}
        {% endif %}
      {% endfor %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.id in filtered_ids.ids %}
          {% set filtered_events.events = filtered_events.events + [event] %}
        {% endif %}
      {% endfor %}
      {{ filtered_events.events }}
    alds: >
      {% set region = 'ALDS' %}
      {% set filtered_ids = namespace(ids=[]) %}
      {% set filtered_events = namespace(events=[]) %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.competitions %}
          {% for competition in event.competitions %}
            {% if competition.notes and competition.notes[0].headline | regex_search(region, ignorecase=True) %}
              {% set filtered_ids.ids = filtered_ids.ids + [competition.id] %}
            {% endif %}
          {% endfor %}
        {% endif %}
      {% endfor %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.id in filtered_ids.ids %}
          {% set filtered_events.events = filtered_events.events + [event] %}
        {% endif %}
      {% endfor %}
      {{ filtered_events.events }}
    nlds: >
      {% set region = 'NLDS' %}
      {% set filtered_ids = namespace(ids=[]) %}
      {% set filtered_events = namespace(events=[]) %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.competitions %}
          {% for competition in event.competitions %}
            {% if competition.notes and competition.notes[0].headline | regex_search(region, ignorecase=True) %}
              {% set filtered_ids.ids = filtered_ids.ids + [competition.id] %}
            {% endif %}
          {% endfor %}
        {% endif %}
      {% endfor %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.id in filtered_ids.ids %}
          {% set filtered_events.events = filtered_events.events + [event] %}
        {% endif %}
      {% endfor %}
      {{ filtered_events.events }}

    alcs: >
      {% set region = 'ALCS' %}
      {% set filtered_ids = namespace(ids=[]) %}
      {% set filtered_events = namespace(events=[]) %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.competitions %}
          {% for competition in event.competitions %}
            {% if competition.notes and competition.notes[0].headline | regex_search(region, ignorecase=True) %}
              {% set filtered_ids.ids = filtered_ids.ids + [competition.id] %}
            {% endif %}
          {% endfor %}
        {% endif %}
      {% endfor %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.id in filtered_ids.ids %}
          {% set filtered_events.events = filtered_events.events + [event] %}
        {% endif %}
      {% endfor %}
      {{ filtered_events.events }}      
    nlcs: >
      {% set region = 'NLCS' %}
      {% set filtered_ids = namespace(ids=[]) %}
      {% set filtered_events = namespace(events=[]) %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.competitions %}
          {% for competition in event.competitions %}
            {% if competition.notes and competition.notes[0].headline | regex_search(region, ignorecase=True) %}
              {% set filtered_ids.ids = filtered_ids.ids + [competition.id] %}
            {% endif %}
          {% endfor %}
        {% endif %}
      {% endfor %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.id in filtered_ids.ids %}
          {% set filtered_events.events = filtered_events.events + [event] %}
        {% endif %}
      {% endfor %}
      {{ filtered_events.events }}
    
  
########################### World Series
    world_series: >
      {% set region = 'World Series' %}
      {% set filtered_ids = namespace(ids=[]) %}
      {% set filtered_events = namespace(events=[]) %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.competitions %}
          {% for competition in event.competitions %}
            {% if competition.notes and competition.notes[0].headline | regex_search(region, ignorecase=True) %}
              {% set filtered_ids.ids = filtered_ids.ids + [competition.id] %}
            {% endif %}
          {% endfor %}
        {% endif %}
      {% endfor %}
      {% for event in state_attr('sensor.mlb_playoffs_worldseries', 'events') %}
        {% if event.id in filtered_ids.ids %}
          {% set filtered_events.events = filtered_events.events + [event] %}
        {% endif %}
      {% endfor %}
      {{ filtered_events.events }}

for the non-python dashboard - I break the playoffs up into filtered events and then use them when I call the decluttering card. Specifically these 2:
- entity: sensor.mlb_playoff_filtered_events
- events: al_wild_card

you can see that in this example under variables in the dashboard

                           - attributes:
                                label: MLB Playoffs to WorldSeries
                                icon: mdi:trophy
                              card:
                                type: horizontal-stack
                                cards:
                                  - type: vertical-stack
                                    cards:
                                      - type: custom:decluttering-card
                                        template: sports_playoffs
                                        variables:
                                          - title: AL Wildcard
                                          - color: '#D50032'
                                          - entity: sensor.mlb_playoff_filtered_events
                                          - events: al_wild_card
                                          - show_rankings: false
                                          - show_series: true
                                          - show_broadcast: true

After cleaning up my template.yaml file, there were indentation errors that were preventing it from loading, I was able to get the one with template sensors to populate. But still no luck with the python one. But I’ll keep working on it. One thiong to note, both of the dashboards you have in the new dashboard folder are the same. I needed to pull one from the archive folder.

Lou - apologize I see that I duplicated the dashboard code. Should be fixed now and hopefully Github is cleaned up.

A couple thoughts on the python pulls:

  • The python file in my example is in the /config/www directory.
  • I use an automation to call the python file and the json files are put into the /config/www directory.
  • Here are the files (mlb example) that are currently in the /config/www directory
  • Configured in the mlb_sensors.yaml I pull the json data into their respective sensors. I have my sensor files (mlb /wnba/nhl/etc…) in the sensors directory - here are the MLB sensors created:
sensor.mlb_al_wild_card_gpt
sensor.mlb_nl_wild_card_gpt
sensor.mlb_al_division_series_gpt
sensor.mlb_nl_division_series_gpt
sensor.mlb_al_championship_series_gpt
sensor.mlb_nl_championship_series_gpt
sensor.mlb_world_series_gpt
  • I also updated the mlb_sensors.yaml in the sensors directory.

Let me know if that helps. Here is what I am seeing today:

Fantastic work everyone creating such a great dashboard!

Curious if there is an easy to follow guide/instructions for a completely new installation (to make sure I’m not missing any pieces).