NMBS

The nmbs integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] will create sensors for monitoring travel time and information between 2 stations.

Configuration

To enable this integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more], add the following lines to your configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file. After changing the configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file, restart Home Assistant to apply the changes. The integration is now shown on the integrations page under Settings > Devices & services. Its entities are listed on the integration card itself and on the Entities tab.

# Example configuration.yaml entry
sensor:
  - platform: nmbs
    station_from: "STATION_1"
    station_to: "STATION_2"
    station_live: "STATION_1"
    exclude_vias: true

The stations can only be provided by their standard names and not ids. The list of stations can be checked on the NMBS/SNCB website but for most accurate results check them on the iRail API page which this integration uses internally.

Configuration Variables

station_from string Required

The station where the connection departs.

station_to string Required

The station where the connection arrives.

station_live string (Optional)

Setting this will create another sensor to monitor the liveboard in a station.

exclude_vias boolean (Optional, default: false)

Setting this will not show connections for which you have to transfer to another station.

name string (Optional)

Name to use in the frontend.

Default:

NMBS, NMBS Live for the liveboard sensor when set.

show_on_map boolean (Optional, default: false)

Show the station on the map.

Example using the Entity Attributes custom card