From fe0e59e31396d3a870fa53a6223fe7a317758b6c Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Thu, 12 Aug 2021 00:37:29 +0200 Subject: [PATCH] Update hallway/front door automations switch calling doorbell automation to async script call increase lights blinking to 10 seconds change doorbell prevention automation from delay to trigger requirement wait door close before locking door turn on/off hallway light on motion --- .../automations/hallway-doorbell.yaml | 19 ++++++++--------- .../automations/hallway-lock-button.yaml | 10 +++++++++ configuration/automations/hallway-motion.yaml | 21 ++++++++++++------- scripts/60.doorbell-bell.yaml | 9 ++++++++ 4 files changed, 42 insertions(+), 17 deletions(-) create mode 100644 scripts/60.doorbell-bell.yaml diff --git a/configuration/automations/hallway-doorbell.yaml b/configuration/automations/hallway-doorbell.yaml index 85687b8..7748d76 100644 --- a/configuration/automations/hallway-doorbell.yaml +++ b/configuration/automations/hallway-doorbell.yaml @@ -16,17 +16,14 @@ entity_id: input_boolean.mute_doorbell state: 'off' sequence: - - service: switch.turn_on - target: - entity_id: switch.doorbell_bell - - service: switch.turn_off - target: - entity_id: switch.doorbell_bell + - service: script.turn_on + entity_id: script.doorbell_bell - service: script.pause_all_players - service: light.turn_on data: effect: Police - entity_id: light.desk_lightbar_ambilight + target: + entity_id: light.desk_lightbar_ambilight - service: zwave.set_config_parameter data: node_id: 12 @@ -35,12 +32,13 @@ - service: switch.turn_on entity_id: switch.siren_switch - delay: - milliseconds: 30 + seconds: 10 - service: light.turn_on data: hs_color: [ 240,100 ] entity_id: light.desk_lightbar_ambilight - - delay: '1' + - delay: + miliseconds: 50 - service: light.turn_off entity_id: light.desk_lightbar_ambilight @@ -52,7 +50,8 @@ entity_id: switch.doorbell_bell from: 'off' to: 'on' + for: + seconds: 1 action: - - delay: '1' - service: switch.turn_off entity_id: switch.doorbell_bell \ No newline at end of file diff --git a/configuration/automations/hallway-lock-button.yaml b/configuration/automations/hallway-lock-button.yaml index 3a4f44c..fa3fcf5 100644 --- a/configuration/automations/hallway-lock-button.yaml +++ b/configuration/automations/hallway-lock-button.yaml @@ -7,6 +7,16 @@ type: remote_button_short_press subtype: turn_off action: + - choose: + - conditions: + - condition: state + entity_id: binary_sensor.front_door_open_close + state: 'on' + sequence: + - wait_for_trigger: + - platform: state + entity_id: binary_sensor.front_door_open_close + to: 'off' - service: lock.lock target: entity_id: lock.front_door_25f246fe_door_lock diff --git a/configuration/automations/hallway-motion.yaml b/configuration/automations/hallway-motion.yaml index 6bbfbce..5e5dcd1 100644 --- a/configuration/automations/hallway-motion.yaml +++ b/configuration/automations/hallway-motion.yaml @@ -1,5 +1,5 @@ - id: hallway-lightstrip-on - alias: '[Hallway] Lights strip on' + alias: '[Hallway] Motion On' mode: restart trigger: - platform: state @@ -20,20 +20,25 @@ state: 'on' sequence: - service: light.turn_on - entity_id: light.hallway_lightstrip + entity_id: light.hallway_light + - service: light.turn_on + entity_id: light.hallway_light data: - brightness_pct: 100 - kelvin: 2000 + brightness_pct: 50 - conditions: - condition: state entity_id: input_boolean.sleep_mode state: 'off' + - condition: numeric_state + entity_id: sensor.kitchen_motion_luminance + below: '25' sequence: - service: light.turn_on - entity_id: light.hallway_lightstrip + entity_id: light.hallway_light + - service: light.turn_on + entity_id: light.hallway_light data: - brightness_pct: 100 - kelvin: 3200 + brightness_pct: 90 - conditions: - condition: state entity_id: input_select.home_mode @@ -60,3 +65,5 @@ action: - service: light.turn_off entity_id: light.hallway_lightstrip + - service: light.turn_off + entity_id: light.hallway_light diff --git a/scripts/60.doorbell-bell.yaml b/scripts/60.doorbell-bell.yaml new file mode 100644 index 0000000..736a8f4 --- /dev/null +++ b/scripts/60.doorbell-bell.yaml @@ -0,0 +1,9 @@ +doorbell_bell: + alias: Doorbell async bell + sequence: + - service: script.turn_on + entity_id: script.doorbell_bell + - delay: + miliseconds: 150 + - service: script.turn_off + entity_id: script.doorbell_bell