From 791630cc3c838d2c2907867dae116520da2ff49e Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Mon, 20 Feb 2017 15:42:00 +0000 Subject: [PATCH] Closes #70 - Split out Watchdog configs --- automation/Speech/new_device.yaml | 15 ++++ automation/System/disk_usage.yaml | 23 ++++++ automation/System/ip_change.yaml | 21 ++++++ automation/System/watchdog.yaml | 99 -------------------------- automation/System/watchdog_light.yaml | 27 +++++++ automation/System/watchdog_switch.yaml | 25 +++++++ 6 files changed, 111 insertions(+), 99 deletions(-) create mode 100755 automation/Speech/new_device.yaml create mode 100755 automation/System/disk_usage.yaml create mode 100755 automation/System/ip_change.yaml delete mode 100755 automation/System/watchdog.yaml create mode 100755 automation/System/watchdog_light.yaml create mode 100755 automation/System/watchdog_switch.yaml diff --git a/automation/Speech/new_device.yaml b/automation/Speech/new_device.yaml new file mode 100755 index 00000000..88f0ecc0 --- /dev/null +++ b/automation/Speech/new_device.yaml @@ -0,0 +1,15 @@ +############################################################################## +### Detect when things are on and forgotten about. Like any Good Watchdog. +############################################################################## + +- alias: "New device connected" + trigger: + - platform: event + event_type: device_tracker_new_device + action: + - service: script.Voice_notify + data_template: + value1: "There has been a new device detected on the network. Be sure to appropriately catagorize it within Circle." + +############################################################################## + diff --git a/automation/System/disk_usage.yaml b/automation/System/disk_usage.yaml new file mode 100755 index 00000000..bdc3175a --- /dev/null +++ b/automation/System/disk_usage.yaml @@ -0,0 +1,23 @@ +############################################################################## +### Detect when things are on and forgotten about. Like any Good Watchdog. +############################################################################## + +- alias: "Disk Use Alarm" + trigger: + - platform: numeric_state + entity_id: sensor.disk_use_ + above: 80 + action: + - service: script.Voice_notify + data_template: + value1: 'ATTENTION: Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!' + - service: script.ifttt_notify + data_template: + value1: 'Hard Drive Monitor:' + value2: "Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!" + value3: ' ' + - service: persistent_notification.create + data: + title: "Hard Drive Monitor:" + message: "Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!" + notification_id: "Critical Alert" diff --git a/automation/System/ip_change.yaml b/automation/System/ip_change.yaml new file mode 100755 index 00000000..338287ff --- /dev/null +++ b/automation/System/ip_change.yaml @@ -0,0 +1,21 @@ +############################################################################## +### Detect when things are on and forgotten about. Like any Good Watchdog. +############################################################################## + +############################################################################## + +- alias: "NOTIFY IF IP CHANGES" + hide_entity: True + trigger: + - platform: state + entity_id: sensor.ipchange + from: 'False' + to: 'True' + action: + - service: script.ifttt_notify + data_template: + value1: 'Changed IP address:' + value2: "New IP: {{ states('sensor.exteral_ip') }}" + value3: ' - Be sure to Change DNS!' + +############################################################################## diff --git a/automation/System/watchdog.yaml b/automation/System/watchdog.yaml deleted file mode 100755 index 1688b6a2..00000000 --- a/automation/System/watchdog.yaml +++ /dev/null @@ -1,99 +0,0 @@ -############################################################################## -### Detect when things are on and forgotten about. Like any Good Watchdog. -############################################################################## - -- alias: Automated Switch WatchDog! - trigger: - - platform: state - entity_id: switch.printer_outlet - state: 'on' - for: '00:20:00' - - platform: state - entity_id: switch.garage_outlet - state: 'on' - for: '03: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 }}" - - ############################################################################## - -- alias: Automated Light WatchDog! - trigger: - - platform: state - entity_id: - - light.hallway - - group.foyer_lights - - light.master_toilet - state: 'on' - for: '00:20:00' - - - platform: state - entity_id: - - light.paige_go - - light.justin_go - - group.upstairs - state: 'on' - for: '02:00:00' - -#Turn it off! - action: - - service: light.turn_off - data_template: - entity_id: "{{ trigger.entity_id }}" - -############################################################################## - -- alias: "NOTIFY IF IP CHANGES" - hide_entity: True - trigger: - - platform: state - entity_id: sensor.ipchange - from: 'False' - to: 'True' - action: - - service: script.ifttt_notify - data_template: - value1: 'Changed IP address:' - value2: "New IP: {{ states('sensor.exteral_ip') }}" - value3: ' - Be sure to Change DNS!' - -############################################################################## - -- alias: "New device connected" - trigger: - - platform: event - event_type: device_tracker_new_device - action: - - service: script.Voice_notify - data_template: - value1: "There has been a new device detected on the network. Be sure to appropriately catagorize it within Circle." - -############################################################################## - -- alias: "Disk Use Alarm" - trigger: - - platform: numeric_state - entity_id: sensor.disk_use_ - above: 80 - action: - - service: script.Voice_notify - data_template: - value1: 'ATTENTION: Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!' - - service: script.ifttt_notify - data_template: - value1: 'Hard Drive Monitor:' - value2: "Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!" - value3: ' ' - - service: persistent_notification.create - data: - title: "Hard Drive Monitor:" - message: "Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_.state }}%!" - notification_id: "Critical Alert" \ No newline at end of file diff --git a/automation/System/watchdog_light.yaml b/automation/System/watchdog_light.yaml new file mode 100755 index 00000000..620db2e8 --- /dev/null +++ b/automation/System/watchdog_light.yaml @@ -0,0 +1,27 @@ +############################################################################## +### Detect when things are on and forgotten about. Like any Good Watchdog. +############################################################################## + +- alias: Automated Light WatchDog! + trigger: + - platform: state + entity_id: + - light.hallway + - group.foyer_lights + - light.master_toilet + state: 'on' + for: '00:20:00' + + - platform: state + entity_id: + - light.paige_go + - light.justin_go + - group.upstairs + state: 'on' + for: '02:00:00' + +#Turn it off! + action: + - service: light.turn_off + data_template: + entity_id: "{{ trigger.entity_id }}" diff --git a/automation/System/watchdog_switch.yaml b/automation/System/watchdog_switch.yaml new file mode 100755 index 00000000..20ad7196 --- /dev/null +++ b/automation/System/watchdog_switch.yaml @@ -0,0 +1,25 @@ +############################################################################## +### Detect when things are on and forgotten about. Like any Good Watchdog. +############################################################################## + +- alias: Automated Switch WatchDog! + trigger: + - platform: state + entity_id: switch.printer_outlet + state: 'on' + for: '00:20:00' + - platform: state + entity_id: switch.garage_outlet + state: 'on' + for: '03: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 }}" +