Add service waze_travel_time.get_travel_times (#32062)

* Add service waze_travel_time.get_travel_times

* Tiny tweaks

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
Kevin Stillhammer 2024-05-22 15:49:37 +02:00 committed by GitHub
parent 2764bc6816
commit 40fc996d0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,6 +25,89 @@ Notes:
- The string inputs for `Substring *` allow you to force the {% term integration %} to use a particular route or avoid a particular route in its time travel calculation. These inputs are case insensitive and matched against the description of the route.
- When using the `Avoid Toll Roads?`, `Avoid Subscription Roads?` and `Avoid Ferries?` options, be aware that Waze will sometimes still route you over toll roads or ferries if a valid vignette/subscription is assumed. Default behavior is that Waze will route you over roads having subscription options. It is therefor best is to set both `Avoid Toll Roads?` and `Avoid Subscription Roads?` or `Avoid Ferries?` if needed and experiment to ensure the desired outcome.
## Service `waze_travel_time.get_travel_times`
This service populates [response data](/docs/scripts/service-calls#use-templates-to-handle-response-data)
with route alternatives and travel times between two locations.
| Service data attribute | Optional | Description | Example |
| ---------------------- | -------- | ----------- | --------|
| `origin` | no | The origin of the route | "51.330436, 3.802043" |
| `destination` | no | The destination of the route | "51.330436, 3.802043" |
| `region` | no | The region. Controls which waze server is used. | "us" |
| `units` | yes | Which unit system to use | metric |
| `vehicle_type` | yes | Which vehicle to use | "car" |
| `incl_filter` | yes | Which street names must be part of the route | "A321" |
| `excl_filter` | yes | Which street names must not be part of the route | "A321" |
| `realtime` | yes | Use real-time or statistical data | True |
| `avoid_toll_roads` | yes | Whether to avoid toll roads | True |
| `avoid_ferries` | yes | Whether to avoid ferries | True |
| `avoid_subscription_roads` | yes | Whether to avoid subscription roads | True |
```yaml
service: waze_travel_time.get_travel_times
data:
origin: "51.330436, 3.802043"
destination: "51.445677, 3.749929"
region: "eu"
response_variable: routes
```
{% details "Example service response" %}
```yaml
waze_travel_time.get_travel_times:
routes:
- duration: 16.15
distance: 13.942
name: B455 - Boelckestraße Wiesbaden
street_names:
- Eleonorenstraße
- Wiesbadener Straße
- L3482 - Wiesbadener Straße
- Otto-Suhr-Ring
- Boelckestraße
- B455 - Boelckestraße
- A66 > Frankfurt am Main / Köln
- A66
- AS 8 Wallau
- L3017
- Diedenberger Straße
- L3017 - Diedenberger Straße
- K785 - Diedenberger Straße
- Hessenstraße
- Robert-Bosch-Straße
- Nassaustraße
- Johannes-Gutenberg-Straße
- duration: 16.9
distance: 15.319
name: L3482 - Wiesbadener Landstraße Wiesbaden
street_names:
- Eleonorenstraße
- Wiesbadener Straße
- L3482 - Wiesbadener Straße
- Wiesbadener Landstraße
- L3482 - Wiesbadener Landstraße
- Kasteler Straße
- L3482 - Kasteler Straße
- Mainzer Straße
- K650 - Mainzer Straße
- "> A66 / Wiesbaden-Stadtmitte"
- A66 > Frankfurt / Hannover
- A66
- AS 8 Wallau
- L3017
- Diedenberger Straße
- L3017 - Diedenberger Straße
- K785 - Diedenberger Straße
- Hessenstraße
- Robert-Bosch-Straße
- Nassaustraße
- Johannes-Gutenberg-Straße
```
{% enddetails %}
## Defining a custom polling interval
{% include common-tasks/define_custom_polling.md %}