Home Assistant: How to Fix Tankerkönig After API Errors

When the fuel price sensors of the Tankerkönig integration in Home Assistant suddenly switch to “unavailable” or throw errors like “Unknown error occurred”, it is usually due to temporary API server outages. Even if your API key shows as active on their website, the integration often gets stuck in an error state. With just a few steps, you can get your data synchronizing again.

What You Need

  • A running Home Assistant installation
  • A configured Tankerkönig integration
  • Your personal API key from Tankerkönig

1. Check Server Availability

Before changing any settings, quickly check in your web browser whether the API website (creativecommons.tankerkoenig.de) is accessible. If the provider’s interface is experiencing hiccups, every request will fail right at the source. In this case, your only option is usually to wait until the servers start serving data again.

2. Reload the Integration

Once the API has recovered, Home Assistant does not always detect this automatically right away. A manual reload will immediately trigger the data query again.

  1. Navigate to the Tankerkönig integration in Home Assistant.
  2. Click the three-dot menu next to the integration.
  3. Click Reload.

3. Reconfigure the Integration

If you see a notice after an outage stating that authentication has expired—even though your key is still active—reconfiguring the integration can help. In this case, set up the integration again using your existing API key to reinitialize the connection cleanly.

4. Perform a System Restart

If the component remains unresponsive and you cannot search for new gas stations, perform a complete restart of the system.

Is It Working?

Check your dashboard cards or the entity list (an entity is a specific data point in Home Assistant, here the fuel price sensor). As soon as the connection is restored, the sensors will switch back from “unavailable” to the current fuel price.

Troubleshooting

  • “Unknown error occurred” during station search: This usually happens when the connection to the server drops during the search request. Wait a few minutes and try the search again.
  • “Authentication expired” message: After a server outage, this misleading message may appear even if the API key is still valid. Do not immediately request a new key; instead, reconfigure the integration using your existing key.
  • Entities remain permanently offline: Check the Home Assistant logs to see if the coordinator is reporting error messages from components/tankerkoenig that indicate external connection issues.

Once your fuel prices are restored, you can set up automations that notify your smartphone as soon as the fuel price at your local gas station drops below a certain threshold.

Sources: Forum: Simon42 – Forum, community-smarthome.com, github.com

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top