From 3679b9511d7b3b36fbfbb59e0706a933d6f22033 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Fri, 3 Feb 2017 20:12:21 +0000 Subject: [PATCH] Adding Voice Notifications to the house. Mic Drop! --- automation/ifttt_amps.yaml | 20 ++++++++----------- script/skybell_pressed.yaml | 4 ++++ script/voice_notify.yaml | 38 +++++++++++++++++++++++++++++-------- 3 files changed, 42 insertions(+), 20 deletions(-) diff --git a/automation/ifttt_amps.yaml b/automation/ifttt_amps.yaml index b4c24065..2ea63a00 100755 --- a/automation/ifttt_amps.yaml +++ b/automation/ifttt_amps.yaml @@ -10,13 +10,10 @@ - platform: event event_type: amp_on - platform: state - entity_id: media_player.whole_house - from: 'off' - to: 'playing' - - platform: state - entity_id: media_player.livingroomcc - from: 'off' - to: 'playing' + entity_id: + - media_player.livingroomcc + - media_player.whole_house + action: - service: switch.turn_on entity_id: switch.living_room_amp @@ -27,13 +24,12 @@ - platform: event event_type: amp_off - platform: state - entity_id: media_player.whole_house - from: 'playing' - to: 'off' - - platform: state - entity_id: media_player.livingroomcc + entity_id: + - media_player.livingroomcc + - media_player.whole_house from: 'playing' to: 'off' + for: '00:30:00' action: - service: switch.turn_off diff --git a/script/skybell_pressed.yaml b/script/skybell_pressed.yaml index 9a9b84a3..d433e3ab 100755 --- a/script/skybell_pressed.yaml +++ b/script/skybell_pressed.yaml @@ -12,6 +12,10 @@ skybell_pressed: data: name: "SkyBell HD Doorbell:" message: "Someone Pressed the Doorbell." + + - service: script.Voice_notify + data: + value1: 'Please check the Front Door. Someone Pressed the Doorbell.' - service: script.flash_notify diff --git a/script/voice_notify.yaml b/script/voice_notify.yaml index 5d8722e9..43f434c9 100755 --- a/script/voice_notify.yaml +++ b/script/voice_notify.yaml @@ -1,17 +1,39 @@ ###################################################################################################### -###Script to send notifications to IFTTT to notify me on the mobile Phone! Call like this: +###Script to send notifications to the ChromeCast Audios during normal hours and only when we are home! Call like this: # action: - # service: script.ifttt_notify + # service: script.Voice_notify # data_template: # value1: 'Startup: Home Assistant is Up and Running!' - # value2: '' - # value3: "{{ trigger.to_state.state }}" + # OR + # value1: "{{ trigger.to_state.state }}" - # IFTTT Maker channel should look like this: https://files.gitter.im/home-assistant/home-assistant/phkx/blob ###################################################################################################### -ifttt_notify: +voice_notify: sequence: - - service: ifttt.trigger - data_template: {"event":"ifttt_notify", "value1":"{{ value1 }}", "value2":"{{ value2 }}", "value3":"{{ value3 }}"} + - condition: and + conditions: + - condition: or + conditions: + - condition: state + entity_id: group.family + state: 'home' + - condition: state + entity_id: input_boolean.guest_mode + state: 'on' + + - condition: time + before: '20:00:00' + + - service: switch.turn_on + entity_id: switch.living_room_amp + - delay: '00:00:10' + + - service: tts.google_say + entity_id: media_player.whole_house + data_template: + message: "{{ value1 }}" + cache: true + +