Google Travel Time Help

Would it be possible to manually enter in the origin and destination from the Frontend and calculate drive times based on those values? Or at least given 3 separate input_select values for origin and destination?

I’m sure this is completely off, but for an input_select example something like this for the sensor file:

- platform: google_travel_time
  api_key: API_KEY
  origin:
    value_template: >-
        {%- if is_state("input_select.google_origin", "Home") %}
            35.28352, -119.79375600000002
        {% elif is_state("input_select.google_origin", "Work") %}
            35.0583595, -119.71483319999998
        {% else %}
            35.1544745, -119.77298309999996
        {%- endif %}
        
  destination:
    value_template: >-
        {%- if is_state("input_select.google_dest", "Home") %}
            35.28352, -119.79375600000002
        {% elif is_state("input_select.google_dest", "Work") %}
            35.0583595, -119.71483319999998
        {% else %}
            35.1544745, -119.77298309999996
        {%- endif %}
        
  travel_mode: driving
2 Likes

Did you find a way to get this to work?

Unfortunately not

I can make the value_template work with destination or origin. But it works with a template sensor.

You can use an input_text.
Use the frontend to write the address.

At the google travel sensor write this:

...
origin: '{{states.input_text.nameoftheorigininputtextsensor.states}}'
destination: '{{states.input_text.nameofthedestinationinputtextsensor.states}}'
...

This should work.

edit: I just realized this is 2 years old :smiley: