- variables:
coords: |-
{%- if is_state("person.bart_simpson", "home") -%}
{%- set latitude = state_attr('zone.home', 'latitude') -%}
{%- set longitude = state_attr('zone.home', 'longitude') -%}
{%- else -%}
{%- set latitude = state_attr(state_attr('person.bart_simpson', 'source'), 'latitude') -%}
{%- set longitude = state_attr(state_attr('person.bart_simpson', 'source'), 'longitude') -%}
{%- endif -%}
{{ latitude ~ "," ~ longitude }}
- action: waze_travel_time.get_travel_times
metadata: {}
data:
region: eu
units: metric
vehicle_type: car
origin: "{{ coords }}"
destination: "{{ repeat.item.location }}"
realtime: true
response_variable: travel
{{ repeat.item.location }}
works fine and it’s coming from calendar.get_events
.
If I use "{{ coords }}"
as the origin, I get the following error:
Executed: 21 November 2024 at 19:38:53
Error: expected str for dictionary value @ data['origin']
Result:
params:
domain: waze_travel_time
service: get_travel_times
service_data:
region: eu
units: metric
vehicle_type: car
origin:
- 11.111
- -1.111
destination: Some random street
realtime: true
target: {}
running_script: false
How can I force it to be a string ?