hahaha. Don’t sweat it. If I could not reply due to family, I would not. We do Christmas with the kids/grandkids Christmas Eve. Just the wife and I watching football.
I think it is time to just post the whole damn dashboard instead of snippets.
I don’t have a test system either. But, I do have test dashboards to paste it into and see what I can see. Although, I am thinking another VM for testing would be prudent. I do a lot of cleanup after helping someone
Same here. One kid + grands coming later, other is spending today with his girlfriend’s family. Wife watching Netflix … me football and trying to figure out the Playoff for football!
Christmas is odd this year. East coast of Canada, no snow. Our kids are older too. Feels like a random monday. I appreciate the help!
Here is the full dashboard code. I have reordered a few things and changed a few colors, but when I go line by line with GitHub, I’m not seeing the errors. I have removed NFL, MLB, NBA and starting goalies. I wanted to understand how taxing these sensors would be before adding all the rest and then adding college football and soccer (not MLS).
You have excluded entities twice in the same template. Which could be an issue, I would imagine it is an error for same key twice, but even not if second wins and that sensor does not exist, then you would have issues. That section should not have the second excluded_entities
sensor.nhl_starting_s is a bit of a mystery. I’m going to guess it’s left over from adding and removing the starting goalies page. At one point, I was on sensor_2 and annoyed. I often used find and replace and must have messed up.
The double exclusion could have happened from removing the other leagues and moving that section around.
@jeffcrum and others, I have posted on flex-table-card GITHUB an enhancement request that IMHO would be killer. Please take a look at:
Read through to the end which has the current solution that works flawlessly in my setup. This enhancement would greatly enhance the use. It allows to import functions from a separate JS file that you can write to do very complex things. It is also especially useful in code repetition reduction so that changes can be made once to change many uses of the same pattern of JS snippets.
Please take a look, test if you like. Questions/comments always welcome.
I will never go back so if it is not put into the core product, I will just reimplement on each update to it. As an example for the Strength of Schedule post I did above. It reduces tons of repetitive JS to this:
What I should really test is that if the import file does not exist, then does the JS fail?
If not, then the only change would be the ne command and the expected name of the file. I suppose that is not a hard test for me … a few hard refreshes should tell me.
While it isn;t a big code saver, this does provide value should we ever want logic in any of the columns for formatting or across the board changes for all sports:
For those that follow, I changed the Strength of Schedule and also the Starting Goalie Sensors because of the latest change in multiscrape supporting scraping JSON into attributes. THese are now created this way (so you can eliminate getting the buildid for starting goalies):
Hey,
I know you are throwing upgrade pieces here. But, are you changing your Github with all of these so someone can jump there and grab everything from scratch?
@jeffcrum you are right on. I need to do exactly that …
BUT …
My implementation is already fill of using my “plugin” functionality that I hand-did in flex-table-card. It would be impossible to just upload without that functionaliy being implemented in flex-table-card.
I appreciate your promotion there, but so far I see crickets from the code owner. So I cannot just post it up for everyone because it requires a person to “hack” the source JS.
As I stated:
I will never go back so if it is not put into the core product, I will just reimplement on each update to it.
firstly I’d like to say thanks for creating this. It’s pretty great!
the only issue I’m running into is that I can’t see any teams listed under pre, live, post. All the team sensors have been added and I can see them in their respective standings tabs, but I can’t see them in pre live or postgame. Any pointers?
Those are all from teamtracker, do you have all of that integration installed? Like you would have the teamtracker integration installed and have like this in an included sensor.yaml:
##
## NFL Teams
##
- platform: teamtracker
league_id: NFL
team_id: DET
name: Detroit Lions
- platform: teamtracker
league_id: NFL
team_id: GB
name: Green Bay
- platform: teamtracker
league_id: NFL
team_id: CHI
name: Chicago Bears
- platform: teamtracker
league_id: NFL
team_id: MIN
name: Minnesota Vikings
- platform: teamtracker
league_id: NFL
team_id: BUF
name: Buffalo Bills
- platform: teamtracker
league_id: NFL
team_id: MIA
name: Miami Dolphins
- platform: teamtracker
league_id: NFL
team_id: NE
name: New England Patriots
- platform: teamtracker
league_id: NFL
team_id: NYJ
name: New York Jets
- platform: teamtracker
league_id: NFL
team_id: DAL
name: Dallas Cowboys
- platform: teamtracker
league_id: NFL
team_id: NYG
name: New York Giants
- platform: teamtracker
league_id: NFL
team_id: PHI
name: Philadelphia Eagles
- platform: teamtracker
league_id: NFL
team_id: WSH
name: Washington Commanders
- platform: teamtracker
league_id: NFL
team_id: BAL
name: Baltimore Ravens
- platform: teamtracker
league_id: NFL
team_id: CIN
name: Cincinnati Bengals
- platform: teamtracker
league_id: NFL
team_id: CLE
name: Cleveland Browns
- platform: teamtracker
league_id: NFL
team_id: PIT
name: Pittsburg Steelers
- platform: teamtracker
league_id: NFL
team_id: HOU
name: Houston Texans
- platform: teamtracker
league_id: NFL
team_id: IND
name: Indianapolis Colts
- platform: teamtracker
league_id: NFL
team_id: JAX
name: Jacksonville Jaguars
- platform: teamtracker
league_id: NFL
team_id: TEN
name: Tennessee Titans
- platform: teamtracker
league_id: NFL
team_id: ATL
name: Atlanta Falcons
- platform: teamtracker
league_id: NFL
team_id: CAR
name: Carolina Panthers
- platform: teamtracker
league_id: NFL
team_id: "NO"
name: New Orleans Saints
- platform: teamtracker
league_id: NFL
team_id: TB
name: Tampa Bay Buccaneers
- platform: teamtracker
league_id: NFL
team_id: DEN
name: Denver Broncos
- platform: teamtracker
league_id: NFL
team_id: KC
name: Kansas City Chiefs
- platform: teamtracker
league_id: NFL
team_id: LV
name: Las Vegas Raiders
- platform: teamtracker
league_id: NFL
team_id: LAC
name: Los Angeles Chargers
- platform: teamtracker
league_id: NFL
team_id: ARI
name: Arizona Cardinals
- platform: teamtracker
league_id: NFL
team_id: LAR
name: Los Angeles Rams
- platform: teamtracker
league_id: NFL
team_id: SF
name: "San Francisco 49ers"
- platform: teamtracker
league_id: NFL
team_id: SEA
name: "Seattle Seahawks"
I only piggy back PRE, POST, IN from teamtracker into those tabs with really minimal changes. All the standings are taken directly from ESPN with my code but not specific game information.
Teamtracker = Games
My stuff = Standings plus some enhancements (more to come) like NHL Strength of Schedule and NHL Starting Goalies.
If you do and still get errors then possibly you do not have the red zone installed like others and I can help you either have that or remove it (it is only for NFL anyway)
I modified the SOS multiscrape today as the system now requires an input date (it used to just default to the week’s Monday). This will append the Monday of the current week to the query:
- name: SOS scraper
resource_template: "https://www.dailyfaceoff.com/nhl-weekly-schedule/{{ (now().timestamp()+(0-now().weekday())*86400) | int | timestamp_custom('%Y-%m-%d') }}"
scan_interval: 43200
sensor:
- unique_id: hockey_strength_of_schedule
name: Hockey Strength of Schedule
select: '#__NEXT_DATA__'
value_template: '{{ now() }}'
attributes:
- name: sos
select: '#__NEXT_DATA__'
value_template: >
{{ (value | from_json)['props']['pageProps'] }}
I am still a little new tp Home Assistant. Does anyone know how to turn off the rest sensors in the offseason?
For example, how would I turn off the nfl/football after the Super Bowl and turn it back on right before the pre-season? I would like to avoid the rest calls to ESPN in the off-season.
@jeffcrum is exactly right. But if you insist, you can set the scan interval to some huge number like 360000 or more. Then create an automation that executes updating the entity according to the schedule you want.
Of course it will update on every restart of Home Assistant, but this would give you total control to update only when you want it.
So the logic would be …
Set scan_interval to once every 6 months
Then an automation that executes (daily or whatever you choose) … check the month is sep, oct, nov, dec … if yes, update the entity.
I asked because it seemed like Home Assistant was getting sluggish with my sports API calls on (along with other sensors) on a ESXi VM on a QNAP NAS. I just thought the REST calls could be a possible reason. I am enjoying Home Assistant, but still trying to tweak everything to run more efficiently. I wish there was a performance advice category, but there are so many nuances to HA.
What do you recommend for the scan interval settings for the REST calls to ESPN?