Check for things Playing and break through alerts.

This commit is contained in:
CCOSTAN
2017-02-25 03:13:18 +00:00
parent ae794b0167
commit 7fcde2a6a8
2 changed files with 22 additions and 10 deletions

View File

@@ -19,6 +19,13 @@
- condition: state
entity_id: group.family
state: 'home'
- condition: template
value_template: >
{% if is_state('media_player.livingroomCC', 'playing') %}
false
{% else %}
true
{% endif %}
action:
- service: media_player.turn_on

View File

@@ -29,9 +29,8 @@ voice_notify:
- condition: state
entity_id: input_boolean.alert_mode
state: 'on'
- condition: state
entity_id: input_boolean.speech_notifications
state: 'on'
- condition: or
conditions:
- condition: template
value_template: >
{% if is_state('media_player.livingroomCC', 'playing') %}
@@ -39,6 +38,12 @@ voice_notify:
{% else %}
true
{% endif %}
- condition: state
entity_id: input_boolean.alert_mode
state: 'on'
- condition: state
entity_id: input_boolean.speech_notifications
state: 'on'
- service: switch.turn_on
entity_id: switch.living_room_amp
- delay: '00:00:05'
@@ -52,11 +57,11 @@ voice_notify:
data_template:
volume_level: >
{% if now().strftime("%H")|int < 12 %}
0.20
0.25
{% elif now().strftime("%H")|int < 18 %}
0.45
{% else %}
0.25
0.20
{% endif %}
- service: mqtt.publish