forked from zacs/ha-nfl
-
Notifications
You must be signed in to change notification settings - Fork 20
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 entries 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 time. |
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
- If the
api_message
is "No game scheduled..."- The API is working and returned data. The dates in the message indicate the date range for which schedule data is being returned by the API. The dates and times are UTC, not local.
- If there are no games scheduled in the date range, you are Scenario 1. Wait for the API to load more games.
- If there are games scheduled in the date range, 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 determine the specific API that is being used, and inspect the payload returned by it.
- If the
api_message
is "API error, not data returned". There should be a warning message in the log files starting with "API did not return any data..." This warning message will contain the full URL of the API being used.- 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 a browser to troubleshoot further.