Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 102624

Automation trigger on attribute change

$
0
0

@Hellis81 wrote:

I want an automation that triggers when I switch source on the receiver.
When you switch between two sources it’s not uncommon that the volume is too high for the source you switch too.

What can I do to trigger on the attribute source change?

  trigger:
  - platform: template
    value_template: '{{ states.media_player.yamaha_receiver.attributes.source }}'
  condition:
  - condition: state
    entity_id: media_player.yamaha_receiver
    state: 'On'
  - condition: template
    value_template: '{{ states.media_player.yamaha_receiver.attributes.volume_level
      > 0.72 }}'
  action:
  - data:
      volume_level: 0.65
    entity_id: media_player.yamaha_receiver
    service: media_player.volume_set

The attribute source has the following options so making one automation per change is not really ideal:
source_list: AUDIO, AV1, AV2, AV3, AV4, AV5, AV6, AirPlay, HDMI1, HDMI2, HDMI3, HDMI4, NET RADIO, SERVER, TUNER, USB, V-AUX, iPod (USB)

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 102624

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>