From 61297bd4080ce60ae4d7fe5471a2c57a8aea3b50 Mon Sep 17 00:00:00 2001 From: ajobbins <5669088+ajobbins@users.noreply.github.com> Date: Sat, 1 Sep 2018 19:14:24 +1000 Subject: [PATCH] Update sensor.google_travel_time.markdown (#6125) * Update sensor.google_travel_time.markdown Google have removed the previous daily free API limit, instead requiring a billing account to be set up. Including details on limits and quotas and how to set them. * Update sensor.google_travel_time.markdown Updates as requested in feedback. Thanks * Minor changes * Again --- .../sensor.google_travel_time.markdown | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/source/_components/sensor.google_travel_time.markdown b/source/_components/sensor.google_travel_time.markdown index 4fb24f39d07..92046fd4a62 100644 --- a/source/_components/sensor.google_travel_time.markdown +++ b/source/_components/sensor.google_travel_time.markdown @@ -13,11 +13,19 @@ ha_iot_class: "Cloud Polling" ha_release: 0.19 --- -Sensor to provide travel time from the [Google Distance Matrix API](https://developers.google.com/maps/documentation/distance-matrix/). +The `google_travel_time` sensor provides travel time from the [Google Distance Matrix API](https://developers.google.com/maps/documentation/distance-matrix/). + +## {% linkable_title Setup %} You need to register for an API key by following the instructions [here](https://github.com/googlemaps/google-maps-services-python#api-keys). You only need to turn on the Distance Matrix API. -A free API Key allows 2500 requests per day. The sensor will update the travel time every 5 minutes. +[Google now require billing](https://mapsplatform.googleblog.com/2018/05/introducing-google-maps-platform.html) to be enabled (and a valid credit card loaded) to access Google Maps APIs. The Distance Matrix API is billed at US$10 per 1000 requests, however a US$200 per month credit is applied (20,000 requests). By default, the sensor will update the travel time every 5 minutes, making approximately 288 calls per day. Note that at this rate, more than 2 sensors will likely exceed the free credit amount. If you need to run more than 2 sensors, consider changing the [scan interval](/docs/configuration/platform_options/#scan-interval) to something longer than 5 minutes to stay within the free credit limit. + +A quota can be set against the API to avoid exceeding the free credit amount. Set the 'Elements per day' to a limit of 645 or less. Details on how to configure a quota can be found [here](https://developers.google.com/maps/documentation/distance-matrix/usage-and-billing#set-caps) + +## {% linkable_title Configuration %} + +To enable the sensor, add the following lines to your `configuration.yaml` file: ```yaml # Example entry for configuration.yaml @@ -40,9 +48,9 @@ Configuration variables: - **arrival_time** (*Optional*): See notes above for `departure_time`. `arrival_time` can not be `now`, only a Unix timestamp or time string. You can not provide both `departure_time` and `arrival_time`. If you do provide both, `arrival_time` will be removed from the request. - **units** (*Optional*): Set the unit for the sensor in metric or imperial, otherwise the default unit the same as the unit set in `unit_system:`. -##### {% linkable_title Dynamic Configuration %} +## {% linkable_title Dynamic Configuration %} -Tracking can be setup to track entities of type device_tracker, zone, and sensor. If an entity is placed in the origin or destination then every 5 minutes when the component updates it will use the latest location of that entity. +Tracking can be setup to track entities of type `device_tracker`, `zone` and `sensor`. If an entity is placed in the origin or destination then every 5 minutes when the platform updates it will use the latest location of that entity. ```yaml # Example entry for configuration.yaml @@ -67,10 +75,9 @@ sensor: destination: zone.home options: units: imperial # 'metric' for Metric, 'imperial' for Imperial - ``` -#### {% linkable_title Entity Tracking %} +## {% linkable_title Entity Tracking %} - **device_tracker** - If state is a zone then the zone location will be used