with this you mean a sensor with a zone or an entity_id as its state? Because the way it is written in the docs, I dont think anyone can blame a user to think this is what was prescribed.
Would be really nice if it could be PR’d like that @eifinger, because otherwise we would need to hardcode all of those lat/lon coordinates in the sensor…
unless there is another way for the sensor build of course, must have a look at that yet.
Thanks for the PR! I’ll check it as soon as I hit ← reply
I like the changes and the base class looks good. I honestly don’t care about the attributes that the base class has either, so what you have is good in my book. Ijmerza was very particular about that though because he makes the ‘travel time card’ for lovelace.
while I was posting some other issues, you beat me to even start thinking about it Thanks!
update:
working perfectly!
too bad it shows the lat/lon now in the Lovelace card also, but all travel times appear nicely.
Ive added an update script so I don’t have to wait for the Waze update…
I would like to be able to determine what the travel time is from a device_tracker to zone.home such that I can create an automation that fires off when the device_tracker is 30 minutes away. Do you have any suggestions on how to accomplish this?
use this automation trigger to get what you want. But be warned, this only updates every 5 minutes and it won’t know if the device_tracker is actually heading in the direction of zone.home. You could be going to the gym or something and it would trigger because you happen to be < 30 minutes away.
Im trying to accomplish a dynamic waze time updater ,
I have in zone.yaml several zones .
i separate waze to waze,yaml
where i try to implement @petro suggestion for the templates
and also @Mariusthvdb for the sensors .
Im not sure i define the the input_select correctly as actually they are duplicated,
with just different name.
What is the automation that calculate the origin to destination ?
Is that correct if I want to use the zones i have in zone.yaml?
How
second, I’m working on some telegram actionable notifications
which later i want add the option to get the expected arrival time
from the current location to desire destination ,
is some1 done something similar?
my waze.yaml
sensor:
- platform: template
sensors:
destination_address:
friendly_name: Destination
value_template: >
{% set entity_id = states('input_select.waze_destination') %}
{% set lat = state_attr(entity_id, 'latitude') %}
{% set lon = state_attr(entity_id, 'longitude') %}
{{ lat }}, {{ lon }}
icon_template: mdi:map-marker-path
origin_address:
friendly_name: Origin
value_template: >
{% set entity_id = states('input_select.waze_origin') %}
{% set lat = state_attr(entity_id, 'latitude') %}
{% set lon = state_attr(entity_id, 'longitude') %}
{{ lat }}, {{ lon }}
icon_template: mdi:map-marker
- platform: waze_travel_time
name: 'Select Origin Destination'
origin: sensor.origin_address
destination: sensor.destination_address
region: 'IL'
input_select:
waze_origin:
name: waze_origin
options:
- Home
- Avi Work
- Karin Work
waze_destination:
name: waze_destination
options:
- Home
- Avi Work
- Karin Work
Imitate available variables:
{% set entity_id = states('zone.karin_Work') %}
{% set lat = state_attr('zone.karin_Work', 'latitude') %}
{% set lon = state_attr('zone.karin_Work', 'longitude') %}
{{ lat }}, {{ lon }}
The lan and lon are {{ lat }} {{ lon }}
return:
"The lan and lon are xx.82405 yy.081299"
so it does work with zone correctly
The problem from some reason the sensor don’t get this values
sensor:
origin_address:
friendly_name: Origin
value_template: >
{% set entity_id = states('input_select.waze_origin') %}
{% set lat = state_attr('entity_id', 'latitude') %}
{% set lon = state_attr('entity_id', 'longitude') %}
{{ lat }}, {{ lon }}
icon_template: mdi:map-marker
now both sensors destination and origin holds the lan,lon values,
and select_origin_destination - return the time and destination.
But it’s not being refresh in reasonable time (about ~3-4 minute),
is there an way get trigger it faster?
I want to create automation which send notification automatically when i leave predefined zone.