Liver64 / LoxBerry-Sonos

LoxBerry Plugin to control Sonos
11 stars 10 forks source link

Playback restore when playing music from Spotify not working #25

Closed Letrab closed 4 years ago

Letrab commented 4 years ago

Hi,

First of all, massive thank you for your work on this plugin!!

Since my last update (to 3.9.3, do not know anymore where I came from), the playback restore is not working after playing a gong mp3.

/plugins/sonos4lox/index.php/?zone=kitchen&action=say&member=hallway,woonkamer,bedroom&messageid=2&volume=70

It only does not work (at first sight) when playing music started from the Spotify app and only for one speaker (kitchen, Sonos Play5 Gen2). The gong sound is played correctly, but Spotify does not resume playback afterwards.

See error log: https://pastebin.com/q78exhSB See working log just before: https://pastebin.com/fr3kUdye

As you could see in the log Master Zone kitchen has been added back to group. is not shown in case of the error. As well the volume of this speaker is not restored (still at 70, the gong volume).

I do see a warning, but it appears in both cases: [message] => Warning (2): count(): Parameter must be an array or an object that implements Countable in [/opt/loxberry/webfrontend/html/plugins/sonos4lox/Play_T2S.php, line 253] )

Thanks already. Happy to help debugging.

Letrab commented 4 years ago

Looking at the code it seems that the variable $master is empty/gone/overridden somehow? That is the only option where the master zone is not being restored...

Liver64 commented 4 years ago

When Music from Spotify App been started the restore function does not work. To get this running I need to use Spotify API to code some enhancements, but I just maintain Problems/Issues, no further development any more

Liver64 commented 4 years ago

closed

Letrab commented 4 years ago

Thanks for replying and I understand your problem.

But would it be possible to do a volume restore? Now my volume gets set to 75% for the ring but not restored to the previous value. Next time when I start my music, after a ring, it is still at the very loud 75%.

Thanks!

Liver64 commented 4 years ago

the controls are served by Spotify and not passed to Sonos in a proper way so that I have the info available