mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
parent
6ae0e35a35
commit
bfbc89f1cd
@ -10,11 +10,11 @@ footer: true
|
|||||||
ha_category: Sensor
|
ha_category: Sensor
|
||||||
logo: db.png
|
logo: db.png
|
||||||
ha_iot_class: "Local Polling"
|
ha_iot_class: "Local Polling"
|
||||||
|
ha_release: 0.14
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
The `deutsche_bahn` sensor will give you the departure time of the next train for the given connection. In case of a delay, the delay is also shown. Additional `ATTRIBUTES` are used to inform about eg. the type of the train, price and if it is ontime. The data are coming from the [bahn.de](http://www.bahn.de/p/view/index.shtml) website.
|
The `deutsche_bahn` sensor will give you the departure time of the next train for the given connection. In case of a delay, the delay is also shown. Additional details are used to inform about eg. the type of the train, price, and if it is ontime.
|
||||||
|
|
||||||
|
|
||||||
To enable this sensor, add the following lines to your `configuration.yaml` file:
|
To enable this sensor, add the following lines to your `configuration.yaml` file:
|
||||||
|
|
||||||
@ -29,5 +29,18 @@ sensor:
|
|||||||
Configuration variables:
|
Configuration variables:
|
||||||
|
|
||||||
- **from** (*Required*): The name of the start station.
|
- **from** (*Required*): The name of the start station.
|
||||||
- **to** (*Required*): The name of the end station.
|
- **to** (*Required*): The name of the end/destination station.
|
||||||
|
|
||||||
|
As already mentioned this sensor contains a lot of information to access those a [template senosr](/components/sensor.template/) can come handy.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# Example configuration.yaml entry
|
||||||
|
sensor:
|
||||||
|
platform: template
|
||||||
|
sensors:
|
||||||
|
next_departure:
|
||||||
|
value_template: '{% raw %}{{ states.sensor.munich_to_ulm.attributes.next }}{% endraw %}'
|
||||||
|
friendly_name: 'Next departure'
|
||||||
|
```
|
||||||
|
|
||||||
|
The data is coming from the [bahn.de](http://www.bahn.de/p/view/index.shtml) website.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user