From c4ecb79026b58916b7fd604a8ea10f0fb7e35a8d Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 7 Sep 2023 12:33:51 -0400 Subject: [PATCH] Vacation mode tweaks --- groups.yaml | 4 +++- packages/announcements.yaml | 15 +++++++++++++++ packages/custom_weather.yaml | 2 ++ packages/presence.yaml | 24 +++++++++++++++++++++--- 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/groups.yaml b/groups.yaml index 7689ece..9d0d484 100644 --- a/groups.yaml +++ b/groups.yaml @@ -17,4 +17,6 @@ Presence Simulation: - light.dining_room_lamp - light.upstairs_bathroom_lights - light.downstairs_bathroom_lights - - light.tina_lamp \ No newline at end of file + - light.tina_lamp + - light.tina_desk_strip + - light.stairwell_led_strip \ No newline at end of file diff --git a/packages/announcements.yaml b/packages/announcements.yaml index 86564da..37ad4c8 100644 --- a/packages/announcements.yaml +++ b/packages/announcements.yaml @@ -113,6 +113,10 @@ automation: trigger: platform: time at: input_datetime.audible_notification_on + condition: + - condition: state + entity_id: input_boolean.vacation_mode + state: 'off' action: - service: input_boolean.turn_on entity_id: input_boolean.audible_notifications @@ -130,6 +134,10 @@ automation: trigger: - platform: time at: input_datetime.audible_notification_off + condition: + - condition: state + entity_id: input_boolean.vacation_mode + state: 'off' action: - service: input_boolean.turn_off entity_id: input_boolean.audible_notifications @@ -148,6 +156,9 @@ automation: - condition: state entity_id: input_boolean.kallen_overnight state: 'off' + - condition: state + entity_id: input_boolean.vacation_mode + state: 'off' action: - choose: - conditions: @@ -183,6 +194,10 @@ automation: - platform: time at: input_datetime.nightly_briefing id: house-nightly + condition: + - condition: state + entity_id: input_boolean.vacation_mode + state: 'off' action: - choose: - conditions: diff --git a/packages/custom_weather.yaml b/packages/custom_weather.yaml index 12bad1d..dc5147d 100644 --- a/packages/custom_weather.yaml +++ b/packages/custom_weather.yaml @@ -339,6 +339,8 @@ template: false {% elif is_state('input_boolean.kallen_overnight','on') and (states('sensor.people_sleeping_total') | int == 2) %} false + {% elif is_state('input_boolean.vacation_mode','on') %} + false {% else %} true {% endif %} diff --git a/packages/presence.yaml b/packages/presence.yaml index fb5b780..15278d6 100644 --- a/packages/presence.yaml +++ b/packages/presence.yaml @@ -715,10 +715,14 @@ automation: entity_id: switch.presence_simulation - service: input_boolean.turn_off target: - entity_id: input_boolean.front_porch_light_on + entity_id: + - input_boolean.front_porch_light_on + - input_boolean.audible_notifications - service: automation.turn_on target: - entity_id: automation.auto_night_porch_light + entity_id: + - automation.auto_night_porch_light + - automation.vacation_lighting - if: - condition: state entity_id: binary_sensor.early_night_mode @@ -736,7 +740,9 @@ automation: entity_id: input_boolean.front_porch_light_on - service: automation.turn_off target: - entity_id: automation.auto_night_porch_light + entity_id: + - automation.auto_night_porch_light + - automation.vacation_lighting data: stop_actions: true - if: @@ -776,6 +782,18 @@ automation: entity_id: climate.master_bedroom_aircon data: fan_mode: Auto + - if: + - condition: template + value_template: > + {% from 'time.jinja' import ct %} + {% set begin = state_attr('input_datetime.audible_notification_on','timestamp') %} + {% set end = state_attr('input_datetime.audible_notification_off','timestamp') %} + {% set ct = ct() %} + {{ begin < ct < end }} + then: + - service: input_boolean.turn_on + target: + entity_id: input_boolean.audible_notifications - id: 6d668686-c88e-4eae-9b91-1a2bdebce290 alias: Auto Night Porch Light