home-assistant.io/source/_integrations/tankerkoenig.markdown
Michael c5c8243ea5
Improve Tankerkoenig docs (#38662)
* improve docs

* add missing option

* Apply suggestions from code review

* tiny style tweaks

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2025-04-22 08:23:17 +02:00

4.2 KiB
Executable File

title, description, ha_category, ha_release, ha_iot_class, ha_domain, ha_codeowners, ha_platforms, ha_config_flow, related, ha_integration_type
title description ha_category ha_release ha_iot_class ha_domain ha_codeowners ha_platforms ha_config_flow related ha_integration_type
Tankerkoenig Instructions on how to integrate Tankerkoenig sensors within Home Assistant.
Energy
Sensor
0.107 Cloud Polling tankerkoenig
@guillempages
@mib1185
@jpbede
binary_sensor
diagnostics
sensor
true
docs title
/common-tasks/general/#defining-a-custom-polling-interval Defining a custom polling interval
integration

The tankerkoenig integration allows you to monitor the fuel prices with tankerkoenig.de from within Home Assistant and setup automations based on the information.

Prerequisites

To use this integration, you need an API key from tankerkoenig.

  1. Go to tankerkoenig API and in the top right, select API-KEY.
  2. Fill out the form and request a free API key.

{% important %} The Terms & Conditions of tankerkoenig.de specify that the API is not meant for massive data fetching, but it does not explicitly mention a limit. Having a maximum of 10 monitored fuel stations is recommended, and a warning will be issued otherwise. If you consider to define a custom polling interval, then please keep in mind that requests should be limited to less than once every 5 minutes. {% endimportant %}

{% include integrations/config_flow.md %}

{% configuration_basic %} Region name: description: "The name of the particular region to be added." API Key: description: "The tankerkoenig API-KEY to be used (see Prerequisites)." Location: description: "Pick the location where to search for gas stations (defaults to the location of your Home which was et during onboarding)" Search radius: description: "The radius in kilometers to search for gas stations around the selected location (default: 2km)" Stations: description: "Select the gas stations you want to add to Home Assistant." {% endconfiguration_basic %}

{% include integrations/option_flow.md %}

{% configuration_basic %} Stations: description: "Select the gas stations you want to add to Home Assistant." Show stations on map: description: "Weather to show the station sensors on the map or not." {% endconfiguration_basic %}

Data updates

This integration fetches the data every 30 minutes from the tankerkoenig API.

Provides entities

This integrations provides a set of {% term "Binary sensor" %} and {% term Sensor %} entities for each selected gas station.

Sensors Description
Status Indicates if the gas station is opened or closed at the moment.
Diesel The current price of Diesel fuel.
Super The current price of Super fuel.
Super E10 The current price of Super E10 fuel.

{% note %} As the data of tankerkoenig.de is based on data from the German market transparency office for fuels (Markttransparenzstelle für Kraftstoffe MTS-K), only the three base fuel types Diesel, Super, and Super E10 are available. {% endnote %}

Usage examples

Show current fuel price only when station is opened

The example below uses the common sensor card in the {% term frontend %} and adds a visibility condition.

graph: line
type: sensor
entity: sensor.my_favorite_gas_station_super
detail: 1
name: Favorite Gas Station
visibility:
  - condition: state
    entity: binary_sensor.my_favorite_gas_station_status
    state: "on"

Troubleshooting

Before reporting an issue, enable debug logging and restart the integration. As soon as the issue re-occurs, stop the debug logging again (download of debug log file will start automatically). Further, if still possible, download the {% term diagnostics %} data. If you have collected the debug log and the diagnostics data, include them in the issue report.

Remove the integration

{% include integrations/remove_device_service.md %}