From 3cfcf95ccaacb2e02936bbdf1da9050f968c36ab Mon Sep 17 00:00:00 2001 From: Kevin Eifinger Date: Wed, 13 Oct 2021 21:48:49 +0200 Subject: [PATCH] try fix away mode --- packages/away_mode.yaml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/away_mode.yaml b/packages/away_mode.yaml index 067b3ea..9b401a1 100644 --- a/packages/away_mode.yaml +++ b/packages/away_mode.yaml @@ -16,8 +16,8 @@ script: example: input_boolean.user_one_home sequence: - choose: - # User just got home - - conditions: + - alias: User just got home + conditions: - condition: template value_template: > {{ is_state(person, 'home') @@ -27,27 +27,31 @@ script: data: entity_id: "{{ input_boolean }}" default: - # User is not yet/still home - - variables: + - alias: User is not yet/still home. Save current state + variables: current_state: "{{ states(person) }}" - service: "{{ mobile_app }}" data: message: "request_location_update" - # Wait until the state changes - - wait_for_trigger: + - alias: Wait until the state changes + wait_for_trigger: - platform: template value_template: "{{ not is_state(person, current_state) }}" + - platform: state + entity_id: binary_sensor.contact_door + to: "on" - choose: - conditions: - - condition: template + - alias: User got home + condition: template value_template: "{{ is_state(person, 'home') }}" sequence: - service: input_boolean.turn_on data: entity_id: "{{ input_boolean }}" - conditions: - - condition: template - # User changed to anything but home. So 'not_home' or a zone name + - alias: User changed to anything but home. So 'not_home' or a zone name + condition: template value_template: "{{ not is_state(person, 'home') }}" sequence: - service: input_boolean.turn_off