Good job vasqued2. Followed your directions and saints sensor and card are working. Kbrown nailed it.
Let’s get some unranked ncaaf teams in here and this integration is ready to go.
Good job vasqued2. Followed your directions and saints sensor and card are working. Kbrown nailed it.
Let’s get some unranked ncaaf teams in here and this integration is ready to go.
Trying to get this to work for Liverpool FC but showing “NOT_FOUND”. Used EPL as the league and LIV as the team. Any suggestions on why it might not be working?
Looks like Liverpool’s next game isn’t until 9/10. For soccer and some other sports, ESPN tends to purge the old games from the API before they load in the next scheduled game. State will be NOT_FOUND until they load in the next game. I confirmed LIV is not listed in the API right now. Wait a couple days and their 9/10 game should show up.
Well, for NCAAF if that is what you are taking about, I would think so. I am sure this is the endpoint being processed:
http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
And a snippet shows this:
"competitors": [
{
"id": "127",
"uid": "s:20~l:23~t:127",
"type": "team",
"order": 0,
"homeAway": "home",
"winner": true,
"team": {
"id": "127",
"uid": "s:20~l:23~t:127",
"location": "Michigan State",
"name": "Spartans",
"abbreviation": "MSU",
"displayName": "Michigan State Spartans",
"shortDisplayName": "Spartans",
"color": "18453B",
"alternateColor": "ffffff",
"isActive": true,
"venue": {"id": "3936"},
"links": [
{
"rel": [
"clubhouse",
"desktop",
"team"
],
"href": "https://www.espn.com/college-football/team/_/id/127/michigan-state-spartans",
"text": "Clubhouse",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"clubhouse",
"mobile",
"team"
],
"href": "http://www.espn.com/college-football/team/_/id/127/michigan-state-spartans",
"text": "Clubhouse",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"roster",
"desktop",
"team"
],
"href": "http://www.espn.com/college-football/team/roster/_/id/127",
"text": "Roster",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"stats",
"desktop",
"team"
],
"href": "http://www.espn.com/college-football/team/stats/_/id/127",
"text": "Statistics",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"schedule",
"desktop",
"team"
],
"href": "http://www.espn.com/college-football/team/schedule/_/id/127",
"text": "Schedule",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"photos",
"desktop",
"team"
],
"href": "http://www.espn.com/college-football/team/photos/_/id/127",
"text": "photos",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"scores",
"sportscenter",
"app",
"team"
],
"href": "sportscenter://x-callback-url/showClubhouse?uid=s:20~l:23~t:127§ion=scores",
"text": "Scores",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"awards",
"desktop",
"team"
],
"href": "http://www.espn.com/college-football/awards/_/team/127",
"text": "Awards",
"isExternal": false,
"isPremium": false
}
],
"logo": "https://a.espncdn.com/i/teamlogos/ncaa/500/127.png",
"conferenceId": "5"
},
"score": "35",
"linescores": [
{"value": 7.0},
{"value": 14.0},
{"value": 0.0},
{"value": 14.0}
],
"statistics": [],
"curatedRank": {"current": 15},
"records": [
{
"name": "YTD",
"abbreviation": "Game",
"type": "total",
"summary": "1-0"
},
{
"name": "Home",
"type": "home",
"summary": "1-0"
},
{
"name": "Road",
"type": "road",
"summary": "0-0"
},
{
"name": "vs. Conf.",
"type": "vsconf",
"summary": "0-0"
}
]
},
{
"id": "2711",
"uid": "s:20~l:23~t:2711",
"type": "team",
"order": 1,
"homeAway": "away",
"winner": false,
"team": {
"id": "2711",
"uid": "s:20~l:23~t:2711",
"location": "Western Michigan",
"name": "Broncos",
"abbreviation": "WMU",
"displayName": "Western Michigan Broncos",
"shortDisplayName": "Broncos",
"color": "532e1f",
"alternateColor": "8b7f79",
"isActive": true,
"venue": {"id": "3980"},
"links": [
{
"rel": [
"clubhouse",
"desktop",
"team"
],
"href": "https://www.espn.com/college-football/team/_/id/2711/western-michigan-broncos",
"text": "Clubhouse",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"clubhouse",
"mobile",
"team"
],
"href": "http://www.espn.com/college-football/team/_/id/2711/western-michigan-broncos",
"text": "Clubhouse",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"roster",
"desktop",
"team"
],
"href": "http://www.espn.com/college-football/team/roster/_/id/2711",
"text": "Roster",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"stats",
"desktop",
"team"
],
"href": "http://www.espn.com/college-football/team/stats/_/id/2711",
"text": "Statistics",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"schedule",
"desktop",
"team"
],
"href": "http://www.espn.com/college-football/team/schedule/_/id/2711",
"text": "Schedule",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"photos",
"desktop",
"team"
],
"href": "http://www.espn.com/college-football/team/photos/_/id/2711",
"text": "photos",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"scores",
"sportscenter",
"app",
"team"
],
"href": "sportscenter://x-callback-url/showClubhouse?uid=s:20~l:23~t:2711§ion=scores",
"text": "Scores",
"isExternal": false,
"isPremium": false
},
{
"rel": [
"awards",
"desktop",
"team"
],
"href": "http://www.espn.com/college-football/awards/_/team/2711",
"text": "Awards",
"isExternal": false,
"isPremium": false
}
],
"logo": "https://a.espncdn.com/i/teamlogos/ncaa/500/2711.png",
"conferenceId": "15"
},
"score": "13",
"linescores": [
{"value": 3.0},
{"value": 0.0},
{"value": 10.0},
{"value": 0.0}
],
"statistics": [],
"curatedRank": {"current": 99},
"records": [
{
"name": "YTD",
"abbreviation": "Game",
"type": "total",
"summary": "0-1"
},
{
"name": "Home",
"type": "home",
"summary": "0-0"
},
{
"name": "Road",
"type": "road",
"summary": "0-1"
},
{
"name": "vs. Conf.",
"type": "vsconf",
"summary": "0-0"
}
]
}
],
curratedrank seems correct (at least for those ranked teams like MiState in this case). It looks to me like it returns 1 through 25 and everyone else is 99.
MiState = 15
Western Michigan = 99
I assume you want that info in the Card. If you wanted a separate card just showing 1 - 25, that would be a no brainer to create as a REST sensor.
You could hit this url in REST:
http://site.api.espn.com/apis/site/v2/sports/football/college-football/rankings
And get like this:
"ranks": [
{
"current": 1,
"previous": 0,
"points": 1566.0,
"firstPlaceVotes": 54,
"trend": "-",
"team": {
"id": "333",
"uid": "s:20~l:23~t:333",
"location": "Alabama",
"name": "Crimson Tide",
"nickname": "Alabama",
"abbreviation": "ALA",
"color": "690014",
"links": [
{
"href": "https://www.espn.com/college-football/team/_/id/333/alabama-crimson-tide",
"text": "Clubhouse",
"rel": [
"clubhouse",
"desktop",
"team"
]
}
],
"logo": "https://a.espncdn.com/i/teamlogos/ncaa/500/333.png"
},
"date": "2022-08-15",
"lastUpdated": "2022-08-15",
"recordSummary": "0-0"
},
{
"current": 2,
"previous": 0,
"points": 1506.0,
"firstPlaceVotes": 6,
"trend": "-",
"team": {
"id": "194",
"uid": "s:20~l:23~t:194",
"location": "Ohio State",
"name": "Buckeyes",
"nickname": "Ohio State",
"abbreviation": "OSU",
"color": "DE3121",
"links": [
{
"href": "https://www.espn.com/college-football/team/_/id/194/ohio-state-buckeyes",
"text": "Clubhouse",
"rel": [
"clubhouse",
"desktop",
"team"
]
}
],
"logo": "https://a.espncdn.com/i/teamlogos/ncaa/500/194.png"
},
"date": "2022-08-15",
"lastUpdated": "2022-08-15",
"recordSummary": "0-0"
},
{
"current": 3,
"previous": 0,
"points": 1455.0,
"firstPlaceVotes": 3,
"trend": "-",
"team": {
"id": "61",
"uid": "s:20~l:23~t:61",
"location": "Georgia",
"name": "Bulldogs",
"nickname": "Georgia",
"abbreviation": "UGA",
"color": "CC0000",
"links": [
{
"href": "https://www.espn.com/college-football/team/_/id/61/georgia-bulldogs",
"text": "Clubhouse",
"rel": [
"clubhouse",
"desktop",
"team"
]
}
],
"logo": "https://a.espncdn.com/i/teamlogos/ncaa/500/61.png"
},
"date": "2022-08-15",
"lastUpdated": "2022-08-15",
"recordSummary": "0-0"
},
{
"current": 4,
"previous": 0,
"points": 1292.0,
"firstPlaceVotes": 0,
"trend": "-",
"team": {
"id": "228",
"uid": "s:20~l:23~t:228",
"location": "Clemson",
"name": "Tigers",
"nickname": "Clemson",
"abbreviation": "CLEM",
"color": "F66733",
"links": [
{
"href": "https://www.espn.com/college-football/team/_/id/228/clemson-tigers",
"text": "Clubhouse",
"rel": [
"clubhouse",
"desktop",
"team"
]
}
],
"logo": "https://a.espncdn.com/i/teamlogos/ncaa/500/228.png"
},
"date": "2022-08-15",
"lastUpdated": "2022-08-15",
"recordSummary": "0-0"
},
Check these out for more info:
https://gist.github.com/akeaswaran/b48b02f1c94f873c6655e7129910fc3b
In looking at this, it sure would be great to have some “sport-level” … create a sensor for everyteam …
I can go here:
http://site.api.espn.com/apis/site/v2/sports/football/nfl/teams
And see this:
{
"sports": [
{
"id": "20",
"uid": "s:20",
"name": "Football",
"slug": "football",
"leagues": [
{
"id": "28",
"uid": "s:20~l:28",
"name": "National Football League",
"abbreviation": "NFL",
"shortName": "NFL",
"slug": "nfl",
"teams": [
{
"team": {
"id": "22",
"uid": "s:20~l:28~t:22",
"slug": "arizona-cardinals",
"abbreviation": "ARI",
"displayName": "Arizona Cardinals",
"shortDisplayName": "Cardinals",
"name": "Cardinals",
"nickname": "Cardinals",
"location": "Arizona",
"color": "A40227",
"alternateColor": "000000",
"isActive": true,
"isAllStar": false,
"logos": [
{
"href": "https://a.espncdn.com/i/teamlogos/nfl/500/ari.png",
"alt": "",
"rel": [
"full",
"default"
],
"width": 500,
"height": 500
},
{
"href": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/ari.png",
"alt": "",
"rel": [
"full",
"dark"
],
"width": 500,
"height": 500
},
{
"href": "https://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/ari.png",
"alt": "",
"rel": [
"full",
"scoreboard"
],
"width": 500,
"height": 500
},
{
"href": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/scoreboard/ari.png",
"alt": "",
"rel": [
"full",
"scoreboard",
"dark"
],
"width": 500,
"height": 500
}
],
"links": [
{
"language": "en-US",
"rel": [
"clubhouse",
"desktop",
"team"
],
"href": "https://www.espn.com/nfl/team/_/name/ari/arizona-cardinals",
"text": "Clubhouse",
"shortText": "Clubhouse",
"isExternal": false,
"isPremium": false
},
{
"language": "en-US",
"rel": [
"roster",
"desktop",
"team"
],
"href": "http://www.espn.com/nfl/team/roster/_/name/ari/arizona-cardinals",
"text": "Roster",
"shortText": "Roster",
"isExternal": false,
"isPremium": false
},
{
"language": "en-US",
"rel": [
"stats",
"desktop",
"team"
],
"href": "http://www.espn.com/nfl/team/stats/_/name/ari/arizona-cardinals",
"text": "Statistics",
"shortText": "Statistics",
"isExternal": false,
"isPremium": false
},
{
"language": "en-US",
"rel": [
"schedule",
"desktop",
"team"
],
"href": "https://www.espn.com/nfl/team/schedule/_/name/ari",
"text": "Schedule",
"shortText": "Schedule",
"isExternal": false,
"isPremium": false
},
{
"language": "en-US",
"rel": [
"depthchart",
"desktop",
"team"
],
"href": "https://www.espn.com/nfl/team/depth/_/name/ari",
"text": "Depth Chart",
"shortText": "Depth Chart",
"isExternal": false,
"isPremium": false
},
{
"language": "en",
"rel": [
"tickets",
"desktop",
"team"
],
"href": "https://www.vividseats.com/nfl-football/arizona-cardinals-tickets.html?wsUser=717",
"text": "Tickets",
"isExternal": true,
"isPremium": false
}
]
}
},
{
"team": {
"id": "1",
"uid": "s:20~l:28~t:1",
"slug": "atlanta-falcons",
"abbreviation": "ATL",
"displayName": "Atlanta Falcons",
"shortDisplayName": "Falcons",
"name": "Falcons",
"nickname": "Falcons",
"location": "Atlanta",
"color": "000000",
"alternateColor": "000000",
"isActive": true,
"isAllStar": false,
"logos": [
{
"href": "https://a.espncdn.com/i/teamlogos/nfl/500/atl.png",
"alt": "",
"rel": [
"full",
"default"
],
"width": 500,
"height": 500
},
{
"href": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/atl.png",
"alt": "",
"rel": [
"full",
"dark"
],
"width": 500,
"height": 500
},
{
"href": "https://a.espncdn.com/i/teamlogos/nfl/500/scoreboard/atl.png",
"alt": "",
"rel": [
"full",
"scoreboard"
],
"width": 500,
"height": 500
},
{
"href": "https://a.espncdn.com/i/teamlogos/nfl/500-dark/scoreboard/atl.png",
"alt": "",
"rel": [
"full",
"scoreboard",
"dark"
],
"width": 500,
"height": 500
}
],
"links": [
{
"language": "en-US",
"rel": [
"clubhouse",
"desktop",
"team"
],
"href": "https://www.espn.com/nfl/team/_/name/atl/atlanta-falcons",
"text": "Clubhouse",
"shortText": "Clubhouse",
"isExternal": false,
"isPremium": false
},
{
"language": "en-US",
"rel": [
"roster",
"desktop",
"team"
],
"href": "http://www.espn.com/nfl/team/roster/_/name/atl/atlanta-falcons",
"text": "Roster",
"shortText": "Roster",
"isExternal": false,
"isPremium": false
},
{
"language": "en-US",
"rel": [
"stats",
"desktop",
"team"
],
"href": "http://www.espn.com/nfl/team/stats/_/name/atl/atlanta-falcons",
"text": "Statistics",
"shortText": "Statistics",
"isExternal": false,
"isPremium": false
},
{
"language": "en-US",
"rel": [
"schedule",
"desktop",
"team"
],
"href": "https://www.espn.com/nfl/team/schedule/_/name/atl",
"text": "Schedule",
"shortText": "Schedule",
"isExternal": false,
"isPremium": false
},
{
"language": "en-US",
"rel": [
"depthchart",
"desktop",
"team"
],
"href": "https://www.espn.com/nfl/team/depth/_/name/atl",
"text": "Depth Chart",
"shortText": "Depth Chart",
"isExternal": false,
"isPremium": false
},
{
"language": "en",
"rel": [
"tickets",
"desktop",
"team"
],
"href": "https://www.vividseats.com/nfl-football/atlanta-falcons-tickets.html?wsUser=717",
"text": "Tickets",
"isExternal": true,
"isPremium": false
}
]
}
},
I have code in my Insteon integration that does something similar at homeassistant start, but should be buried in the actual integration. In my Insteon integration I create a HA group for every scene in an Insteon modem. I could see this the same way, create a sensor for every team in the NFL … one would only run it once really.
As for @vasqued2 question about non-ranked teams … given an event id:
https://site.api.espn.com/apis/site/v2/sports/football/college-football/summary?event=401415613
That will deliver you all stats about two unranked teams in that matchup
New version v0.1.1 is available. See notes section for important information.
Notes:
Hopefully this will get everyone access to the teams they are looking for. Let me know if you run into any issues.
Congratulations on the code and card.
Working for Soccer Championships / Teams in Brazil.
What items are you trying to translate? And from what and to what?
EXAMPLES:
from: No Upcoming Games
to: Nenhum próximo jogo
line: 108
from: “Kickoff”
to: “Início”
line: 109
from: Wednesday
to: Quarta-feira
line: 34 (var gameDay)
from: var gameDay = dateForm.toLocaleDateString(‘en-US’, { weekday: ‘long’ });
to: var gameDay = dateForm.toLocaleDateString(‘pt-BR’, { weekday: ‘long’ });
from: 09:45 PM
to: 21:45
line: 35 (var gametime)
from: var gameTime = dateForm.toLocaleTimeString(‘en-US’, { hour: ‘2-digit’, minute:‘2-digit’ });
to: var gameTime = dateForm.toLocaleTimeString(‘pt-BR’, { hour: ‘2-digit’, minute:‘2-digit’ });
Got it. To pick up java script changes in the card, you should clear the browser cache and refresh the page. Otherwise it usually continues to use the old card in the cache.
The API for bra.1 is only returning games for Sept 10 and 11th. Each API goes out a different number of days into the future. Looks like you have everything set up correctly, you just need to wait until you get closer to a game day in that league. Right now the API is only returning info for 4 upcoming games.
Championships and translation - OK, thank you.
Have to delete browser cache and delete refresh/login session tokens in HA panel - profile.
This may help you out! IN my read me it has the conference identifiers you need.
Thanks! I like the table format. Makes them really stand out. I’ll make sure I’m not missing any and include it in the next version.
I’m not sure where the first screen shot is coming from.
The second is what I would expect for Chicago. Right now the ESPN API is only returning info for two games, one on 9/30 and one on 10/1.
No games on 10/4 are being returned yet. Just wait.
I’m not sure how far in advance ESPN loads the upcoming NBA games but it will eventually show up. For the hockey preseason games on Sunday, it was literally a couple hours before puck drop.
The first screen is from the API URL, I thought I was retrieving the ID wrong, causing the not_found.
I will wait till something shows up to test.
Thanks!
Here’s the URL I use. Maybe you appended a date tag to get the info to return early?
https://site.api.espn.com/apis/site/v2/sports/basketball/nba/scoreboard
I dont know, but the second picture is from the integration itself, maybe not retrieving because some date…
Maybe we need to wait, since next CHI match is 1 week from now.