From 031775ec647cf62452d5dc42f58956eb4052add2 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Sun, 11 Dec 2016 20:23:24 +0000 Subject: [PATCH] Check for external IP changes! --- README.md | 2 -- ...night_helper.yaml => late_night_helper.yaml.old} | 8 +++++++- automation/watchdog.yaml | 13 +++++++++++++ sensor/systemmonitor.yaml | 13 ++++++++++++- 4 files changed, 32 insertions(+), 4 deletions(-) rename automation/{late_night_helper.yaml => late_night_helper.yaml.old} (81%) diff --git a/README.md b/README.md index 4bbce18e..c4527a64 100755 --- a/README.md +++ b/README.md @@ -54,10 +54,8 @@ Software on the Pi : [Home Assistant](https://home-assistant.io/) , [Dasher](htt #Todo List -* Create script/automation for staggered shutdown of switches. (Nighttime stuff) * AutoIt script to control lights via REST and also auto light office when I am working on Laptop. * On motion from Doorbell (IFTTT) Turn front lights to Bright White lights for 10 minutes and then back to original colors. -* Notifications and Close garage doors if left open after 9 or 10 PM. * Monitor the reflection rates of Garadget and notify when they being to drop too low when closed (indicating a shift in the controller) * Configure the Alexa Component. * Put Dash Buttons out there. diff --git a/automation/late_night_helper.yaml b/automation/late_night_helper.yaml.old similarity index 81% rename from automation/late_night_helper.yaml rename to automation/late_night_helper.yaml.old index e238bc48..1aeeeee0 100755 --- a/automation/late_night_helper.yaml +++ b/automation/late_night_helper.yaml.old @@ -41,7 +41,13 @@ brightness: 150 - service: switch.turn_on entity_id: switch.kitchen_accents - - delay: 00:08:00 + - delay: '00:00:30' + - service: switch.turn_on + - entity_id: switch.living_room_outlet + - delay: '00:00:30' + - service: switch.turn_on + entity_id: switch.foyer_outlet + - delay: '00:08:00' - service: light.turn_off entity_id: - light.S1 diff --git a/automation/watchdog.yaml b/automation/watchdog.yaml index 74e61a5f..02572e04 100755 --- a/automation/watchdog.yaml +++ b/automation/watchdog.yaml @@ -106,3 +106,16 @@ entity_id: group.outdoor_lights ############################################################################## + +- alias: "NOTIFY IF IP CHANGES" + 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 Cahnge DNS!' diff --git a/sensor/systemmonitor.yaml b/sensor/systemmonitor.yaml index e9473580..10badc03 100755 --- a/sensor/systemmonitor.yaml +++ b/sensor/systemmonitor.yaml @@ -6,7 +6,7 @@ resources: # - type: last_boot - type: since_last_boot - + - platform: template sensors: since_last_boot_templated: @@ -50,3 +50,14 @@ {{ seconds }} seconds {%- endif -%} {%- endif -%} + +- platform: rest + resource: http://ip.jsontest.com + name: External IP + value_template: '{{ value_json.ip }}' + +- platform: template + sensors: + ipchange: + entity_id: sensor.external_ip + value_template: "{%- if is_state('sensor.external_ip', '67.8.31.24') -%} False {%- else -%} True {%- endif %}" \ No newline at end of file