Sports Standings and Scores

Yep. All sensors appear when using that string

OK, let’s go deeper. What do you get from this in the same way in developer’s tools:

{% for team in integration_entities("teamtracker") -%}
{% if state_attr(team, "league") == "NFL" -%}
{% if states(team) == "PRE" -%}
{% if state_attr(team, "team_homeaway") == "home" -%}
{{team}}
{% endif -%}
{% endif -%}
{% endif -%}
{% endfor -%}

Mine shows this:

Same 13 teams for me too.

OK. Did you create the red zone sensor? If not it will error and you will get nothing. If you did, examine the states of sensor.nfl_red_zone … if you didn;t we need to remove that test in the decluttering template. Note: It would be there and return nothing as no NFL team is in the Red ZOne right now. If that sensor does not exist, then you didn;t create it

Ok that sensor is not there. I need to remove it from template.yaml?

I would remove it from the dashboard for now. If you look into the dashboard code in the decluttering templates, change the game_stats: template to remove the test for red zone like this:

      filter:
        template: |
          {%- for team in integration_entities("teamtracker") -%}
            {%- if state_attr(team, "league") == "[[sport]]" -%}
            {%- if states(team) == "[[status]]" -%}
            {%- if state_attr(team, "team_homeaway") == "home" -%}
              {{{"type": "custom:teamtracker-card",
                "entity": team, 
                "home_side": "right"}}},
            {%- endif -%}
            {%- endif -%}
            {%- endif -%}
          {%- endfor -%}

You can add it back once you can figure out what is wrong with the sensor for the red zone teams. The only thing that template is used for is to draw the teamtracker cards with red border and background when an NFL team is in the red zone. You have a problem or that sensor is not setup and hence it fails and so would every teamtracker card.

Are you saying to replace the entire code below with what you posted for each sport? NFL example below.

>    - attributes:
>                 label: Postgame
>                 icon: mdi:football-helmet
>               card:
>                 type: custom:decluttering-card
>                 template: game_stats
>                 variables:
>                   - sport: NFL
>                   - status: POST
>             - attributes:
>                 label: Live
>                 icon: mdi:football
>               card:
>                 type: custom:decluttering-card
>                 template: game_stats
>                 variables:
>                   - sport: NFL
>                   - status: IN
>             - attributes:
>                 label: Pregame
>                 icon: mdi:strategy
>               card:
>                 type: custom:decluttering-card
>                 template: game_stats
>                 variables:
>                   - sport: NFL
>                   - status: PRE’

No look toward the top if editing the whole dashboard. Look for the decluttering templates an specifically the one named “game_stats”. Under that, just replace the filter:

Ah. That highlighted that I was missing the team tracker card. All good now with live , post and pregame tabs. Red zone only thing left to figure out?

Did you add the Red Zone sensors I said in this post?

There are two sensors, one is a scrape sensor that is required to scrape a key used to get a key from the website, the other uses that key to extract the data for starting goalies. And as I said, it will be empty until tomorrow.

That was for the goalies which I think i’m good now. Was there a post for the red zone sensor?

You are correct! It was at the end of the sensors in template.yaml:

  - name: NFL Red Zone
    unique_id: sensor.nfl_red_zone
    state: |
            {% set redzone = namespace(teams=[]) %}
            {%- for team in integration_entities("teamtracker") -%}
            {%- if states(team) == "IN" and state_attr(team, "league") == "NFL" and state_attr(team, "team_homeaway") == "home" and state_attr(team,'possession') is not none -%}
            {% set possession = state_attr(team,'possession') %}
            {% set team_id = state_attr(team,'team_id') %}
            {% set opponent_id = state_attr(team,'opponent_id') %}
            {% set team_abbr = state_attr(team,'team_abbr') %}
            {% set opponent_abbr = state_attr(team,'opponent_abbr') %}
            {% if state_attr(team,'down_distance_text') is not none %}
            {% set down_distance_text = state_attr(team,'down_distance_text') %}
            {% set down_distance_endzone = state_attr(team,'down_distance_text').split(' ')[4] %}
            {% set down_distance_yardline = state_attr(team,'down_distance_text').split(' ')[5] %}
            {% set possession_abbr = opponent_abbr if opponent_id == possession else team_abbr %}
            {% set non_possession_abbr = opponent_abbr if opponent_id != possession else team_abbr %}
            {%- if (possession_abbr != down_distance_endzone) and (down_distance_yardline | int) <= 20 %}
            {% set redzone.teams = redzone.teams + [team] %}
            {% endif %}
            {% endif %}
            {% endif %}
            {% endfor %}
            {{ redzone.teams | count }}
    attributes:
        teams: |
            {% set redzone = namespace(teams=[]) %}
            {%- for team in integration_entities("teamtracker") -%}
            {%- if states(team) == "IN" and state_attr(team, "league") == "NFL" and state_attr(team,'possession') is not none -%}
            {% set possession = state_attr(team,'possession') %}
            {% set team_id = state_attr(team,'team_id') %}
            {% set opponent_id = state_attr(team,'opponent_id') %}
            {% set team_abbr = state_attr(team,'team_abbr') %}
            {% set opponent_abbr = state_attr(team,'opponent_abbr') %}
            {% if state_attr(team,'down_distance_text') is not none %}
            {% set down_distance_text = state_attr(team,'down_distance_text') %}
            {% set down_distance_endzone = state_attr(team,'down_distance_text').split(' ')[4] %}
            {% set down_distance_yardline = state_attr(team,'down_distance_text').split(' ')[5] %}
            {% set possession_abbr = opponent_abbr if opponent_id == possession else team_abbr %}
            {% set non_possession_abbr = opponent_abbr if opponent_id != possession else team_abbr %}
            {%- if (possession_abbr != down_distance_endzone) and (down_distance_yardline | int) <= 20 %}
            {% set redzone.teams = redzone.teams + [team] %}
            {% endif %}
            {% endif %}
            {% endif %}
            {% endfor %}
            {{ redzone.teams }}

Ok. That code was missing and now the sensor is created. Now I need to switch back the code for the game_stats and that should be it?

Probably. You can test Thanksgiving.

My Lions are good for 5 or 6 in the Red Zone!!!

Cool! Happy Thanksgiving and thanks for the patience!

Hi guys,

I absolutely love this project and I’m following it very closely.

However I still can’t get it to work. This is the error I’m getting on the standings tab:

The other tabs are just empty.

What am I doing wrong?

UPDATE: I got rid of the error message, but now everything is just empty…

First of all, I’d like to thank kbrown01 for this fantastic work, I really do like it and his support is super great.
This project is very hard to beat in awesomeness :sunglasses:

What I am trying to do myself before I will start any questions is to set up Soccer (German Bundesliga 1+2 , Premier League, Primera Division and maybe Champions League as well) but thats a part for later maybe…

Concerning last question asked I hope it is ok if I post my settings for the plugin to work correctly as it was set up with the initial sports, because I remember having that error too but I don’t know what I’ve changed anymore.
Also I commented within the yaml files a bit (only for my own understanding of yaml, I am at the very beginning…)

PS: I don’t know which filehost I can use here but I put the files to fastupload.io

Here are my changed files for a working plugin:

I hope this helps

That error is due to the latest release of flex-table. The version of the dashboard was updated on Github to fix the issue temporarily until flex-table is updated.

See above post #294.

You say “none” of the tabs show anything> Even the teamtracker ones (PREGAME, LIVE, POSTGAME)?

is it possible to add the down they are playing (1st-4th) somewhere on that card or is ESPN not transmitting that info?

1