SoCo: Snapshot restore throws UPnP error 402

Hi,

multi_zone_snap.py consistently fails if any of the Sonos devices is playing music - upon the restore, it gives a 402 error as follows:

Traceback (most recent call last): File "./test2.py", line 84, in <module> play_alert( File "./test2.py", line 74, in play_alert zone.snap.restore(fade=fade_back) File "/usr/local/lib/python3.8/dist-packages/soco/snapshot.py", line 214, in restore self.device.play_uri( File "/usr/local/lib/python3.8/dist-packages/soco/core.py", line 121, in inner_function return function(self, *args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/soco/core.py", line 642, in play_uri self.avTransport.SetAVTransportURI( File "/usr/local/lib/python3.8/dist-packages/soco/services.py", line 217, in _dispatcher return self.send_command(action, *args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/soco/services.py", line 507, in send_command self.handle_upnp_error(response.text) File "/usr/local/lib/python3.8/dist-packages/soco/services.py", line 560, in handle_upnp_error raise SoCoUPnPException( soco.exceptions.SoCoUPnPException: UPnP Error 402 received: Invalid Args from 192.168.1.30

(with 192.168.1.30 being the Sonos devices that was playing at the time)

thanks!

Dan

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Hi @peterwallhead, I think the only way you will resume Spotify Connect is if you use a lib that controls Spotify and that casts to Sonos. As said before if a queue is created outside of Sonos (Alexa, Spotify etc.) then Sonos has no knowledge of it and no ability to restart it. Please post any options you find as I think a lot of us are interested in making this work. Good luck, Cheers David

Thank you, @pwt.

As this functionality is critical to my application, and I unfortunately don’t have time right now to attempt to contribute to the library myself, I’ll have to see what other libs are available.

Thanks to you and the contributing team for your work so far.