Do not adjust volume if muted
This commit is contained in:
@@ -21,6 +21,9 @@ input_boolean:
|
||||
ht_adjust_volume_hvac:
|
||||
name: Home Theater Adjust Volume for HVAC
|
||||
|
||||
ht_volume_adjusted:
|
||||
name: Home Theater Volume is Adjusted
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Media Player Scripts
|
||||
script:
|
||||
@@ -127,7 +130,9 @@ automation:
|
||||
to: "on"
|
||||
condition:
|
||||
- "{{ is_state('input_boolean.ht_adjust_volume_hvac', 'on') }}"
|
||||
- "{{ is_state('input_boolean.ht_volume_adjusted', 'off') }}"
|
||||
- "{{ is_state('media_player.living_room_receiver', 'on') }}"
|
||||
- "{{ is_state_attr('media_player.living_room_receiver', 'is_volume_muted', 'off') }}"
|
||||
action:
|
||||
- repeat:
|
||||
count: 6
|
||||
@@ -138,6 +143,10 @@ automation:
|
||||
target:
|
||||
entity_id: media_player.living_room_receiver
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.ht_volume_adjusted
|
||||
|
||||
- alias: Turn Down Volume when HVAC Fan Stops
|
||||
trigger:
|
||||
- platform: state
|
||||
@@ -148,7 +157,9 @@ automation:
|
||||
seconds: 45
|
||||
condition:
|
||||
- "{{ is_state('input_boolean.ht_adjust_volume_hvac', 'on') }}"
|
||||
- "{{ is_state('input_boolean.ht_volume_adjusted', 'on') }}"
|
||||
- "{{ is_state('media_player.living_room_receiver', 'on') }}"
|
||||
- "{{ is_state_attr('media_player.living_room_receiver', 'is_volume_muted', 'off') }}"
|
||||
action:
|
||||
- repeat:
|
||||
count: 6
|
||||
@@ -158,3 +169,7 @@ automation:
|
||||
- service: media_player.volume_down
|
||||
target:
|
||||
entity_id: media_player.living_room_receiver
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.ht_volume_adjusted
|
||||
|
||||
Reference in New Issue
Block a user