home-assistant.io/source/_components/entur_public_transport.markdown
Franck Nijhof c464056402
Making our website faster, cleaner and prettier (#9853)
* 🔥 Removes octopress.js

* 🔥 Removes use of root_url var

* 🔥 Removes Octopress generator reference from feed

* 🔥 Removes delicious support

* 🔥 Removes support for Pinboard

* 🔥 Removes support for Disqus

* 🔥 Removes support for Google Plus

* ↩️ Migrate custom after_footer to default template

* ↩️ Migrate custom footer to default template

* ↩️ Migrate custom header to default template

* 🔥 Removes unused template files

* 🚀 Places time to read directly in post template

* 🚀 Removes unneeded capture from archive_post.html template

* 🔥 🚀 Removes unused, but heaving sorting call in component page

* 🚀 Merged javascripts into a single file

* 🔥 Removes more uses of root_url

* 🚀 Removal of unneeded captures from head

* 🔥 🚀 Removal of expensive liquid HTML compressor

* 🔥 Removes unneeded templates

* 🚀 Replaces kramdown with GitHub's CommonMark 🚀

* 💄 Adds Prism code syntax highlighting

*  Adds support for redirect in Netlify

* ↩️ 🔥 Let Netlify handle all developer doc redirects

* ✏️ Fixes typo in redirects file: Netify -> Netlify

* 🔥 Removes unused .themes folder

* 🔥 Removes unused aside.html template

* 🔥 Removes Disqus config leftover

* 🔥 Removes rouge highlighter config

* 🔥 Removes Octopress 🎉

* 💄 Adjust code block font size and adds soft wraps

* 💄 Adds styling for inline code blocks

* 💄 Improve styling of note/warning/info boxes + div support

* 🔨 Rewrites all note/warning/info boxes
2019-07-15 22:17:54 +02:00

5.1 KiB

title, description, logo, ha_category, ha_release, ha_iot_class, redirect_from
title description logo ha_category ha_release ha_iot_class redirect_from
Entur public transport Instructions for how to set up monitoring of public transport departures in Norway. entur.svg
Transport
0.84 Cloud Polling
/components/sensor.entur_public_transport/

The entur_public_transport sensor gives real-time departure information for the next departures from any bus stop, car ferry quay, train station, airport and person ferries quay in Norway.

For each stop place given in the configuration, a sensor will be mounted for that stop place. It will give remaining minutes until the nearest departure in the state, but also next departures in the attributes. Information about if the departure is monitored in real-time or is from scheduled times, and how many minutes there is in delays, are included as well.

Real-time data is fetched from Entur. Entur is a service which collects and delivers information about all public transport available in Norway under an open source license.

Note that the underlying API is rate limited and to avoid getting your instance blocked from entur the sensor is only fetching new information every 45 seconds. It's recommended to not schedule updates more often than this.

Configuration

# Example configuration.yaml entry
sensor:
  - platform: entur_public_transport
    stop_ids:
      - 'STOP_ID_1'
      - 'STOP_ID_2'

{% configuration %} stop_ids: description: List of stop places or platforms to monitor departure times from. required: true type: list name: description: Override parts of the sensor name. required: false type: string default: Entur expand_platforms: description: If additional sensors should be created for each platform under a stop place. required: false type: boolean default: true show_on_map: description: If platform locations should be added to the sensor, and the map. required: false type: boolean default: false line_whitelist: description: List of lines that should be whitelisted in the resulting sensors, and will only show when the defined lines are expected to leave the platform or station. All lines that you want on any of the sensors should be included in the list. required: false type: list omit_non_boarding: description: If the sensors should remove resulting departures that doesn't take new passangers, or is at last stop. required: false type: boolean default: true number_of_departures: description: The number of departures that should be shown in the sensor attributes. Maximum 10, Minimum 2. required: false type: integer default: 2 {% endconfiguration %}

Example usage

Example of multiple stop places, with expanded sensors for each platform under the station, and with the platforms added to the map.

# Example configuration.yaml entry
sensor:
  - platform: entur_public_transport
    name: Transport
    expand_platforms: true
    show_on_map: true
    stop_ids:
      - 'NSR:StopPlace:548'   # Bergen train station
      - 'NSR:StopPlace:737'   # Trondheim airport
      - 'NSR:StopPlace:5850'  # Grorud T bus stop
      - 'NSR:StopPlace:58652' # Mortavika ferry
      - 'NSR:StopPlace:27639' # Sør-Hidle quay
      - 'NSR:Quay:48550'      # Fiskepiren bus stop platform 1

Example with whitelisting of one line on each stop place.

# Example configuration.yaml entry
sensor:
  - platform: entur_public_transport
    stop_ids:
      - 'NSR:Quay:7333'
      - 'NSR:Quay:48550'
      - 'NSR:StopPlace:596'
    line_whitelist:
      - 'RUT:Line:1'
      - 'KOL:Line:1000_236'
      - 'NSB:Line:59'

Obtaining a stop id

Entur's travel planer has a map of all stops used in Norway. Use the map to find the stops you're interested in. When you have found one of your stops, click on it.

Now the web browser should contain an URL with the id in it. Such as this:

https://en-tur.no/nearby-stop-place-detail?id=NSR:StopPlace:32376

The stop id is the content after id= parameter in the url. Copy paste this into the configuration.

FAQ - Troubleshooting

Q: I have multiple stop ids and have added whitelisting of a line. Now some of the stop places are showing unknown.

A: A whitelisting of lines takes affect on all of the stops. So you have to whitelist all lines you are interested in on all stop places.


Q: I have added whitelisting of lines, and everything has worked as fine before, but now it has stopped updating all of a sudden.

A: Some transport companies, such as Kolumbus in Rogaland, have running numbers on the end of their line ids. These gets periodically updated and will make the whitelisting invalid. The new line ids needs to be added again. Most of the time it iterates by one.


Q: Where do I find a line id to add to the whitelisting?

A: The sensor will show the line id, and is the recommended way to find it, while we wait for 'Nasjonalt Stoppestedregister' to become public. It is also possible to see the line ids by using the developer tool in the browser while looking at the trafic in Entur's travel planer.