From 5950e7f352c9687c39703a7cc34d82d7cbef8ea0 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Sat, 4 Feb 2017 02:11:01 +0000 Subject: [PATCH] Added more Voice! Removed some redundant IFTTT triggers. --- automation/announcements.yaml | 24 +++- automation/detect_and_adjust_lights.yaml.old | 127 ------------------- automation/ifttt_amps.yaml | 37 ------ automation/ifttt_guest_mode.yaml | 22 ---- automation/ifttt_printer.yaml | 26 ---- automation/startup_notification.yaml | 8 +- automation/watchdog.yaml | 2 +- input_boolean/home_modes.yaml | 2 +- script/voice_notify.yaml | 2 +- 9 files changed, 31 insertions(+), 219 deletions(-) delete mode 100755 automation/detect_and_adjust_lights.yaml.old delete mode 100755 automation/ifttt_amps.yaml delete mode 100755 automation/ifttt_guest_mode.yaml delete mode 100755 automation/ifttt_printer.yaml diff --git a/automation/announcements.yaml b/automation/announcements.yaml index f7fd7169..f7379264 100755 --- a/automation/announcements.yaml +++ b/automation/announcements.yaml @@ -13,11 +13,31 @@ - device_tracker.franco - device_tracker.yolanda - device_tracker.joyce_ipad + from: 'home' + to: 'not_home' + for: '00:03:00' + + - platform: state + entity_id: + - device_tracker.carlo + - device_tracker.stacey + - device_tracker.franco + - device_tracker.yolanda + - device_tracker.joyce_ipad + from: 'not_home' + to: 'home' + for: '00:03:00' + + - platform: state + entity_id: - cover.garadget_large - cover.garadget_small - + from: 'closed' + to: 'open' + for: '00:03:00' + action: - service: script.Voice_notify data_template: - message: "Attention. {{ trigger.entity_id.split('.')[1].lower().replace('_ipad', '').title() }} is now {{ trigger.to_state.state }}" + message: "Attention. {{ trigger.entity_id.split('.')[1].lower().title() }} is now {{ trigger.to_state.state }}" cache: true \ No newline at end of file diff --git a/automation/detect_and_adjust_lights.yaml.old b/automation/detect_and_adjust_lights.yaml.old deleted file mode 100755 index e32df041..00000000 --- a/automation/detect_and_adjust_lights.yaml.old +++ /dev/null @@ -1,127 +0,0 @@ -############################################################################## -### Detect when lights are turned on and adjust them accordingly based on time. -### Here is 5am to 8am -############################################################################## - -- alias: detect_light_between 5am and 8am - trigger: - - platform: event - event_type: state_changed - condition: - - condition: state - entity_id: group.family - state: home - - condition: time - after: '05:00:00' - - condition: time - before: '7:59:00' - - condition: template - value_template: "{{ trigger.event.data is not none }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id is not none }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.office' }}" - - condition: template - value_template: "{{ trigger.event.data.new_state.state == 'on' }}" - - condition: template - value_template: "{{ trigger.event.data.old_state.state == 'off' }}" -# - condition: template -# value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 50 }}" - action: - - service: light.turn_on - data_template: - entity_id: "{{ trigger.event.data.entity_id }}" - brightness: 50 - -############################################################################## -### Detect when lights are turned on and adjust them accordingly based on time. -### Here is 8am to 8pm -############################################################################## - -- alias: detect_light_between 8am and 8pm - trigger: - - platform: event - event_type: state_changed - condition: - - condition: state - entity_id: group.family - state: home - - condition: time - after: '08:00:00' - - condition: time - before: '20:00:00' - - condition: template - value_template: "{{ trigger.event.data is not none }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id is not none }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.office' }}" - - condition: template - value_template: "{{ trigger.event.data.new_state.state == 'on' }}" - - condition: template - value_template: "{{ trigger.event.data.old_state.state == 'off' }}" - action: - - service: light.turn_on - data_template: - entity_id: "{{ trigger.event.data.entity_id }}" - brightness: 255 - -############################################################################## -### Detect when lights are turned on and adjust them accordingly based on time. -### Here is 8pm to 5am -############################################################################## - -- alias: detect_light_between 8pm and 5am - trigger: - - platform: event - event_type: state_changed - condition: - condition: and - conditions: - - condition: or - conditions: - - condition: time - after: '20:00:01' - - condition: time - before: '12:00:00' - - condition: state - entity_id: sun.sun - state: 'below_horizon' - - condition: state - entity_id: group.family - state: home - - condition: template - value_template: "{{ trigger.event.data is not none }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id is not none }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'light' }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.tv' }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.couch' }}" - - condition: template - value_template: "{{ trigger.event.data.entity_id.split('_')[0] != 'light.office' }}" - - condition: template - value_template: "{{ trigger.event.data.new_state.state == 'on' }}" - - condition: template - value_template: "{{ trigger.event.data.old_state.state == 'off' }}" -# - condition: template -# value_template: "{{ trigger.event.data.new_state.attributes.brightness|default(0)|int > 20 }}" - action: - - service: light.turn_on - data_template: - entity_id: "{{ trigger.event.data.entity_id }}" - brightness: 35 \ No newline at end of file diff --git a/automation/ifttt_amps.yaml b/automation/ifttt_amps.yaml deleted file mode 100755 index 2ea63a00..00000000 --- a/automation/ifttt_amps.yaml +++ /dev/null @@ -1,37 +0,0 @@ -################################### -## Turn on/off Living Room AMPs via ALexa/IFTTT event. -## Currently using this [AMP] (http://amzn.to/2joRrk1) -## [Etekcity Outlets](http://amzn.to/2efNoBP) -## [433Mhz Transmitter and receiver](http://amzn.to/2dceNY2) -################################### - -- alias: 'IFTTT Turn AMP on' - trigger: - - platform: event - event_type: amp_on - - platform: state - entity_id: - - media_player.livingroomcc - - media_player.whole_house - - action: - - service: switch.turn_on - entity_id: switch.living_room_amp - - -- alias: 'IFTTT Turn AMP off' - trigger: - - platform: event - event_type: amp_off - - platform: state - entity_id: - - media_player.livingroomcc - - media_player.whole_house - from: 'playing' - to: 'off' - for: '00:30:00' - - action: - - service: switch.turn_off - entity_id: switch.living_room_amp - diff --git a/automation/ifttt_guest_mode.yaml b/automation/ifttt_guest_mode.yaml deleted file mode 100755 index 3f81d2ee..00000000 --- a/automation/ifttt_guest_mode.yaml +++ /dev/null @@ -1,22 +0,0 @@ -################################### -## Turn on/off Guest Mode via ALexa/IFTTT event. -################################### - -- alias: 'IFTTT Flip Guest Mode on' - trigger: - - platform: event - event_type: guest_mode_on - - action: - - service: input_boolean.turn_on - entity_id: input_boolean.guest_mode - - -- alias: 'IFTTT Flip Guest Mode off' - trigger: - - platform: event - event_type: guest_mode_off - - action: - - service: input_boolean.turn_off - entity_id: input_boolean.guest_mode \ No newline at end of file diff --git a/automation/ifttt_printer.yaml b/automation/ifttt_printer.yaml deleted file mode 100755 index 3859b5c4..00000000 --- a/automation/ifttt_printer.yaml +++ /dev/null @@ -1,26 +0,0 @@ -################################### -## Turn on/off Printer via ALexa/IFTTT event. Turn off automatically after 20 minutes -################################### - -- alias: 'IFTTT Turn Printer on' - trigger: - - platform: event - event_type: printer_on - - action: - - service: switch.turn_on - entity_id: switch.printer_outlet - - delay: 00:20:00 - - service: switch.turn_off - entity_id: switch.printer_outlet - - -- alias: 'IFTTT Turn Printer off' - trigger: - - platform: event - event_type: printer_off - - action: - - service: switch.turn_off - entity_id: switch.printer_outlet - diff --git a/automation/startup_notification.yaml b/automation/startup_notification.yaml index 65a9f6d4..2a7c2bf0 100755 --- a/automation/startup_notification.yaml +++ b/automation/startup_notification.yaml @@ -13,7 +13,11 @@ value1: 'Startup: Home Assistant is Up and Running!' value2: '' value3: '' - + + - service: script.Voice_notify + data: + value1: 'Home Assistant is now online and running.' + - service: light.turn_off entity_id: group.hallway_lights - \ No newline at end of file + \ No newline at end of file diff --git a/automation/watchdog.yaml b/automation/watchdog.yaml index a99a5cca..ccc0f500 100755 --- a/automation/watchdog.yaml +++ b/automation/watchdog.yaml @@ -7,7 +7,7 @@ - platform: state entity_id: switch.printer_outlet state: 'on' - for: '00:35:00' + for: '00:20:00' - platform: state entity_id: switch.garage_outlet state: 'on' diff --git a/input_boolean/home_modes.yaml b/input_boolean/home_modes.yaml index 55b6fee6..48b0483a 100755 --- a/input_boolean/home_modes.yaml +++ b/input_boolean/home_modes.yaml @@ -16,7 +16,7 @@ alert_mode: speech_notifications: name: Speech Notifications icon: mdi:speaker-wireless - initial: off + initial: on chore_reminder: name: chore Reminder diff --git a/script/voice_notify.yaml b/script/voice_notify.yaml index 171dc54d..30b74572 100755 --- a/script/voice_notify.yaml +++ b/script/voice_notify.yaml @@ -24,7 +24,7 @@ voice_notify: - condition: time after: '08:00:00' - before: '20:00:00' + before: '21:00:00' - condition: state entity_id: input_boolean.speech_notifications state: 'on'