From ebe69ec6603d0cbc1cb0b453b833c2943f6eb0db Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sun, 5 Jun 2022 22:33:35 -0400 Subject: [PATCH] More security and motion-lighting tweaks --- packages/lighting.yaml | 65 ++++++++++++++++++++++++++++++++++++++++-- packages/presence.yaml | 12 ++------ packages/security.yaml | 8 +++++- scripts.yaml | 5 +--- 4 files changed, 72 insertions(+), 18 deletions(-) diff --git a/packages/lighting.yaml b/packages/lighting.yaml index f2978ab..7567431 100644 --- a/packages/lighting.yaml +++ b/packages/lighting.yaml @@ -1,3 +1,8 @@ +input_boolean: + shower_mode: + name: Shower Mode + icon: mdi:shower + automation: - id: 6fe64356-00a2-4cad-bb85-f6dd05f29de7 alias: Upstairs Bathroom Motion Lights @@ -14,12 +19,15 @@ automation: id: motion-off for: hours: 0 - minutes: 2 - seconds: 0 + minutes: 1 + seconds: 30 condition: - condition: state - entity_id: light.upstairs_bathroom_lights + entity_id: input_boolean.early_night_mode state: 'on' + - condition: state + entity_id: input_boolean.shower_mode + state: 'off' action: - if: - condition: trigger @@ -46,3 +54,54 @@ automation: {% else %} Adaptive {% endif %} + + - id: f52eca30-c2e4-43dc-b220-7e9be96b465a + alias: Shower Mode + description: Temporarily override upstairs bathroom motion lights for the purpose of taking a shower + trigger: + - platform: state + entity_id: input_boolean.shower_mode + from: 'off' + to: 'on' + id: shower-on + - platform: state + entity_id: input_boolean.shower_mode + from: 'on' + to: 'off' + id: shower-off + action: + - if: + - condition: trigger + id: shower-on + then: + - service: input_select.select_option + target: + entity_id: input_select.upstairs_bathroom_scenes + data: + option: Bright + - if: + - condition: trigger + id: shower-off + then: + - if: + - condition: state + entity_id: input_boolean.early_night_mode + state: 'on' + then: + - service: input_select.select_option + target: + entity_id: input_select.upstairs_bathroom_scenes + data: + option: Adaptive + else: + - service: light.turn_off + target: + entity_id: light.upstairs_bathroom_lights + - service: switch.turn_on + target: + entity_id: switch.adaptive_lighting_upstairs_bathroom + - service: input_text.set_value + target: + entity_id: input_text.upstairs_bathroom_selected_scene + data: + value: Adaptive \ No newline at end of file diff --git a/packages/presence.yaml b/packages/presence.yaml index 3891a50..322c31b 100644 --- a/packages/presence.yaml +++ b/packages/presence.yaml @@ -207,11 +207,7 @@ script: - downstairs_bathroom - upstairs_bathroom data: {} - - service: alarm_control_panel.alarm_arm_away - data: - code: !secret ring_alarm_code - target: - entity_id: alarm_control_panel.stratton_ave_alarm + - service: script.security_arm_away mode: single icon: mdi:shield-lock family_is_home: @@ -221,11 +217,7 @@ script: target: entity_id: switch.presence_simulation data: {} - - service: alarm_control_panel.alarm_disarm - data: - code: !secret ring_alarm_code - target: - entity_id: alarm_control_panel.stratton_ave_alarm + - service: script.security_disarm - service: switch.turn_off target: entity_id: diff --git a/packages/security.yaml b/packages/security.yaml index 9cd3487..6039599 100644 --- a/packages/security.yaml +++ b/packages/security.yaml @@ -74,6 +74,9 @@ script: entity_id: alarm_control_panel.stratton_ave_alarm data: code: !secret ring_alarm_code + - service: alarm_control_panel.alarm_arm_away + target: + entity_id: alarm_control_panel.alexa_guard_9ee3b security_disarm: alias: Security Disarm @@ -82,4 +85,7 @@ script: target: entity_id: alarm_control_panel.stratton_ave_alarm data: - code: !secret ring_alarm_code \ No newline at end of file + code: !secret ring_alarm_code + - service: alarm_control_panel.alarm_disarm + target: + entity_id: alarm_control_panel.alexa_guard_9ee3b \ No newline at end of file diff --git a/scripts.yaml b/scripts.yaml index 73ab682..07c7d4a 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -21,10 +21,6 @@ stop_netflix: give_me_darkness: alias: Give Me Darkness sequence: - - service: input_boolean.turn_on - data: {} - target: - entity_id: input_boolean.early_night_mode - service: switch.turn_on target: entity_id: @@ -54,6 +50,7 @@ give_me_darkness: option: Nightlight target: entity_id: input_select.upstairs_bathroom_scenes + - service: script.security_arm_home mode: single icon: mdi:weather-night start_youtube: