Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config flow to NMBS #35923

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 2 additions & 46 deletions source/_integrations/nmbs.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: NMBS
description: Instructions on how to integrate timetable data for traveling on the NMBS/SNCB Belgian Railway within Home Assistant.
ha_category:
- Transport
ha_config_flow: true
ha_iot_class: Cloud Polling
ha_release: 0.85
ha_codeowners:
Expand All @@ -18,52 +19,7 @@ related:

The `nmbs` {% term integration %} will create sensors for monitoring travel time and information between 2 stations.

## Configuration

To enable this {% term integration %}, add the following lines to your {% term "`configuration.yaml`" %} file.
{% include integrations/restart_ha_after_config_inclusion.md %}

```yaml
# 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](https://api.irail.be/stations/) which this integration uses internally.

{% configuration %}
station_from:
description: The station where the connection departs.
required: true
type: string
station_to:
description: The station where the connection arrives.
required: true
type: string
station_live:
description: Setting this will create another sensor to monitor the liveboard in a station.
required: false
type: string
exclude_vias:
description: Setting this will not show connections for which you have to transfer to another station.
required: false
type: boolean
default: false
name:
description: Name to use in the frontend.
required: false
type: string
default: "`NMBS`, `NMBS Live` for the liveboard sensor when set."
show_on_map:
description: Show the station on the map.
required: false
type: boolean
default: false
{% endconfiguration %}
{% include integrations/config_flow.md %}
frenck marked this conversation as resolved.
Show resolved Hide resolved

<p class='img'>
<img src='/images/screenshots/nmbs-card-example.png' />
Expand Down