jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.83k stars 462 forks source link

Using presets just reloads currently playing content #858

Open fishbrainsD opened 1 year ago

fishbrainsD commented 1 year ago

I've only tried presets which change the content playing in a single room. If the room is completely "blank" ie it has no previous content displayed in the sonos app (i presume this state happens when nothing has been played in that room for some time) my preset works absolutely fine and plays the content as expected.

If there is something stopped or paused in that room the preset will reload whatever the last thing played or playing. If thats a radio station it will stop and then reload it. If its a personalised apple "radio station" it will stop the current track and play a different one.

I have tried this with different favorites and using "URL": to play favorites via a url instead. Same result.

Heres an example of one of my preset files:

{ "players": [ { "roomName": "Bedroom", "volume": 10}

], "playMode": { "shuffle": true, "repeat": "all", "crossfade": false }, "pauseOthers": false, "favorite": "Radio 4" }

Running on osx, node v18.12.0

jishi commented 1 year ago

Hm... What kind of source is your favorite "Radio 4"?

Csn you start the favorite with the /bedroom/favorite/Radio%204 call? Does that work?

On Sat, 12 Nov 2022, 21:31 fishbrainsD, @.***> wrote:

I've only tried presets which change the content playing in a single room. If the room is completely "blank" ie it has no previous content displayed in the sonos app (i presume this state happens when nothing has been played in that room for some time) my preset works absolutely fine and plays the content as expected.

If there is something stopped or paused in that room the preset will reload whatever the last thing played or playing. If thats a radio station it will stop and then reload it. If its a personalised apple "radio station" it will stop the current track and play a different one.

I have tried this with different favorites and using "URL": to play favorites via a url instead. Same result.

Heres an example of one of my preset files:

{ "players": [ { "roomName": "Bedroom", "volume": 10}

], "playMode": { "shuffle": true, "repeat": "all", "crossfade": false }, "pauseOthers": false, "favorite": "Radio 4" }

Running on osx, node v18.12.0

— Reply to this email directly, view it on GitHub https://github.com/jishi/node-sonos-http-api/issues/858, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYE2I2REHEZGPM7FPFIGBDWH75CBANCNFSM6AAAAAAR6PJJEI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

fishbrainsD commented 1 year ago

Hi jishi, thanks for getting back.

Radio 4 is a BBC Sounds favourite although this behaviour is repeatable with other types of favourites.

If i start with a blank sonos player with no previous content loaded in the room /bedroom/favorite/Radio%204 call works fine. I can switch between this and other favourites no problem at all. The same is true if I call stations using presets calling favourites.

I have done a bit more investigating now and what seems to cause the issue is if a radio station has been played in a room using the sonos app first. So if I play "times radio" for example using the sonos app then then use the /bedroom/favorite/Radio%204 call the browser will report success bu nothing happens. If I do the same thing but use a preset for radio 4 then the "times radio" station reloads and i lose audio for a moment but then "times radio" continues playing.

Interestingly If i have "times radio" playing launched from the sonos app then use alexa to play another station eg "LBC UK" then call the "radio 4" preset it will load "times radio" again!

I have tried lots of combinations going between different types of favourites to see if i can come up with any pattern but the only consistent thing really seems to be that stations have to have been loaded from the sonos app first for there to be an issue.

Any ideas?