I’m trying to create a waze_travel_time
sensor with a template sensor to choose origin and destination as describe in https://www.home-assistant.io/integrations/waze_travel_time, but it doesn’t work as it should.
In first place I’ve configured two sensors to get time from home to work and work to home, and they work ok. Then I’ve created another sensor whose origin and destination is feeded from a template sensor through an `input_select’ and the result is not correct.
My sensors are these:
- platform: waze_travel_time
name: Tiempo casa trabajo
origin: zone.home
destination: zone.trabajo_industriales
region: "EU"
vehicle_type: car
- platform: waze_travel_time
name: Tiempo trabajo casa
origin: zone.trabajo_industriales
destination: zone.home
region: "EU"
vehicle_type: car
- platform: template
sensors:
dest_address:
value_template: >-
{%- if is_state("input_select.destino", "Casa") -%}
zone.home
{%- elif is_state("input_select.destino", "Trabajo") -%}
zone.trabajo_industriales
{%- else -%}
Desconocido
{%- endif %}
orig_address:
value_template: >-
{%- if is_state("input_select.origen", "Casa") -%}
zone.home
{%- elif is_state("input_select.origen", "Trabajo") -%}
zone.trabajo_industriales
{%- else -%}
Desconocido
{%- endif %}
- platform: waze_travel_time
name: Tiempo Viaje
origin: sensor.orig_address
destination: sensor.dest_address
region: 'EU'
vehicle_type: car
I’ve selected origin and destination so that first and third sensors should result in the same result, but this is not what is happening. The sensor.tiempo_viaje
results are wrong.
The results I get from developer tools are these:
The origin and destination of the first two sensor are set to the GPS coordinates, while in the third, they are set to zone.home
and zone.trabajo_industriales
. I don’t know why the behaviour is different.
The route of the first two sensors are correct, but the route of the third one is completely wrong. It gives a route in Hungary while I live in Spain.