From b27c62d633740ac689b9b9d162ed124c95edf79c Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Thu, 23 Feb 2017 01:14:00 +0000 Subject: [PATCH] Created #74 and added more Alert Mode logic. --- .../Speech/garadget_Wind_Speed_Check.yaml | 32 +++++++++++++++++++ automation/Speech/garage.yaml | 9 ++++-- script/front_house_motion.yaml | 9 ++---- script/voice_notify.yaml | 23 ++++++------- 4 files changed, 53 insertions(+), 20 deletions(-) create mode 100755 automation/Speech/garadget_Wind_Speed_Check.yaml diff --git a/automation/Speech/garadget_Wind_Speed_Check.yaml b/automation/Speech/garadget_Wind_Speed_Check.yaml new file mode 100755 index 00000000..512266db --- /dev/null +++ b/automation/Speech/garadget_Wind_Speed_Check.yaml @@ -0,0 +1,32 @@ +################################### +## Garadget Stuff - [Garadget](http://amzn.to/2jQLpVQ) - Garage Door opener/sensor +################################### + +- alias: 'Wind Speed Garage Door Check' + hide_entity: True + trigger: + - platform: numeric_state + entity_id: sensor.dark_sky_wind_speed + above: 25 + + condition: + - condition: or + conditions: + - condition: template + value_template: "{{ states('cover.large_garage') == 'opened' }}" + - condition: template + value_template: "{{ states('cover.small_garage') == 'opened'}}" + + action: + - service: script.ifttt_notify + data_template: + value1: 'Check Garage Doors:' + value2: "Small: {{ states('cover.small_garage')}}" + value3: "Large: {{ states('cover.large_garage')}}" + + - service: input_boolean.turn_on + entity_id: input_boolean.alert_mode + + - service: script.Voice_notify + data_template: + value1: "Please check the garage doors. The Small garage is {{ states('cover.small_garage')}} and the large garage is {{ states('cover.large_garage')}}" diff --git a/automation/Speech/garage.yaml b/automation/Speech/garage.yaml index 8963734c..95e6b1f4 100755 --- a/automation/Speech/garage.yaml +++ b/automation/Speech/garage.yaml @@ -2,7 +2,7 @@ ## Garage Status Announcements ###################################################################### - alias: 'Garage Status' - + trigger: - platform: state entity_id: @@ -11,7 +11,7 @@ from: 'closed' to: 'open' for: '00:02:00' - + - platform: state entity_id: - cover.large_garage @@ -19,8 +19,11 @@ from: 'open' to: 'closed' for: '00:02:00' - + action: + - service: input_boolean.turn_on + entity_id: input_boolean.alert_mode + - service: script.Voice_notify data_template: value1: "The {{ trigger.entity_id.split('.')[1]|replace('_', ' ')|replace('garadget large', 'large garage ')|replace('garadget small', 'small garage ') }} is now {{ (trigger.to_state.state)|replace('_', ' ') }}." diff --git a/script/front_house_motion.yaml b/script/front_house_motion.yaml index c4954e48..be0c5210 100755 --- a/script/front_house_motion.yaml +++ b/script/front_house_motion.yaml @@ -17,17 +17,14 @@ front_house_motion: state: 'below_horizon' - service: input_boolean.turn_on - data: - entity_id: input_boolean.alert_mode + entity_id: input_boolean.alert_mode + - service: script.Voice_notify data: value1: 'Motion has been detected by the front door.' - - service: input_boolean.turn_off - data: - entity_id: input_boolean.alert_mode - service: scene.turn_on entity_id: scene.front_full_brightness - - delay: '00:{{ (range(5, 20)|random|int) }}:00' + - delay: '00:{{ (range(5, 20)|random|int) }}:00' - service: light.turn_off entity_id: group.outdoor_front_lights - delay: '00:00:10' diff --git a/script/voice_notify.yaml b/script/voice_notify.yaml index f15133d9..48a7fe80 100755 --- a/script/voice_notify.yaml +++ b/script/voice_notify.yaml @@ -6,7 +6,7 @@ # value1: 'Startup: Home Assistant is Up and Running!' # OR # value1: "{{ trigger.to_state.state }}" - + ###################################################################################################### voice_notify: @@ -28,7 +28,7 @@ voice_notify: before: '22:00:00' - condition: state entity_id: input_boolean.alert_mode - state: 'on' + state: 'on' - condition: state entity_id: input_boolean.speech_notifications state: 'on' @@ -40,16 +40,16 @@ voice_notify: true {% endif %} - service: switch.turn_on - entity_id: switch.living_room_amp + entity_id: switch.living_room_amp - delay: '00:00:05' - + - service: media_player.turn_on - entity_id: media_player.livingroomCC - + entity_id: media_player.livingroomCC + - service: media_player.volume_set entity_id: - media_player.livingroomCC - data_template: + data_template: volume_level: > {% if now().strftime("%H")|int < 12 %} 0.20 @@ -64,7 +64,7 @@ voice_notify: payload: '{{ value1 }}' topic: 'polly/lastmsg' retain: true - + - service: tts.amazon_polly_say entity_id: media_player.livingroomCC data_template: @@ -78,7 +78,8 @@ voice_notify: {% endif %} {{ value1 }}" cache: true - - - service: input_boolean.turn_off - entity_id: input_boolean.last_message + - service: input_boolean.turn_off + entity_id: + - input_boolean.last_message + - input_boolean.alert_mode