Play random mp3 help

hi guys,

i’m trying to set up an morning alarm that triggers a random list of mp3 yet i cant seem go get it to work.

- alias: daylight saving morning
  trigger:
    - platform: time
      at: '06:38:00'
  condition:
    condition: and
    conditions:
    - condition: numeric_state
      entity_id: sun.sun
      value_template: '{{ state.attributes.elevation }}'
      above: 0
    - condition: state
      entity_id: binary_sensor.workday_sensor
      state: 'on'
    - condition: state
      entity_id: alarm_control_panel.yale_smart_alarm
      state: 'armed_home'
  action:
   - service: media_player.volume_set
     entity_id: media_player.main_speaker
     data:
        volume_level: 0.4
   - service: media_player.play_media
     entity_id: media_player.main_speaker
     data_template:
      media_content_id: >
        {{ [https://mydomain.com/local/sounds/waitinginline.mp3, https://mydomain..com/local/sounds/solo_dance.mp3, https://mydomain..com/local/sounds/hold_back_river.mp3, https://mydomain..com/local/sounds/Clockwatching.mp3] | random}}
      media_content_type: ‘music’

for contexts i have one that uses the same conditions expect if the sun is below the horizon it will turn my our light to 100% gradually. im now trying to set one up to play music when its light outside at the set time.

Quoting is wrong. Try:

      media_content_id: >
        {{ ['https://mydomain.com/local/sounds/waitinginline.mp3',
            'https://mydomain..com/local/sounds/solo_dance.mp3',
            'https://mydomain..com/local/sounds/hold_back_river.mp3',
            'https://mydomain..com/local/sounds/Clockwatching.mp3'] | random}}
      media_content_type: 'music'
1 Like

I’m a muppet!
Thank you so much

1 Like

Does this still work? Trying to use but, got errors in the developer tools and also if I try to set up an automation with that kind media_content_id.
Any advice?