From cbaa1aa2f5bd0c6f7c23429eceb20c1967bfb1b9 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Thu, 2 Mar 2017 03:46:37 +0000 Subject: [PATCH] Closes #90 - Turns off AMP after an alert turns it on. 20 minute count down. --- automation/Timed_Triggers/night_watchdog.yaml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 automation/Timed_Triggers/night_watchdog.yaml diff --git a/automation/Timed_Triggers/night_watchdog.yaml b/automation/Timed_Triggers/night_watchdog.yaml new file mode 100755 index 00000000..86935927 --- /dev/null +++ b/automation/Timed_Triggers/night_watchdog.yaml @@ -0,0 +1,28 @@ +###################################################################### +## Stuff that needs to happen after 10pm. +###################################################################### + +- alias: Automated NIGHT WatchDog! + trigger: + - platform: state + entity_id: switch.living_room_amp + state: 'on' + for: '00:20:00' + + condition: + - condition: state + entity_id: sun.sun + state: 'below_horizon' + - condition: time + after: '22:00:00' + before: '09:00:00' + +#Turn it off twice for good measure! + action: + - service: switch.turn_off + data_template: + entity_id: "{{ trigger.entity_id }}" + - delay: 00:01:00 + - service: switch.turn_off + data_template: + entity_id: "{{ trigger.entity_id }}"