feat: Add Garage Door Close script with checking
This commit is contained in:
@@ -226,6 +226,51 @@ script:
|
||||
entity_id: input_boolean.disable_camera_events
|
||||
- service: script.resume_camera_events
|
||||
|
||||
close_garage_door:
|
||||
alias: Close Garage Door
|
||||
mode: queued
|
||||
sequence:
|
||||
- if:
|
||||
- alias: Garage Door is Already Closed
|
||||
condition: state
|
||||
entity_id: binary_sensor.garage_door
|
||||
state: 'off'
|
||||
then:
|
||||
- alias: Skip Closing
|
||||
stop: "Close Garage Door" called when garage door is already closed
|
||||
|
||||
- alias: Close garage door
|
||||
action: switch.turn_on
|
||||
target:
|
||||
entity_id: switch.garage_door_relay_1
|
||||
|
||||
- alias: Wait for Garage Door to Close
|
||||
wait_for_trigger:
|
||||
platform: state
|
||||
entity_id: binary_sensor.garage_door
|
||||
to: 'off'
|
||||
timeout:
|
||||
seconds: 30
|
||||
|
||||
- alias: Process Trigger
|
||||
choose:
|
||||
- conditions: "{{ 'completed' not in wait or not wait.completed }}"
|
||||
sequence:
|
||||
- alias: Notify that the Garage Door did not Close
|
||||
action: notify.security
|
||||
data:
|
||||
message: Garage door did not close within 30 seconds
|
||||
- alias: Notify that the Garage Door did not Close (ntfy)
|
||||
action: shell_command.ntfy
|
||||
data:
|
||||
topic: security
|
||||
tags:
|
||||
- garage
|
||||
title: Garage Door Failed to Close
|
||||
message: Garage door did not close within 30 seconds
|
||||
- stop: Garage door did not close within 30 seconds
|
||||
error: true
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Security Automations
|
||||
automation:
|
||||
@@ -823,7 +868,7 @@ automation:
|
||||
title: Garage Door Cancelled
|
||||
message: "Garage door timeout cancelled because alarm was disarmed"
|
||||
|
||||
- conditions: "{{ not wait.completed }}"
|
||||
- conditions: "{{ 'completed' not in wait or not wait.completed }}"
|
||||
sequence:
|
||||
- alias: Close garage door
|
||||
action: switch.turn_on
|
||||
|
||||
Reference in New Issue
Block a user