From bc7a825cc132815a618c7d47a7ea5aad384da81c Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sun, 18 Jun 2023 16:16:43 -0400 Subject: [PATCH] Improve vacation mode --- packages/presence.yaml | 124 +++++++++++++++++++++++++++++++++++++++++ packages/security.yaml | 37 ------------ 2 files changed, 124 insertions(+), 37 deletions(-) diff --git a/packages/presence.yaml b/packages/presence.yaml index 1322340..c10a71f 100644 --- a/packages/presence.yaml +++ b/packages/presence.yaml @@ -522,6 +522,130 @@ automation: data: value: 0 + - id: 1061c626-17c1-4f0b-8f55-2afc60ef8a3a + alias: Vacation Mode + trigger: + - platform: template + value_template: > + {% set tony = states('sensor.tony_s_iphone_travel_time_min') | float %} + {% set tina = states('sensor.tinas_iphone_travel_time_min') | float %} + {{ is_state('input_boolean.vacation_mode','off') and (tony >= 90) and (tina >= 90) }} + id: leave-radius + - platform: state + entity_id: group.adults + not_from: + - 'unknown' + - 'unavailable' + to: 'home' + id: arrive-home + condition: + - condition: state + entity_id: input_boolean.guest_mode + state: 'off' + action: + - choose: + - conditions: + - condition: trigger + id: leave-radius + sequence: + - service: input_boolean.turn_on + target: + entity_id: input_boolean.vacation_mode + - conditions: + - condition: trigger + id: arrive-home + sequence: + - service: input_boolean.turn_off + target: + entity_id: input_boolean.vacation_mode + + - id: d759a27e-5e7a-4b2c-bf0c-e4378f38dc17 + alias: Vacation Tasks + description: Tasks to run when vacation mode is triggered + mode: restart + trigger: + - platform: state + entity_id: input_boolean.vacation_mode + to: 'on' + not_from: + - 'unknown' + - 'unavailable' + id: vacation-on + - platform: state + entity_id: input_boolean.vacation_mode + to: 'off' + not_from: + - 'unknown' + - 'unavailable' + id: vacation-off + condition: + - condition: state + entity_id: input_boolean.guest_mode + state: 'off' + action: + - choose: + - conditions: + - condition: trigger + id: vacation-on + sequence: + - service: fan.turn_off + target: + entity_id: all + - service: climate.set_hvac_mode + target: + entity_id: climate.master_bedroom_aircon + data: + hvac_mode: 'off' + - if: + - condition: state + entity_id: switch.presence_simulation + state: 'off' + then: + - service: light.turn_off + target: + entity_id: all + - service: switch.turn_on + target: + entity_id: switch.presence_simulation + - conditions: + - condition: trigger + id: vacation-off + sequence: + - if: + - condition: state + entity_id: + - input_boolean.hot_day + - binary_sensor.heat_warning + - binary_sensor.heat_threshold + - binary_sensor.heat_index_threshold + state: 'on' + then: + - service: fans_on + target: + entity_id: + - fan.emma_air_conditioner + - fan.kallen_bedroom_fan + - service: climate.set_hvac_mode + target: + entity_id: climate.master_bedroom_aircon + data: + hvac_mode: cool + - service: climate.set_preset_mode + target: + entity_id: climate.master_bedroom_aircon + data: + preset_mode: eco + - service: climate.set_temperature + target: + entity_id: climate.master_bedroom_aircon + data: + temperature: "{{ states('input_number.master_bedroom_daytime_temp') | int }}" + - service: climate.set_fan_mode + target: + entity_id: climate.master_bedroom_aircon + data: + fan_mode: Auto + script: family_is_away: alias: Family Is Away diff --git a/packages/security.yaml b/packages/security.yaml index 8596e59..22b03bf 100644 --- a/packages/security.yaml +++ b/packages/security.yaml @@ -363,43 +363,6 @@ automation: - switch.adaptive_lighting_living_room - switch.adaptive_lighting_tina_lamp - - id: 1061c626-17c1-4f0b-8f55-2afc60ef8a3a - alias: Vacation Mode - trigger: - - platform: template - value_template: > - {% set tony = states('sensor.tony_s_iphone_travel_time_min') | float %} - {% set tina = states('sensor.tinas_iphone_travel_time_min') | float %} - {{ is_state('input_boolean.vacation_mode','off') and (tony >= 90) and (tina >= 90) }} - id: leave-radius - - platform: state - entity_id: group.adults - not_from: - - 'unknown' - - 'unavailable' - to: 'home' - id: arrive-home - condition: - - condition: state - entity_id: input_boolean.guest_mode - state: 'off' - action: - - choose: - - conditions: - - condition: trigger - id: leave-radius - sequence: - - service: input_boolean.turn_on - target: - entity_id: input_boolean.vacation_mode - - conditions: - - condition: trigger - id: arrive-home - sequence: - - service: input_boolean.turn_off - target: - entity_id: input_boolean.vacation_mode - - id: 027f6f05-289f-4f3d-925e-54d95226ea34 alias: Security Schedules Reset trigger: