Added more Voice! Removed some redundant IFTTT triggers.

This commit is contained in:
CCOSTAN 2017-02-04 02:11:01 +00:00
parent 79c584f5ed
commit 5950e7f352
9 changed files with 31 additions and 219 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -16,7 +16,7 @@ alert_mode:
speech_notifications:
name: Speech Notifications
icon: mdi:speaker-wireless
initial: off
initial: on
chore_reminder:
name: chore Reminder

View File

@ -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'