I have some Waze entities (distance to work etc…) how do I make an automation to send me a message (phone/alexa) that its time (time+15 min) to go?
If the Waze integration is telling you that it will take you, let’s say, 24 minutes to go to work from now.
When did you expect the automation to run?
Because it will be something about adding time deltas but I don’t know which one you want…
Exemple:
sensor.work_travel_time ::= 24
now ::= Jan 24, 2023 9:02 am
The following template
{{ now() + timedelta(minutes = 15 + (states('sensor.work_travel_time') | int(0))|default(0)) }}
will give you
2023-01-24 9:41:45.864327+00:00
It is now + 15’ + 24’
But to trigger an automation, you’ll need a boolean condition
trigger:
- platform: template
value_template: >
{{ <something compared to> now() + timedelta(minutes = 15 + (states('sensor.work_travel_time') | int(0))|default(0))
It is up to you to define the something and the comparison.
EDIT: I believe you’ll have to compare it to an event in a calendar or a datetime helper.
Like
trigger:
- platform: template
value_template: >
{{ states('input_datetime.meeting') <= now() + timedelta(minutes = 15 + (states('sensor.work_travel_time') | int(0))|default(0))