#Wake up music playlist.

1 messages · Page 1 of 1 (latest)

hallow wharf
#

Hello all, I am trying to make a automation to play and stop a playlist from my spotify on my sonos, from what i know the output device is proper(i checked that with the blocks) and everything else should be(at least on the starting automation) but i dont seem to be able to select the playlist properly. could anyone help me out with that? here is all the code that chatgpt helped me make(i am still learning all of this)

script for making music go louder over a set time(10% to 20% over 15 minutes)
`alias: Wake Up Volume Ramp
sequence:

  • repeat:
    count: 16
    sequence:
    - data:
    volume_level: "{{ 0.1 + (0.15 * (repeat.index / 20)) }}"
    action: media_player.volume_set
    target:
    entity_id: media_player.living_room
    - delay: "00:01:00"
    mode: single
    description: ""
    `

start script
`alias: Wake Up - Morning Start
description: ""
triggers:

  • at: "20:04:30"
    trigger: time
    conditions:
  • condition: time
    weekday:
    • mon
    • tue
    • wed
    • thu
    • fri
      actions:
  • data:
    entity_id: media_player.living_room
    volume_level: 0.05
    action: media_player.volume_set
  • data:
    media_player: media_player.living_room
    media_id: >-
    spotify.com/playlist/3xqJHYiI1lZITmctlsYti4?trackId=0uHvphIXwdQlj8Q6GJVAgR
    media_type: playlist
    shuffle: true
    action: music_assistant.play_media
  • delay: "00:00:10"
  • action: script.wake_up_volume_ramp
    data: {}
    mode: single
    `

end script
`alias: Wake Up - Stop Fallback
description: ""
triggers:

  • at: "07:45:00"
    trigger: time
    conditions:
  • condition: state
    entity_id: media_player.living_room
    state: playing
  • condition: template
    value_template: |
    {{ state_attr('media_player.living_room', 'media_title') == 'Wake up' }}
    actions:
  • data:
    entity_id: media_player.living_room
    action: media_player.media_stop
    mode: single
    `

in the picture i shoe how it looks like in the gui, i cant select a playlist there, i do however have the correct link for the spotify playlist as i was told in teh music assistant documentation.

quasi tulip
#

The music_assistant action is wrong. You added shuffle: true which does not exist as an option, and missed the target. Try this:

action: music_assistant.play_media
data:
  media_id: spotify.com/playlist/3xqJHYiI1lZITmctlsYti4?trackId=0uHvphIXwdQlj8Q6GJVAgR
  media_type: playlist
target:
 entity_id: media_player.living_room
#

The target is missing also in the other actions. Test your code in the Developer Tools -> Actions

hallow wharf