home-assistant.github.io/source/_components/sensor.google_travel_time.markdown
Fabian Affolter 034c831324 0.24 (#637)
* Persistant changed to persistent

* Added log_attributes to the config documentation for statsd (#625)

* Fix AsusWRT docs to prevent SSH key confusion (#623)

pxssh is expecting the path to a private key, not a public key

* add yahoo weather support (#621)

* add yahoo weather

* update with woeid not longer required

* Doc for simplisafe alarm (#613)

* Minor fixes

* Rename the blog post for 0.24

* Initial blog post for 0.24

* Update sensor.apcupsd docs to reflect changes (#617)

* Update sensor.apcupsd docs to reflect changes

* Remove "type:" from configuration

* Add apcupsd sensor breaking change

* Added samsung models to the list of supported Samsung Smart TV's (#630)

* Add IMAP sensor docs

* Add IMAP sensor

* add joaoapps join component and platform. (#633)

* Add join

* Added documentation of the KNX component (#611)

* Added set_brightness to website docs. (#582)

* Added configuration for card order to customize docs

* Added configuration options to docs for the set_brightness command.

* Revert "Added configuration for card order to customize docs"

This reverts commit bd310fbd115c76bc49d994fff4ff3e1a0d0e9540.

* Add new contributors

* Add TP-Link smart plug docs

* Sync with PR

* update service (#634)

* Move KNX docs to right folder

* Fix typos and layout

* Add missing KNX logo

* Fix logo name

* Fix category

* Revert "Added set_brightness to website docs." (#636)

* Add initial KNX docs for binary sensors and switches

* Update title, desc, and date

* Rename blog post

* Update for 0.24

* pyhomematic update 0.1.9

* add example

* Example config (#638)

* Added dynamic entity tracking documentation (#641)

* Change ordering

* Added dynamic entity tracking documentation

* Add more details

* Add sqlalchemy as dep

* Add various db_url

* Added bah2830 configuration (#644)

* update media_player.markdown (#643)

* Rename release blog post

* Add CARTO

* Hide sensor.imap until stable

* Typo edits (#642)

* Update demo

* Minor tweaking

* Add additional example

* Add simple example for renaming

* Make it raw

* Update camera.rpi_camera.markdown (#537)

* Add link to binary version

* Fix indent

* Minor change for #537

* Update date
2016-07-16 21:24:29 +02:00

3.8 KiB

layout title description date sidebar comments sharing footer logo ha_category ha_iot_class ha_release
page Google Maps Travel Time Instructions on how to add Google Maps travel time to Home Assistant. 2016-03-28 10:19 true false true true google_maps.png Sensor Cloud Polling 0.19

Sensor to provide travel time from the Google Distance Matrix API.

You need to register for an API key by following the instructions here. 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.

# Example entry for configuration.yaml
sensor:
    platform: google_travel_time
    name: Google Travel Time
    api_key: XXXX_XXXXX_XXXXX
    origin: Trondheim, Norway
    destination: Paris, France
    options:
      ...

Configuration variables:

  • api_key (Required): Your application's API key (get one by following the instructions above). This key identifies your application for purposes of quota management.
  • origin (Required): The starting point for calculating travel distance and time. You can supply one or more locations separated by the pipe character, in the form of an address, latitude/longitude coordinates, or a Google place ID.
  • destination (Required): One or more locations to use as the finishing point for calculating travel distance and time. The options for the destinations parameter are the same as for the origins parameter, described above.
  • name (Optional): A name to display on the sensor. The default is "Google Travel Time - " where transit mode is the mode set in options for the sensor (if no mode is set, the default is driving).
  • options (Optional): A dictionary containing parameters to add to all requests to the Distance Matrix API. A full listing of available options can be found here.
    • departure_time (Optional): Can be now, a Unix timestamp, or a 24 hour time string like 08:00:00. If you provide a time string, it will be combined with the current date to get travel time for that moment.
    • 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.

###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.

# Example entry for configuration.yaml
sensor:
  # Tracking entity to entity
  - platform: google_travel_time
    name: Phone To Home
    api_key: XXXX_XXXXX_XXXXX
    origin: device_tracker.mobile_phone
    destination: zone.home

  # Tracking entity to zone friendly name
  - platform: google_travel_time
    name: Home To Eddie's House
    api_key: XXXX_XXXXX_XXXXX
    origin: zone.home
    destination: Eddies House    # Friendly name of a zone

####Entity Tracking

  • device_tracker
    • If state is a zone then the zone location will be used
    • If state is not a zone it will look for the longitude and latitude attributes
  • zone
    • Uses the longitude and latitude attributes
    • Can also be referenced by just the zone's friendly name found in the attributes.
  • sensor
    • If state is a zone or zone friendly name then will use the zone location
    • All other states will be passed directly into the google API
      • This includes all valid locations listed in the Configuration Variables