Dang, unfortunately I can’t seem to get this working. I think I get the logic of everything you stated but one thing that throws me off is that you can use a single device_tracker in the Waze config with no problem, so I’m not sure why the need to do all the lat/long conversion when the Waze config seems to know how to do that for a single phone at least.
Here is what I tried - from configuration.yaml (sanitized addresses):
input_select:
destination:
name: destination
options:
- Home
- LizWork
- TonyWork
- DayCare
- RockGym
origin:
name: origin
options:
- TonyPhone
- LizPhone
- AlainaPhone
sensor:
# Waze input select
- platform: template
sensors:
dest_address:
value_template: >-
{%- if is_state("input_select.destination", "Home") -%}
1600 Pennsylvania Ave NW, Washington, DC 20500, USA
{%- elif is_state("input_select.destination", "LizWork") -%}
1600 Pennsylvania Ave NW, Washington, DC 20500, USA
{%- elif is_state("input_select.destination", "TonyWork") -%}
1600 Pennsylvania Ave NW, Washington, DC 20500, USA
{%- elif is_state("input_select.destination", "DayCare") -%}
1600 Pennsylvania Ave NW, Washington, DC 20500, USA
{%- elif is_state("input_select.destination", "RockGym") -%}
1600 Pennsylvania Ave NW, Washington, DC 20500, USA
{%- else -%}
Unknown
{%- endif %}
start_address:
value_template: >-
{% set trackers = {
'TonyPhone':'device_tracker.tonysiphone',
'LizPhone':'device_tracker.elizabethsiphone6s',
'AlainaPhone':'device_tracker.alainasiphone6'} %}
{% set key = states('input_select.listed_trackers') %}
{% if key in trackers.keys() %}
{{ state_attr(trackers[key],'latitude') }}, {{ state_attr(trackers[key],'longitude') }}
{% else %}
unknown
{% endif %}
- platform: waze_travel_time
name: "Me to destination"
origin: sensor.start_address
destination: sensor.dest_address
region: 'US'
This results in 2 nice input select lists.
The sensor.start_address never seems to update with the input select and the Waze calculations don’t work.
My intention is to call the two input select lists via automation using the input_select.select_option to change the origin and destination for Waze to produce travel timers, which I can then send out via notifications.