Google Maps Travel Time imperial unit

# Example entry for configuration.yaml
sensor:
  - platform: google_travel_time
    api_key: XXXX_XXXXX_XXXXX
    origin: Trondheim, Norway
    destination: Paris, France

Is there a way to change default unit (metric) to imperial? I don’t seem to find a way to do it.
I am currently running HA 0.35.2

Thanks!

Yes, set units: imperial

Actually, I need to rephrase my question.
I have

homeassistant:
  unit_system: metric

in my configuration.yaml, and I want to have Google Maps Travel Time component to report in imperial units only. Is it possible?

do I just add the following inside the google travel time component?

sensor:
  - platform: google_travel_time
    units: imperial

Thanks,

Yes, add it to google_travel_time sensor

I tried it, but it seems like

homeassistant:
  unit_system: metric

is overwriting the sensor settings so it still show metric on my google_travel_time sensor

Sorry, I think it should be

sensor:
  - platform: google_travel_time
    options:
      units: imperial

It works!!! Thanks so much!

P.S. I tried the following yesterday, but hass --script check_config returns error. I was so close on getting it right. Still learning YAML

sensor:
  - platform: google_travel_time
    options:
       - units: imperial

It would also be great if you can help improve the documentation for the component. In the upper right corner of any documentation page, you will find “Edit this page on GitHub”. Follow the link and submit your suggested change. Demonstrated here: https://youtu.be/dRfk9JAlPJk?t=1h16m17s

Glady!
Just did my first commit/ pull request

1 Like