A custom Lovelace card for Home Assistant to display fuel prices from Tankerkönig sensors.
- Displays prices for multiple fuel stations from the Tankerkönig integration.
- Sort stations by price for a specific fuel type.
- Show only the cheapest station based on a selected fuel type.
- Show/hide station address and last updated timestamp.
- Customize the order of displayed fuel types.
- Show indicators for price increases or decreases.
- Hide stations that are currently closed.
- Fully customizable through the visual editor.
- Easy station selection using the visual editor.
- Overwrite default logos with custom image URLs.
The editor is available in the following languages:
- English
- German
Contributing Translations
If you would like to contribute a new translation:
- Fork the repository on GitHub.
- In the
src/translationdirectory, copyen.jsonand rename it to your language code (e.g.,fr.jsonfor French). - Translate all the values in the new file.
- Submit a pull request with your changes.
This card is available in the Home Assistant Community Store (HACS).
Manual Installation
- Download the
tankerkoenig-card.jsfile from the latest release. - Place it in your
config/wwwdirectory. - Add the resource reference to your Lovelace configuration under
Settings->Dashboards->...->Resources.- URL:
/local/tankerkoenig-card.js - Resource Type:
JavaScript Module
- URL:
You can now add the card to your dashboard.
The card automatically displays logos for many gas station brands. The logo is determined by the brand attribute of your sensor.
Some of the supported brands include:
- Agip eni
- Aral (incl. Jantzon)
- Avia
- Bell Oil
- BFT
- Calpam
- citi oil
- Classic
- E Center
- ELAN
- Esso
- Globus
- HEM
- Hessol
- Hornbach
- Jet
- Joiss
- Minera / Minera Automatenstation
- MOL
- Mr.Wash
- MTB
- OIL!
- OMV
- Raiffeisen
- RAN
- Shell
- Star
- Total
- Total Energies
- V-Markt
If a logo for a specific brand is missing, the card will show a generic fallback logo. You can check the src/gasstation_logos directory for a full list of available logos.
If you are missing a logo, please open an issue and provide the brand name (entity attribute).
To achieve the digital clock-style font for the prices as seen in the screenshots, you need to add the stylesheet to your Lovelace resources.
- Copy the
stylesheet.cssfile from thedistfolder of this repository into yourconfig/www/community/lovelace-tankerkoenig-card/directory. - Add the stylesheet as a resource in Home Assistant under
Settings->Dashboards->⋮(top right) ->Resources.- URL:
/hacsfiles/lovelace-tankerkoenig-card/stylesheet.css - Resource Type:
Stylesheet (CSS)
- URL:
| Name | Type | Default | Description |
|---|---|---|---|
type |
string | Required | custom:tankerkoenig-card |
title |
string | (none) |
The title of the card. |
stations |
list (string or object) | Required | A list of device IDs. To set a custom name or logo, use an object: { device: '...', name: '...', logo: '...' }. |
show_street |
boolean | true |
Show the street and house number of the station. |
show_postcode |
boolean | true |
Show the postcode of the station. |
show_city |
boolean | true |
Show the city of the station. |
show_last_updated |
boolean | false |
Show the last updated timestamp for the station. |
show_price_changes |
boolean | false |
Show an indicator for price increases or decreases. |
fuel_types |
list ('e5' | 'e10' | 'diesel') | ['diesel', 'e10', 'e5'] |
The order in which to display the fuel types. |
hide_unavailable_stations |
boolean | false |
Hide stations that are currently closed. |
sort_by |
'e5' | 'e10' | 'diesel' | 'none' | 'none' |
Sort stations by the price of the selected fuel type. |
show_only_cheapest |
boolean | false |
Show only the cheapest station. Requires sort_by to be set to a fuel type. |
show_prices_side_by_side |
boolean | false |
Force prices to be displayed side-by-side on mobile devices. |
price_bg_color |
string | var(--divider-color) |
The background color of the price display. |
price_font_color |
string | var(--primary-text-color) |
The font color of the price display. |
font_scale |
number | 100 |
A percentage to scale the font size of the price and fuel type (e.g., 80 for 80%). |
| Name | Type | Required | Description |
|---|---|---|---|
device |
string | Required | The device ID of the Tankerkönig station. |
name |
string | (none) |
A custom name to overwrite the default station name. |
logo |
string | (none) |
A URL to a custom logo for the station. |
type: custom:tankerkoenig-card
title: Fuel Prices
show_street: true
show_postcode: true
show_city: true
show_last_updated: true
show_price_changes: true
sort_by: e10
fuel_types:
- e10
- e5
- diesel
stations:
# Station with default logo
- 2bf48bbf7b0c6a5d40ac7c0dfa2c4178
# Station with custom logo
- device: 99a4943a53c159a2995573795447463d
logo: /local/my-custom-logo.png
# Station with custom name
- device: 99a4943a53c159a2995573795447463d
name: My Favorite StationTo contribute to the development, you'll need to set up a build environment.
-
Clone the repository:
git clone https://github.com/timmaurice/lovelace-tankerkoenig-card.git cd lovelace-tankerkoenig-card -
Install dependencies:
npm install
-
Start the development server: This command will build for changes in the
srcdirectory and rebuild the card.npm run build
-
In your Home Assistant instance, you will need to configure Lovelace to use the local development version of the card from
dist/tankerkoenig-card.js.
For further assistance or to report issues, please visit the GitHub repository.
