Skip to content

New Share your ideas with the AWTRIX community. Keep your creations together in your account.

Sign in
FlowAWTRIX NG

[HomeAssistant] Gasprice / Spritpreis

On an AWTRIX display
[HomeAssistant] Gasprice / Spritpreis shown on an AWTRIX display
[HomeAssistant] Gasprice / Spritpreis · by Chiller

Use with Home Assistant

Current Fuel Prices from HomeAssistant Entity(ies) / Aktuelle Spripreis aus HomeAssistant-Entität(en)

Works with
Home Assistant
Topic
Miscellaneous
Includes
Flow · 1 icon
Download flow

Follow the author’s setup instructions below.

Flow description

Eine deutsche Anleitung befindet sich weiter unten.

HomeAssistant_Gasprice

Version 1.2


English

Instructions

The app displays the price from one or two Home Assistant entities with exactly two decimal places and a configurable currency symbol.

The 8×8 gasoline_pump icon is displayed on the left side. The price and currency symbol are centered together in the remaining area to the right of the icon. The display remains static and does not scroll.

All settings can be changed using the app's settings menu without modifying the source code.


Requirements

  • An AWTRIX NG device with Berry script support. The layout is designed for a 32×8 pixel display.
  • Home Assistant must be reachable from the AWTRIX device using its HTTP or HTTPS address.
  • One or two Home Assistant entities with a numeric state, for example 1.759. The price is read directly from the entity state, not from an attribute. The app does not perform currency or unit conversions.
  • A Long-Lived Access Token from your Home Assistant profile. Enter the token only in the app settings and do not include the Bearer prefix.

Settings

Setting Default Description
Home Assistant - URL https://homeassistant.local HomeAssistant-URL with http(s)://
Home Assistant - Long-lived access token Empty HomeAssistant - Long-lived access token. Enter it without the Bearer prefix.
HomeAssistant-Entity 1 sensor.XXX First Numerical Entity. Replace the example with your actual entity ID.
HomeAssistant-Entity 2 (optional) Empty Second Numerical Entity. If left empty, only the first entity is displayed.
Update Interval 10 minutes Time between requests for each entity. The minimum is 10 minutes and the maximum is 1440 minutes.
Currency symbol Choose between , $, £, ¥, and ¢. The selected symbol does not modify the numeric value.
Entity color White, #FFFFFF Color of the price, decimal separator, and the -- and ## placeholders.
Currency symbol color Green, #008A09 Color of the currency symbol.
Decimal separator Comma Choose between comma and dot. This affects the display only.

Icon

The 8×8 gasoline_pump icon must be available on the AWTRIX device.

If the icon is missing or cannot be displayed, the app shows NO! in the reserved icon area instead. The price display continues to work normally.


Display and Entity Switching

  • Two decimal places:
    For example, 1.759 is displayed as 1,76 €, while 2 is displayed as 2,00 € when the comma separator is selected.

  • Six-pixel-high font:
    On a 32×8-pixel display, one empty pixel row remains above and below the numbers and currency symbol.

  • Comma descender:
    When Comma is selected, the upper pixel of the comma is positioned on the number baseline. Its lower part extends one pixel row further down into the bottom row of the display. Only the comma uses this bottom row. When Dot is selected, the bottom row remains unused in the text area.

  • Fixed space for the icon:
    Eight pixel columns are reserved for the icon on the left, followed by one empty pixel column. The text is centered in the remaining area.

  • No scrolling or clipping:
    If a price does not fit completely within the available width, the app displays ## together with the selected currency symbol instead.
    For example, 99,99 € fits on a 32×8-pixel display, while 999,99 € does not.

If both entities are configured, they are displayed in the following order each time the app is shown:

Entity 1 → Entity 2 → Entity 1 → Entity 2 → …

The displayed entity changes only after the app has been left and is shown again. During a continuous display session, the same entity remains selected.

After a restart or after saving the settings, the sequence starts again with Entity 1.

Both values are requested in the background at the configured interval, even while another app is being displayed. Simply opening the app does not trigger an additional Home Assistant request.

If a response arrives late, it is always assigned to the correct entity.


Troubleshooting

Display or problem Meaning and next step
NO! The icon is missing or cannot be displayed. Check the name, file format, and size of the installed icon.
-- at startup No valid price has been received yet. Wait for the first response from Home Assistant.
-- remains displayed Check the Home Assistant address, token, entity ID, and numeric entity state. States such as unknown or unavailable, units included in the state, or connection errors also result in --.
## The price does not fit completely within the available width or is too large to display.
Only one price is displayed Check whether the second entity has been entered and saved. The entity changes the next time the app is shown.
Price does not update immediately Each entity is queried only after the configured interval has elapsed. The minimum interval is ten minutes.
HTTP 401 in the log Check that the complete token is correct and still valid. Enter it without Bearer.
HTTP 404 in the log Check the entity ID and the Home Assistant base URL.
HTTP 0 in the log No HTTP response was received. Check whether the Home Assistant address is reachable from the AWTRIX network.
Red ERR: Read the complete error message shown next to the script in the Scripts tab. When reporting an issue, copy and include the full message.
Installation rejected with 507 The available script storage is insufficient or fragmented. Restart the AWTRIX device and, if necessary, remove custom scripts that are no longer required.

An error affecting one entity replaces only that entity's price with --. A previously received valid value from the other entity remains unaffected.


Changelog

2026-09-24

  • 1.0: Initial release.
  • 1.1: Hardcoded the gasoline_pump icon; added the NO! fallback indicator when the icon cannot be loaded; adjusted the price display; added support for an optional second entity that alternates when the app is shown again.
  • 1.2: Adjusted the comma rendering; changed the NO! fallback indicator color to red.


Deutsch

Anleitung

Die App zeigt den Preis aus einer oder zwei Home-Assistant-Entities mit genau zwei Nachkommastellen und einem frei wählbaren Währungszeichen an.

Auf der linken Seite wird das 8×8-Icon gasoline_pump dargestellt. Preis und Währungszeichen werden gemeinsam im verbleibenden Bereich rechts neben dem Icon zentriert. Die Anzeige bleibt statisch und verwendet keine Laufschrift.

Alle Einstellungen können über das Zahnrad der App geändert werden. Eine Anpassung des Quellcodes ist nicht erforderlich.


Voraussetzungen

  • Eine AWTRIX NG mit Unterstützung für Berry-Skripte. Das Layout ist für ein 32×8-Pixel-Display ausgelegt.
  • Home Assistant muss von der AWTRIX aus über seine HTTP- oder HTTPS-Adresse erreichbar sein.
  • Eine oder zwei Home-Assistant-Entities mit einem numerischen Zustand, beispielsweise 1.759. Der Preis wird direkt aus dem Zustand der Entity gelesen, nicht aus einem Attribut. Die App führt keine Währungs- oder Einheitenumrechnung durch.
  • Ein langlebiges Zugriffstoken aus deinem Home-Assistant-Profil. Das Token wird ausschließlich in den App-Einstellungen eingetragen – ohne den Zusatz Bearer.

Einstellungen

Einstellung Vorgabe Bedeutung
Home Assistant - URL https://homeassistant.local HomeAssistant-URL mit http(s)://
Home Assistant - Long-lived access token Leer Langlebiges Home-Assistant-Zugriffstoken. Ohne den Zusatz Bearer eintragen.
HomeAssistant-Entity 1 sensor.XXX Erste Preis-Entity. Ersetze den Beispielnamen durch deine tatsächliche Entity-ID.
HomeAssistant-Entity 2 (optional) Leer Zweite Preis-Entity. Bleibt das Feld leer, wird ausschließlich die erste Entity angezeigt.
Update interval 10 Minuten Zeitraum zwischen den Abfragen einer Entity. Zulässig sind mindestens 10 und höchstens 1440 Minuten.
Currency symbol Auswahl zwischen , $, £, ¥ und ¢. Das Währungszeichen verändert den Zahlenwert nicht.
Entity color Weiß, #FFFFFF Farbe des Preises, des Dezimaltrennzeichens sowie der Platzhalter -- und ##.
Currency symbol color Grün, #008A09 Farbe des Währungszeichens.
Decimal separator Comma Auswahl zwischen Komma (Comma) und Punkt (Dot). Dies betrifft ausschließlich die Anzeige.

Icon

Auf der AWTRIX muss das 8×8-Icon gasoline_pump vorhanden sein.

Fehlt das Icon oder kann es nicht dargestellt werden, zeigt die App stattdessen NO! im reservierten Iconbereich an. Die Preisanzeige funktioniert weiterhin.


Anzeige und Wechsel zwischen Entities

  • Zwei Nachkommastellen:
    Beispielsweise wird 1.759 als 1,76 € und 2 als 2,00 € dargestellt, wenn als Dezimaltrennzeichen das Komma gewählt wurde.

  • Sechs Pixel hohe Schrift:
    Auf einem 32×8-Pixel-Display bleibt oberhalb und unterhalb der Zahlen sowie des Währungszeichens jeweils eine Pixelreihe frei.

  • Komma mit Unterlänge:
    Bei Auswahl von Comma liegt der obere Pixel des Kommas auf der Grundlinie der Zahl. Der Ausläufer reicht eine Pixelreihe tiefer bis in die unterste Displayzeile. Nur das Komma verwendet diese unterste Zeile. Bei Dot bleibt sie im Textbereich frei.

  • Fester Platz für das Icon:
    Auf der linken Seite sind acht Pixelspalten für das Icon reserviert. Danach folgt eine freie Pixelspalte. Der Text wird im verbleibenden Bereich zentriert.

  • Kein Scrollen und kein Abschneiden:
    Passt ein Betrag nicht vollständig in den verfügbaren Bereich, zeigt die App stattdessen ## zusammen mit dem gewählten Währungszeichen an.
    Beispielsweise passt 99,99 € auf ein 32×8-Pixel-Display, 999,99 € dagegen nicht.

Sind beide Entities eingetragen, wechseln sie bei jedem erneuten Einblenden der App in folgender Reihenfolge:

Entity 1 → Entity 2 → Entity 1 → Entity 2 → …

Der angezeigte Preis wechselt erst, nachdem die App verlassen und anschließend erneut eingeblendet wurde. Während eines durchgehenden Anzeigezeitraums bleibt dieselbe Entity ausgewählt.

Nach einem Neustart oder nach dem Speichern der Einstellungen beginnt die Reihenfolge wieder mit Entity 1.

Beide Werte werden im Hintergrund im eingestellten Intervall abgefragt – auch wenn gerade eine andere App angezeigt wird. Das Einblenden der App selbst löst keine zusätzliche Home-Assistant-Abfrage aus.

Trifft eine Antwort verzögert ein, wird sie immer der zugehörigen Entity zugeordnet.


Fehlerbehebung

Anzeige oder Problem Bedeutung und nächster Schritt
NO! Das Icon fehlt oder kann nicht dargestellt werden. Prüfe Namen, Dateiformat und Größe des installierten Icons.
-- beim Start Es wurde noch kein gültiger Preis empfangen. Warte auf die erste Antwort von Home Assistant.
-- bleibt bestehen Prüfe Home-Assistant-Adresse, Token, Entity-ID und den numerischen Zustand der Entity. Auch unknown, unavailable, Einheiten innerhalb des Zustands oder Verbindungsfehler führen zu --.
## Der Betrag passt nicht vollständig in die verfügbare Breite oder ist für die Anzeige zu groß.
Nur ein Preis erscheint Prüfe, ob die zweite Entity eingetragen und gespeichert wurde. Der Wechsel erfolgt erst beim nächsten Einblenden der App.
Preis aktualisiert sich nicht sofort Eine reguläre Abfrage erfolgt für jede Entity frühestens nach Ablauf des eingestellten Intervalls. Das Mindestintervall beträgt zehn Minuten.
HTTP 401 im Log Prüfe, ob das vollständige Token korrekt und weiterhin gültig ist. Trage es ohne Bearer ein.
HTTP 404 im Log Prüfe die Entity-ID und die Home-Assistant-Basisadresse.
HTTP 0 im Log Es wurde keine HTTP-Antwort empfangen. Prüfe, ob die Home-Assistant-Adresse aus dem Netzwerk der AWTRIX erreichbar ist.
Rotes ERR: Lies die vollständige Fehlermeldung neben dem Skript im Tab Scripts. Kopiere sie bei einer Fehlermeldung oder Supportanfrage vollständig mit.
Installation wird mit 507 abgelehnt Der verfügbare Skriptspeicher reicht nicht aus oder ist fragmentiert. Starte die AWTRIX neu und entferne gegebenenfalls nicht mehr benötigte eigene Skripte.

Ein Fehler bei einer Entity ersetzt ausschließlich deren Preis durch --. Ein bereits erfolgreich empfangener Wert der anderen Entity bleibt davon unberührt.


Changelog

24.09.2026

  • 1.0: Erste Veröffentlichung.
  • 1.1: Icon fest auf gasoline_pump gesetzt; Fallback-Anzeige NO! hinzugefügt, falls das Icon nicht geladen werden kann; Preisdarstellung angepasst; optionale zweite Entity mit Wechsel beim erneuten Einblenden der App hinzugefügt.
  • 1.2: Darstellung des Kommas angepasst; Farbe des Fallback-Symbols NO! auf Rot geändert.

More flows for Home Assistant or Miscellaneous

Something wrong with this flow? Report it.