From fec6c0e51da21549b511eedd9fc39ee31eebe61f Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Tue, 27 Dec 2016 19:36:09 +0000 Subject: [PATCH] Turn onthe AMPs if music starts streaming! and then off. --- README.md | 1 + automation/ifttt_amps.yaml | 61 ++++++++++++++++++++++++-------------- 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 5620c6eb..4b94073f 100755 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Software on the Pi : [Home Assistant](https://home-assistant.io/) , [Dasher](htt * Rainy days trigger extra light inside the house. * Detects when lights are turned on and adjusts them to correct brightness based on time of day. * Leverage Alexa, IFTTT and Elekcity outlet to control Printer On/Off via Voice. Turns off automatically after 20 minutes. +* Turn on AMPs when Chromecast reports 'Playing'. Turn them off when we are done streaming music. * (IFTTT) Blink ALL lights at 9:30 to remind me to take medicine. (also Alexa Alert) * (IFTTT) Blink Office lights 15 minutes before ANY meeting on my calendar (using IFTTT) * (IFTTT) Stop watering grass via Rachio if winds are greater than 20 MPH. diff --git a/automation/ifttt_amps.yaml b/automation/ifttt_amps.yaml index 6d024567..930558b4 100755 --- a/automation/ifttt_amps.yaml +++ b/automation/ifttt_amps.yaml @@ -1,23 +1,38 @@ -################################### -## Turn on/off Living Room AMPs via ALexa/IFTTT event. -################################### - -- alias: 'IFTTT Turn AMP on' - trigger: - - platform: event - event_type: amp_on - - action: - - service: switch.turn_on - entity_id: switch.living_room_amp - - -- alias: 'IFTTT Turn AMP off' - trigger: - - platform: event - event_type: amp_off - - action: - - service: switch.turn_off - entity_id: switch.living_room_amp - +################################### +## Turn on/off Living Room AMPs via ALexa/IFTTT event. +################################### + +- alias: 'IFTTT Turn AMP on' + trigger: + - 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' + 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.whole_house + from: 'playing' + to: 'off' + - platform: state + entity_id: media_player.livingroomcc + from: 'playing' + to: 'off' + + action: + - service: switch.turn_off + entity_id: switch.living_room_amp +