RMV
The rvmtransport
integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] will give you the departure time of the next bus, tram, subway or train at the next station or stop in the Rhein-Main area public transport network. Additional details such as the line number and destination are present in the attributes.
Setup
Visit the RMV OpenData web site
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.yaml
The 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.yaml
The 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: rmvtransport
next_departure:
- station: STATION_OR_STOP_ID
Configuration Variables
One or multiple departure sensors.
One or multiple final stop names, e.g., ‘Frankfurt (Main) Hauptbahnhof’ or [‘Frankfurt (Main) Hauptbahnhof’,‘Frankfurt (Main) Stadion’]. This can be used to only consider a particular direction of travel.
Name of a stop or station, e.g., ‘Frankfurt (Main) Hauptbahnhof’. This can be used to only consider a particular direction of travel.
One or more modes of transport ['U-Bahn', 'Tram', 'Bus', 'S', 'RB', 'RE', 'EC', 'IC', 'ICE']
.
[“U-Bahn”, “Tram”, “Bus”, “S”, “RB”, “RE”, “EC”, “IC”, “ICE”]
Do not display departures leaving sooner than this number of minutes. Useful if you are a couple of minutes away from the stop.
Examples
Full configuration
The example below shows a full configuration with three sensors that showcase the various configuration options.
# Example configuration.yaml entry
sensor:
- platform: rmvtransport
scan_interval: 120
timeout: 10
next_departure:
- station: 3000010
time_offset: 5
destinations:
- 'Frankfurt (Main) Flughafen Regionalbahnhof'
- 'Frankfurt (Main) Stadion'
products:
- 'RB'
- 'RE'
- 'Bus'
- 'S'
- station: 3006907
products: "Bus"
destinations: ['Wiesbaden Dernsches Gelände', 'Mainz Hauptbahnhof']
name: Destination
- station: 3006904
lines: "S8"
max_journeys: 5
products: "S"
The first sensor will return S-Bahn, bus, RB and RE trains departures from Frankfurt Hauptbahnhof to Frankfurt Airport or Stadium that are at least 5 minutes away.
The second sensor returns bus departures from Wiesbaden Hauptbahnhof going to Dernsches Gelände and Mainz Hauptbahnhof. To retrieve the time of the second departure, you would use state_attr('sensor.ENTITY_NAME', 'departures')[1].time
.
The third sensor returns all S-Bahn trains from Mainz Hauptbahnhof for line S8.