Skip to content

Commit

Permalink
value_template for zone condition
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger committed May 15, 2021
1 parent 77aa088 commit 18a4475
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/zone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ automation:
event: "enter"
condition:
- alias: "Only if Kevin is not nearby"
condition: "{{ distance('device_tracker.sm_g975f', 'device_tracker.oneplus_a3003') < 1 }}"
condition: template
value_template: "{{ distance('device_tracker.sm_g975f', 'device_tracker.oneplus_a3003') < 1 }}"
action:
- alias: "Wait until Sina leaves Zone again"
wait_for_trigger:
Expand All @@ -53,10 +54,15 @@ automation:
entity_id: sensor.travel_time_home_user_two_here
- alias: "Wait 5s"
delay: 5
- variables:
notification_message: >
Sina hat Elmo verlassen.
Sie braucht circa {{ states('sensor.travel_time_home_user_two_here') | int }}
Minuten bis nach Hause.
- alias: "Notify Kevin via mobile app"
service: notify.mobile_app_sm_g975f
data:
message: "Sina hat Elmo verlassen. Sie braucht circa {{ states('sensor.travel_time_home_user_two_here') | int }} Minuten bis nach Hause."
message: "{{ notification_message }}"
- alias: "Only when Kevin is home and Alexa Notifications turned on"
condition: and
conditions:
Expand All @@ -77,5 +83,4 @@ automation:
data:
type: announce
method: speak
message: "Sina hat Elmo verlassen. Sie braucht circa {{ states('sensor.travel_time_home_user_two_here') | int }} Minuten bis nach Hause."

message: "{{ notification_message }}"

0 comments on commit 18a4475

Please sign in to comment.