Help with spotify template

Its almost Christmas and i want to have light mood when playing Christmas songs but i cant get it to work. Is there anyone who can see my mistake?

- alias: "xmas_song"
  trigger:
    platform: state
    entity_id: media_player.spotify
    to: 'playing'
  condition:
  - condition: template
    value_template: '{{ states.media_player.spotify.attributes.media_album_name == "Christmas Songs" }}'
  - condition: template
    value_template: '{{ states.media_player.spotify.attributes.media_album_name == "The Classic Christmas Album" }}'
  action:
    - service: light.turn_on
      data: 
        entity_id: light.living_room_window_light
        rgb_color: [255,0,67]
        brightness: 179
        transition: 10
    - service: light.turn_on
      data: 
        entity_id: light.hue_color_candle_1
        rgb_color: [255,0,67]
        brightness: 179
        transition: 10
    - service: light.turn_on
      data: 
        entity_id: light.hue_color_candle_1_2
        rgb_color: [69,255,65]
        brightness: 60
        transition: 10
    - service: light.turn_on
      data: 
        entity_id: light.bookshelf_color
        rgb_color: [255,43,48]
        brightness: 60
        transition: 10
    - service: light.turn_on
      data: 
        entity_id: light.book_shelf_color_two
        rgb_color: [81,255,119]
        brightness: 60
        transition: 10
    - service: light.turn_on
      data: 
        entity_id: light.onoff_plug_3

Just off the top of my head, each
- condition
needs to be indented by two more spaces. See example here.

Thank you for swift help but that didnt solve the automation.

I have also tried (without any luck):

- alias: "xmas_song"
  trigger:
    platform: state
    entity_id: media_player.all
    to: 'playing'
  condition:
    - condition: template
      value_template: '{{ states.media_player.all.attributes.media_content_id == "spotify:track:4ylXKnf5PQdCcOiXzKGysV" }}'
    - condition: template
      value_template: '{{ states.media_player.all.attributes.media_content_id == "spotify:track:3IfnHtJEDnOP7J2qXN9wsi" }}'

I believe the default behavior for multiple conditions is AND. In other words, both conditions have to be true for the action to proceed. In this case, I think you probably want OR so that the action occurs if either of the conditions is true.

Here’s an example of the use of condition: or with multiple conditions.

1 Like

Ah thats where the problem was. Thank you!