From eac2c5b98d69f3843f442f472f6efb1471e2fec5 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Thu, 9 Feb 2017 18:19:22 +0000 Subject: [PATCH] Adding in condition that looks to see if music is playing. --- script/voice_notify.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/script/voice_notify.yaml b/script/voice_notify.yaml index 64edc0ae..96c943d9 100755 --- a/script/voice_notify.yaml +++ b/script/voice_notify.yaml @@ -32,7 +32,13 @@ voice_notify: - condition: state entity_id: input_boolean.speech_notifications state: 'on' - + - condition: template + value_template: > + {% if is_state('media_player.livingroomCC', 'playing') %} + false + {% else %} + true + {% endif %} - service: switch.turn_on entity_id: switch.living_room_amp - delay: '00:00:05' @@ -48,7 +54,7 @@ voice_notify: {% if now().strftime("%H")|int < 12 %} 0.20 {% elif now().strftime("%H")|int < 18 %} - 0.40 + 0.45 {% else %} 0.25 {% endif %}