From dad3f33b1ef6a32e0e5cf61010a0086dda289f75 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sat, 25 Feb 2023 20:13:01 -0500 Subject: [PATCH] Tornado all-clear smarter --- automations.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/automations.yaml b/automations.yaml index bdf3c49..923de38 100644 --- a/automations.yaml +++ b/automations.yaml @@ -470,6 +470,37 @@ who: everywhere message: Tornado warning has been cleared. Check your surroundings and make sure it is safe to leave cover. + - wait_template: '{{ is_state(''input_boolean.tornado_alarm'',''on'') }}' + continue_on_timeout: true + timeout: 00:05:00 + alias: Make sure no further warnings are issued + - if: + - condition: state + entity_id: input_boolean.tornado_alarm + state: 'off' + then: + - if: + - condition: or + conditions: + - condition: time + before: input_datetime.audible_notification_on + alias: Before audible notifications on + - condition: time + after: input_datetime.audible_notification_off + alias: After audible notifications off + alias: Should audible notifications be off + then: + - service: input_boolean.turn_off + data: {} + target: + entity_id: input_boolean.audible_notifications + else: + - service: input_boolean.turn_on + data: {} + target: + entity_id: input_boolean.audible_notifications + else: + - stop: Tornado alert re-activated mode: single - id: '1666474050350' alias: Garbage Collection Update