Only first added Song is played as "next song", all the others is put at the end of the default playlist queue
Hey there,
thanks for your jukebox, so far its amazing and (as seen in other currently opened issues) i've figured out how to get it to work almost perfectly now.
- My only issue at this moment is, that if i start the Jukebox, it will start the default playlist as it should.
- Then I add a new song via the JukeBox Interface, this song is now shown as "Play next" song within the Jukebox Interface aswell as in MAs queue.
- When i now add another song, that one is not put as "play next", but is put at the very end of the default queue. So if the default queue has 100 songs in it, its not gonna play the added songs for hours.
Is this the expected behaviour or should added songs always get prioritized over the default playlist?
Have a lovely day and thanks for this awesome integration! $me
Heyo,
i've fixed this too. The problem seems to reside on Sonos, the last song in a queue of a sonos player doesnt put the speaker into "idle" but "paused" state, thus it doesnt trigger and set the queue length to 0 (it remains on 1, and with 1, it doesnt trigger the default playlist).
To fix it all and getting it to work i've changed this: 1. Add new trigger:
- trigger: state entity_id: media_player.office to: paused id: Player paused
2. added these conditions: - conditions: - condition: trigger id: Player paused - condition: template value_template: > {{ state_attr('media_player.office', 'media_position') | float > (state_attr('media_player.office', 'media_duration') | float - 2) }} - condition: state entity_id: number.music_assistant_jukebox_jukebox_queue_length state: "1" - condition: state entity_id: switch.music_assistant_jukebox_jukebox_allow_access state: "on" sequence: - target: entity_id: number.music_assistant_jukebox_jukebox_queue_length data: value: 0 action: number.set_value
So the script triggers on pause if the queue length is 1 and the remaininng time is less than 2 seconds and its the last track of the queue and switch.music_assistant_jukebox_jukebox_allow_access is active
Hope that makes sense
Ok i think it was probably a user error, it works fine now :) i did have to change the automation tho as stated above for the default playlist to start playing again after the last track, because sonos apparently remains in Paused instead of Idle after the last song has played.
Cheers