forked from zacs/ha-nfl
-
Notifications
You must be signed in to change notification settings - Fork 23
Troubleshooting: State = NOT_FOUND
David edited this page Oct 1, 2022
·
11 revisions
The state can be NOT_FOUND for multiple reasons. You can use a combination of the api_message attribute on the sensor, your knowledge of the upcoming schedule, and messages in the Home Assistant logs to diagnose the root cause and determine what action to take.
Scenario | Frequency | Explanation | Corrective Action | |
---|---|---|---|---|
1 | Upcoming game not yet available from API | Most Common | Depending on the sport/league, the ESPN API may only return games scheduled 1-2 days into the future. This is most common for sports with mid-week games. It is possible everything is set up correctly and the API is simply not returning information on the desired game because it is too far in the future. For some sports, the game will not be loaded until 24 hours or less before the game. | Wait until closer to game day. |
2 | Incorrect team abbreviation | Common | An incorrect abbreviation is used for a team | Correct the team abbreviation |
3 | Missing or incorrect Conference ID specified | Common | For NCAA football and basketball, by default the API will only return games involving ranked teams. For unranked teams, you must specify a Conference ID. | Specify the correct Conference ID. See README for details. |
4 | Incorrect league abbreviation | Occasionally | An incorrect abbreviation is used for a league when setting up in YAML | Correct the league abbreviation |
5 | Invalid API | Rare | The URL generated by a custom API is not valid | Correct the sport_path or league_path specified in the custom API definition |
6 | API Error | Rare | Your internet or the API is down | Check your internet connection and then wait until the API comes back up |
Diagnostic Steps
- The
api_message
is "No data for competitor ({team_abbr
}) from {date-time-1
} through {date-time-2
}"- If there are no games scheduled between {
date-time-1
} and {date-time-2
}, you are Scenario 1. Wait. - If there are games scheduled between the dates, you are Scenario 2 or 3. Determine the correct team abbreviation and/or conference ID to use. To help troubleshoot further, you can turn on DEBUG logging, inspect the logs to see what API is being used, and inspect the payload returned by it.
- If there are no games scheduled between {
- The
api_message
is "API did not return any data". There is a warning message in the log files starting with "API did not return any data"- If the API has "league_not_found" in it, you are Scenario 4. Correct the league ID in the YAML.
- If the API is something else, you are Scenario 5 or 6. Test the API directly in an browser to troubleshoot further.