README.md

May 11, 2026 · View on GitHub

Logo

DB-Infoscreen for Home Assistant 🚆

A comprehensive departure board integration for Home Assistant.

HACS Default GitHub Release License


❤️ Support This Project

I maintain this integration in my free time alongside my regular job — bug hunting, new features, and testing on real hardware. Test devices cost money, and every donation helps me stay independent and free up more time for open-source work.

Donations are completely voluntary — but the more support I receive, the less I depend on other income sources and the more time I can realistically invest into these GitHub projects. 💪

GitHub Sponsors   PayPal


The db-infoscreen integration provides detailed departure times and train information for a given station directly in Home Assistant. Aggregating data from multiple sources (primarily Deutsche Bahn IRIS-TTS), it offers a powerful and comprehensive departure board for stations across Germany and Europe.

📚 View the Full Documentation

Departure Board

🏠 Home Assistant App (Add-on)

This integration is best used with the DBF (DB-Infoscreen) App. While the integration can fetch data from public APIs, running your own local instance via the add-on provides more reliability and a dedicated Web UI.

  • DBF Add-on Repository
  • Features: Dedicated departure board UI, automated wagon order updates, and self-hosted API.

✨ Features

FeatureDescription
📋 Departure BoardView next departures, delays, platforms, and train types.
👥 Train OccupancyView predicted load factor (1st/2nd class) where available.
🌍 Wide CoverageSupports DB and many local transport associations (via HAFAS/EFA).
⚙️ Highly ConfigurableFilter by direction, train type, specific platforms, and more.
💖 Favorite TrainsFilter for specific "Favorite Trains" (Commuter Profile).
⏸️ Pause UpdatesStop periodic data fetches to save API queries. Includes is_paused attribute and binary sensor for UI logic.
🔍 Diagnostic SensorsMonitor API connection, update status, and station accessibility (elevators).
ℹ️ Detailed AttributesAccess route info, warnings, platform changes (changed_platform), wagon order (wagon_order), wagon order summary (wagon_order_html), sector info (platform_sectors), facilities (facilities), real-time route progress (route_details), and unique trip ID (trip_id).

🛠️ Installation

This integration is available as a default repository in HACS.

  1. Open HACS.
  2. Search for db-infoscreen.
  3. Click Download.
  4. Restart Home Assistant.

Open HACS

Tip

HACS ensures you stay up-to-date with the latest API changes and bug fixes.

2. Manual Installation

  1. Download the latest Release.
  2. Extract the ZIP file.
  3. Copy the db_infoscreen folder into your <config>/custom_components/ directory.
  4. Restart Home Assistant.

⚙️ Configuration

  1. Go to Settings -> Devices & Services.
  2. Click Add Integration.
  3. Search for DB Infoscreen.

Add Integration

Configuration Options

Initial Setup: When adding the integration, you will be asked for the most important settings:

OptionTypeRequiredDescription
stationstringYesStation name (e.g. München Hbf), DS100 ID (e.g. MH), or EVA ID. The setup flow includes an autocomplete search to help find the correct official name.
data_sourcestringNoBackend source (DB, AVV, etc.). Default: IRIS-TTS.
next_departuresintNoNumber of upcoming departures to display. Default: 4.
platformsstringNoFilter by comma-separated platforms (e.g., 1, 2, 5).
via_stationsstringNoFilter by stations the train must pass through.
via_stations_logicstringNoLogic for multiple via stations (OR / AND). Default: OR.
directionstringNoFilter by direction text (API dependent).

Options Menu (Configure): All other settings are available via the Configure button on the integration entry. They are grouped into:

  • General: Update Interval, Offset, Count.
  • Filter: Directions, Train Types (e.g. ICE), Exclusions.
  • Display: Text View, Mode (Departure/Arrival), Detailed Info.
  • Advanced: Custom API URL, Deduplication, Route Details.

Full Options List

OptionDefaultDescription
update_interval3Fetch interval in minutes. Minimum: 1 minute.
hide_low_delayFalseHide departures with < 5 min delay.
drop_late_trainsFalseHide past departures even if they are delayed.
deduplicate_departuresFalseFilter out duplicate entries.
detailedFalseShow extra attributes (messages, ids, keys, wagon order, etc.).
past_60_minutesFalseShow departures from the past 60 minutes.
keep_routeFalseKeep full route (stopover) details in attributes.
keep_endstationFalseKeep departure if station is also the endstation.
custom_api_url-Use a private/custom API instance.
offset00:00Time offset for search (HH:MM or HH:MM:SS).
admodedepartureDisplay departure or arrival times.
pausedFalsePause periodic updates (Stop data fetching).
excluded_directions-Exclude departures with specific direction (substring match).
ignored_train_types[]List of train types to ignore.
enable_text_viewFalseEnable simplified text view for ePaper displays.
text_view_template(Default)Template for the simplified text view (e.g., {line};{destination};{platform};{time}).
deduplicate_key(Default)Template for the unique trip identifier used for deduplication. Default: {journeyID}{journeyId}{id}{key}{trainNumber}.

Tip

Deduplication for KVV If you are using Karlsruher Verkehrsverbund (KVV) and see duplicate entries for different platforms, try setting the deduplicate_key to {line} or {key}. The default key may be too specific because the KVV API includes the scheduled time in the trip ID.

Warning

Limitations & Performance

  • Sensor Limit: You are limited to 30 sensors unless using a custom_api_url.
  • Update Interval: Minimum is 1 minute to prevent API bans/throttling.
  • Storage: Enabling detailed, keep_route, or a high number of next_departures can hit Home Assistant's state storage limits. See Issue #22.
  • Data Accuracy: Depends on the selected data_source.

🛠️ Services

ServiceDescription
watch_trainMonitor a specific train and notify on delay/platform changes.
track_connectionMonitor a connecting train at a transfer station.
set_pausedToggle periodic updates for one or more stations (Smart Pausing).
set_offsetDynamically override the departure time offset temporarily.
refresh_departuresManually trigger a data update for all stations.

📡 Data Sources

This integration allows fetching data from various backend sources via DBF.

👇 Click to expand the full list of supported Data Sources

Supported Data Sources

🇩🇪 Germany

  • IRIS-TTS (Deutsche Bahn) - Default / Recommended
  • AVV – Aachener Verkehrsverbund
  • AVV – Augsburger Verkehrs- & Tarifverbund
  • BEG – Bayerische Eisenbahngesellschaft
  • BSVG – Braunschweiger Verkehrs-GmbH
  • BVG – Berliner Verkehrsbetriebe
  • DING – Donau-Iller Nahverkehrsverbund
  • KVB – Kölner Verkehrs-Betriebe
  • KVV – Karlsruher Verkehrsverbund
  • MVV – Münchener Verkehrs- und Tarifverbund
  • NAHSH – Nahverkehrsverbund Schleswig-Holstein
  • NASA – Personennahverkehr in Sachsen-Anhalt
  • NVBW – Nahverkehrsgesellschaft Baden-Württemberg
  • NVV – Nordhessischer Verkehrsverbund
  • NWL – Nahverkehr Westfalen-Lippe
  • RMV – Rhein-Main-Verkehrsverbund
  • RSAG – Rostocker Straßenbahn
  • RVV – Regensburger Verkehrsverbund
  • SaarVV – Saarländischer Verkehrsverbund
  • VAG – Freiburger Verkehrs AG
  • VBB – Verkehrsverbund Berlin-Brandenburg
  • VBN – Verkehrsverbund Bremen/Niedersachsen
  • VGN – Verkehrsverbund Großraum Nürnberg
  • VMT – Verkehrsverbund Mittelthüringen
  • VMV – Verkehrsgesellschaft Mecklenburg-Vorpommern
  • VOS – Verkehrsgemeinschaft Osnabrück
  • VRN – Verkehrsverbund Rhein-Neckar
  • VRR – Verkehrsverbund Rhein-Ruhr
  • VRR2 – Verkehrsverbund Rhein-Ruhr
  • VRR3 – Verkehrsverbund Rhein-Ruhr
  • VVO – Verkehrsverbund Oberelbe
  • VVS – Verkehrs- und Tarifverbund Stuttgart
  • bwegt – bwegt

🌍 International

  • BART – Bay Area Rapid Transit
  • BLS – BLS AG
  • CFL – Société Nationale des Chemins de Fer Luxembourgeois
  • CMTA – Capital Metro Austin Public Transport
  • DSB – Rejseplanen
  • IE – Iarnród Éireann
  • LinzAG – Linz AG
  • PKP – Polskie Koleje Państwowe
  • Resrobot – Resrobot
  • Rolph – Rolph
  • STV – Steirischer Verkehrsverbund
  • TPG – Transports publics genevois
  • ZVV – Züricher Verkehrsverbund
  • mobiliteit – mobilitéits zentral
  • ÖBB – Österreichische Bundesbahnen

Note: To use HAFAS for stations also found in IRIS-TTS (e.g. "Frankenforst Kippekausen"), choose the specific backend or set hafas=1. See Issue #8.


📦 Migration from ha-deutschebahn

Direct migration is not possible due to API differences. The old integration supported "Start to Destination" routing, which db-infoscreen handles differently.

To replicate "Start -> Destination" behavior:

  1. Via Stations: Use via_stations to filter trains going through your destination or key stops.

    • Single Station: If only one station is entered, filtering is performed server-side (at the API) for maximum efficiency.

    • Multiple Stations: If multiple stations are entered, the sensor switches to local filtering to support complex logic.

    • Logic (AND/OR):

      • OR (Default): Includes trains passing through at least one of the specified stations. Ideal for stations with multiple platform names (e.g., "Frankfurt Hbf" vs "Frankfurt Hbf (tief)").
      • AND: Includes only trains passing through all specified stations.
  2. Platforms: Filter by platform if trains to your destination always use specific tracks.

  3. Two Sensors: Create two sensors (one for Start, one for typical changeover stations) to track complex routes.


📊 Usage & Examples

For a detailed set of examples including platform change alerts, occupancy warnings, and advanced filtering, check out our Automation Cookbook.

Basic Automations

Notify when the next train is delayed:

automation:
  - alias: "Train Delay Notification"
    trigger:
      - platform: template
        value_template: "{{ state_attr('sensor.station_departures', 'next_departures')[0]['delayArrival'] | int > 10 }}"
    action:
      - service: notify.mobile_app
        data:
          message: >
            The train to {{ state_attr('sensor.station_departures', 'next_departures')[0]['destination'] }}
            is delayed by {{ state_attr('sensor.station_departures', 'next_departures')[0]['delayArrival'] }} min.

Custom Template Sensors

Display next connection in HH:MM +Delay format: (Credit: kRew94 & kaffeetrinker71)

sensor:
  - platform: template
    sensors:
      next_train_formatted:
        friendly_name: "Next Train"
        value_template: >
          {% set conn = state_attr('sensor.uelzen_departures_via_hannover_hbf', 'next_departures') | selectattr('isCancelled', 'equalto', 0) | list | first %}
          {% if conn %}
            {{ conn.train }} at {{ conn.scheduledDeparture }}{% if conn.delayDeparture > 0 %} +{{ conn.delayDeparture }}{% endif %}
          {% else %}
            No connection
          {% endif %}

Result: "ICE 2935 at 07:15 +5"

👇 Advanced: Filter Connections by Destination (Start -> Destination)

(Credit: Kanecaine) This example demonstrates how to filter connections from a station (e.g. Berlin Hbf) to a specific target (e.g. Leipzig Hbf) that must be in the train's route.

{%- set my_station = "Berlin Hbf" -%}
{%- set target = "Leipzig Hbf" -%}
{%- set number = 0 -%}
{%- set connections = state_attr('sensor.berlin_hbf_departures', 'next_departures') | default([]) | selectattr('isCancelled', 'equalto', 0) -%}
{%- set valid_connections = namespace(connections=[]) -%}
{%- for connection in connections -%}
  {%- set route = connection.route | default([]) | selectattr('name', 'defined') | map(attribute='name') | list -%}
  {%- if my_station in route and target in route and route.index(target) > route.index(my_station) -%}
    {%- set valid_connections.connections = valid_connections.connections + [connection] -%}
  {%- endif -%}
{%- endfor -%}

{%- if valid_connections.connections | length > number -%}
  {%- set connection = valid_connections.connections[number] -%}
  {%- set product_raw = connection.train | default('Unknown') -%}
  {%- set product = product_raw | regex_replace('^(Bus).*|^([A-Z]{2})\\s?\\d*', '\\1\\2') | replace("S ", "S") -%}
  {%- set departure = connection.scheduledDeparture | default('--') -%}
  {%- set delay = connection.delayDeparture | default(0) | int -%}
  {{ product }} {{ departure }}{% if delay > 0 %} +{{ delay }}{% endif %}
{%- else -%}
  --
{%- endif -%}

JSON Data Structure

The integration attributes provide data in JSON format. Use this to build your own templates.

👇 View JSON Example
{
  "departures": [
    {
      "scheduledArrival": "08:08",
      "destination": "München-Pasing",
      "train": "S 4",
      "platform": "4",
      "delayArrival": 18,
      "messages": {
        "delay": [
          {"text": "delay of a train ahead", "timestamp": "2025-01-21T07:53:00"}
        ]
      }
    }
  ]
}

Frontend Cards

For a beautiful dashboard display, check out these custom cards:


🐛 Troubleshooting & Support

  • Reporting Issues: Please report bugs on GitHub Issues.

  • Debug Logging: To help diagnose issues, enable debug logging in configuration.yaml:

    logger:
       logs:
          custom_components.db_infoscreen: debug
    

❤️ Credits