Skip to content

Commit c38c00b

Browse files
fabfurnariballoob
authored andcommitted
ViaggiaTreno sensor documentation (home-assistant#3924)
* ViaggiaTreno sensor documentation * ✏️ Spelling, grammar, styling, and configuration fixes
1 parent 0ed0151 commit c38c00b

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
layout: page
3+
title: "ViaggiaTreno Italian Railroads"
4+
description: "Instructions on how to integrate Italian Railroads data (from ViaggiaTreno API) into Home Assistant."
5+
date: 2017-11-07 14:35
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
logo: train.png
11+
ha_category: Transport
12+
ha_iot_class: "Cloud Polling"
13+
ha_release: 0.58
14+
---
15+
16+
The `viaggiatreno` sensor will give you information about configured train ids and stations using the public [ViaggiaTreno](http://viaggiatreno.it) API.
17+
18+
To activate the sensor you need at least two parameters: the `train_id` and the `station_id`.
19+
20+
The first is available just looking at the [ViaggiaTreno](http://viaggiatreno.it/) timetable, the latter can be obtained using the dedicated API endpoint:
21+
`http://www.viaggiatreno.it/viaggiatrenonew/resteasy/viaggiatreno/autocompletaStazione/<Station name>`
22+
(e.g., `http://www.viaggiatreno.it/viaggiatrenonew/resteasy/viaggiatreno/autocompletaStazione/ROMA` will list all station names (with ids) that starts with *ROMA*).
23+
24+
<p class='note'>
25+
Note that the `station_id` is referred to the train's **departing station**. If a train number does not match with the station id, no data will be returned to the sensor.
26+
</p>
27+
28+
Then add the data to your `configuration.yaml` file as shown in the example:
29+
30+
```yaml
31+
# Example configuration.yaml entry
32+
sensor:
33+
- platform: viaggiatreno
34+
train_id: 12279
35+
station_id: S08409
36+
```
37+
38+
{% configuration %}
39+
train_id:
40+
description: The ID of the train.
41+
required: true
42+
type: int
43+
station_id:
44+
description: The ID of the starting station.
45+
required: true
46+
type: int
47+
train_name:
48+
description: The name of the sensor. Defaults to 'Train <train id> from <station id>'.
49+
required: false
50+
type: string
51+
{% endconfiguration %}
52+
53+
<p class='note'>
54+
In a future implementation, the station name could be used to automatically search best-matching station id, without the need to specify it.
55+
</p>
56+
57+
The public timetables are coming from [ViaggiaTreno](http://viaggiatreno.it).
58+
59+
<p class='note'>
60+
Instructions (in Italian) for the API are available at:
61+
https://github.com/bluviolin/TrainMonitor/wiki/API-del-sistema-Viaggiatreno
62+
</p>

0 commit comments

Comments
 (0)