Change based on state change with media_player

Hi

I tried to setup an automation based on a state change of my media_player (in this case a Home Max).

- id: 'aux_volume_level'
  alias: AUX Volume Level
  trigger:
  - platform: template
    value_template: "{{ is_state_attr('media_player.living_room_speaker', 'media_content_id', 'AUX') }}"
  action:
  - data:
      volume_level: 0.1
    entity_id: media_player.living_room_speaker
    service: media_player.volume_set

The state attributes when in the state are the following for the media_player

volume_level: 1
is_volume_muted: false
media_content_id: AUX
media_content_type: music
media_position: 4158.64
media_position_updated_at: '2020-06-28T12:52:17.059861+00:00'
media_title: AUX
app_id: BDC14BAC
app_name: Local Audio
friendly_name: Living Room Speaker
supported_features: 21389

what did i do wrong that the automation won’t get triggered?

Does the value_template work (true/false) when you paste it in Developer Tools -> Template?

Yes the response of the Developer Tool is True (if state is AUX) and false if its in another state (in my try playing spotify)

Hm, weird, looks fine… You reloaded the automations as well? (Configuration-Server Control-Reload Automations)
Anything in the log?
Have you tried using a different action for testing purposes?

Note that, like most state-based triggers, that trigger will only “fire” when media_player.living_room_speaker changes state (including any of its attributes.) If the media player hasn’t changed, even if the template statically evaluates to true, the trigger won’t fire.

Have you tested the automation by making the media_content_id attribute change somehow?