Update Wsdot sensor component configuration (#7125)

* Update Wsdot sensor component configuration

* 🚑 Fix error

* Minor changes
This commit is contained in:
Klaas Schoute 2018-10-28 19:33:07 +01:00 committed by Fabian Affolter
parent c8e634a819
commit 833e6a3ddc

View File

@ -15,8 +15,12 @@ ha_release: 0.37
The `wsdot` sensor will give you travel time information from the [Washington State Department of Transportation (WSDOT)](http://wsdot.com/). The `wsdot` sensor will give you travel time information from the [Washington State Department of Transportation (WSDOT)](http://wsdot.com/).
## {% linkable_title Setup %}
First, you need to get a free Traveler Information `api_key` from the [WSDOT API webpage](http://wsdot.com/traffic/api/). Just enter your email address to instantly get the key. First, you need to get a free Traveler Information `api_key` from the [WSDOT API webpage](http://wsdot.com/traffic/api/). Just enter your email address to instantly get the key.
## {% linkable_title Configuration %}
Once you have the code, create `wsdot` sensors by editing your `configuration.yaml` file as follows: Once you have the code, create `wsdot` sensors by editing your `configuration.yaml` file as follows:
```yaml ```yaml
@ -29,13 +33,26 @@ sensor:
name: I-90 Eastbound HOV name: I-90 Eastbound HOV
``` ```
Configuration variables: {% configuration %}
api_key:
- **api_key** (*Required*): Your `api_key` from WSDOT. description: Your API key from WSDOT.
- **scan_interval** (*Optional*): How frequently to query for new data. Default: 3 minutes. required: true
- **travel_time** array (*Required*): List of routes. type: string
- **id** (*Required*): Name of the route. travel_time:
- **name** (*Optional*): Name of the route. Default just uses `id`. description: List of routes.
required: true
type: list
keys:
id:
description: ID of the route.
required: true
type: string
name:
description: Name of the route.
required: false
default: Just uses `id`
type: string
{% endconfiguration %}
Figuring out which Travel Time ID (`id`) is associated with your routes is a bit of a challenge. If you visit `http://wsdot.com/Traffic/api/TravelTimes/TravelTimesREST.svc/GetTravelTimesAsJson?AccessCode=[your_api_key_here]` substituting your `api_key`, you will get a list of all available routes. Search through it and then find the key `TravelTimeID`. That tells you the number you need. Figuring out which Travel Time ID (`id`) is associated with your routes is a bit of a challenge. If you visit `http://wsdot.com/Traffic/api/TravelTimes/TravelTimesREST.svc/GetTravelTimesAsJson?AccessCode=[your_api_key_here]` substituting your `api_key`, you will get a list of all available routes. Search through it and then find the key `TravelTimeID`. That tells you the number you need.