Sonos Python 3 Beta

Posted on
Sat Jun 03, 2023 4:40 am
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Sonos Python 3 Beta

Hi Neil,
I am now more confused :? , :D

Is there a problem with favourites that I should be looking at?

You say it works from the Sonos App but not in the plugin?


It is indeed the play favourite option

Screenshot 2023-06-03 at 11.35.55.png
Screenshot 2023-06-03 at 11.35.55.png (55.88 KiB) Viewed 129108 times


with

Screenshot 2023-06-03 at 11.36.08.png
Screenshot 2023-06-03 at 11.36.08.png (22.41 KiB) Viewed 129108 times


And the favourite in question is working if used manually (sometimes the favourites can be flaky when via different services)

Neil

Posted on
Sat Jun 03, 2023 4:47 am
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Sonos Python 3 Beta

Jon - I also tried it on the Python 2 version and the 'title' error also happens with that, so it may be an issue as the favourite in question is in BBC Sounds so possible it stopped working when they moved the BBC stations to the Sonos BBC Sounds service and I just never noticed.

It does work when it refers to a file in my local library.


Neil

Posted on
Sat Jun 03, 2023 6:50 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Sonos Python 3 Beta

ryanbuckner wrote:
.... So while there are still some errors, paired speakers are definitely causing the larger problem.


I have just uploaded a new version (2023.0.9) - see announcements section for link.

I have fixed a couple of the issues you were having and put in further error traps to further isolate the issues.

I have tested stereo pairs and was also getting the UPNP 500 error. However if I delete the slave device (in Indigo) and only define the master of the pair to Indigo then it appears to work OK for me. Scanning back over this Sonos forum and searching for "Stereo pair", various posts suggest only defining the master | controlling speaker of the pair.

I accept this may have worked before but we need to bear in mind that the SoCo version is now ten versions ahead of what is used in the Python 2 version of the plugin.

Let me know if this will work for you. If not, please let me know what your requirement is so that I cna investigate how to best manage this. Thanks. :)

Posted on
Sat Jun 03, 2023 6:52 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Sonos Python 3 Beta

autolog wrote:
Colly wrote:
Upgraded to latest version, same error in log. It didn't prompt me to install anything, ...

Thanks for the report. :)

Just retested this and indeed it didn't work!
I have found the error and it will be corrected in the .8 release.

The .9 release has just been uploaded - see announcements section.

Posted on
Sat Jun 03, 2023 8:16 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Sonos Python 3 Beta

autolog wrote:
ryanbuckner wrote:
.... So while there are still some errors, paired speakers are definitely causing the larger problem.


I have just uploaded a new version (2023.0.9) - see announcements section for link.

I have fixed a couple of the issues you were having and put in further error traps to further isolate the issues.

I have tested stereo pairs and was also getting the UPNP 500 error. However if I delete the slave device (in Indigo) and only define the master of the pair to Indigo then it appears to work OK for me. Scanning back over this Sonos forum and searching for "Stereo pair", various posts suggest only defining the master | controlling speaker of the pair.

I accept this may have worked before but we need to bear in mind that the SoCo version is now ten versions ahead of what is used in the Python 2 version of the plugin.

Let me know if this will work for you. If not, please let me know what your requirement is so that I cna investigate how to best manage this. Thanks. :)


This fix is great for me. I don't really need those speakers in Indigo so I'll jut define the beam that controls them. Thanks for your hard work here!

Posted on
Wed Jun 07, 2023 3:33 am
Londonmark offline
Posts: 509
Joined: Feb 29, 2012

Re: Sonos Python 3 Beta

This is great! Thanks so much for updating. It's working really well.

Only exceptions for me are:
- artwork which doesn't seem to be updating. Can't figure out why not.
- BBCradio stations. That wasn't working in the previous version either - ever since the BBC moved away from TunedIn to BBC Sounds. The plugin sees that I have a BBC radio station as a favourite, but won't play it. Log says this:
Code: Select all
Sonos Error                     'local variable 'title' referenced before assignment' in module 'Sonos.py', method 'actionDirect'
   Failing statement [line 2224]: 'self.SOAPSend (zoneIP, "/MediaRenderer", "/AVTransport", "SetAVTransportURI", "<CurrentURI>x-sonosapi-hls:" + urllib.parse.quote(contentId) + "?sid=37&amp;flags=8480&amp;sn=8</CurrentURI><CurrentURIMetaData>&lt;DIDL-Lite xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\" xmlns:r=\"urn:schemas-rinconnetworks-com:metadata-1-0/\" xmlns=\"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/\"&gt;&lt;item id=\"" + contentId + "\" parentID=\"0\" restricted=\"true\"&gt;&lt;dc:title&gt;" + title +  "&lt;/dc:title&gt;&lt;upnp:class&gt;object.item.audioItem.audioBroadcast&lt;/upnp:class&gt;&lt;desc id=\"cdudn\" nameSpace=\"urn:schemas-rinconnetworks-com:metadata-1-0/\"&gt;SA_RINCON6_&lt;/desc&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</CurrentURIMetaData>")'

Posted on
Wed Jun 07, 2023 4:45 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Sonos Python 3 Beta

Londonmark wrote:
... Only exceptions for me are:
- artwork which doesn't seem to be updating. Can't figure out why not.
- BBCradio stations. That wasn't working in the previous version either - ever since the BBC moved away from TunedIn to BBC Sounds. The plugin sees that I have a BBC radio station as a favourite, but won't play it ...]

Thanks for the feedback :)

I will look at the artwork issue.
Not sure what I can do about the BBC radio stations but will take a look.

Posted on
Wed Jun 07, 2023 5:54 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Sonos Python 3 Beta

Just posted version 2023.0.10 to Github: Cover Artwork Bug Fix

Hopefully the artwork will now be created! :)

Posted on
Wed Jun 07, 2023 7:14 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Sonos Python 3 Beta

Received a Pop Up error when trying to install .10
error.png
error.png (248.31 KiB) Viewed 128933 times


This was in the logs:

Code: Select all
Jun 7, 2023 at 9:13:32 AM
   Error                           InstallPlugin() caught exception: FileIOError -- unable to get last mod time for file (file not found)

Posted on
Wed Jun 07, 2023 8:38 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Sonos Python 3 Beta

I have just downloaded .10 from Github and successfully installed it on my production Mac mini.

Can I suggest that you re-download the plugin and try again to install it, in case it got corrupted?
In the meanwhile, I will try and find out what the error message means. ;)

Posted on
Wed Jun 07, 2023 9:24 am
Londonmark offline
Posts: 509
Joined: Feb 29, 2012

Re: Sonos Python 3 Beta

autolog wrote:
Just posted version 2023.0.10 to Github: Cover Artwork Bug Fix

Hopefully the artwork will now be created! :)


Yes! Works perfectly. Thank you.

Posted on
Wed Jun 07, 2023 7:45 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Sonos Python 3 Beta

autolog wrote:
I have just downloaded .10 from Github and successfully installed it on my production Mac mini.

Can I suggest that you re-download the plugin and try again to install it, in case it got corrupted?
In the meanwhile, I will try and find out what the error message means. ;)


I tried a few times and got the same error. Turns out the plugin was removed somewhere along the way. An Indigo reboot solved the problem.

And the artwork is working too!

Posted on
Wed Jun 07, 2023 11:33 pm
Bleasel offline
Posts: 88
Joined: Mar 05, 2014
Location: Sydney, AUSTRALIA

Re: Sonos Python 3 Beta

Thanks for upgrading this to P3.

I have installed via pip a number of plugins as the event log suggests. But the pandora plugin fails to load. Tried loading a few times.
(I don't use Pandora, but the Sonos plugin will not load without this plugin)
Mac Pro Mid 12
Mac 10.14.6
Indigo 2022.2



Collecting pandora
Using cached pandora-1.5.0.tar.gz (39.7 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting transitions
Downloading transitions-0.9.0-py2.py3-none-any.whl (97 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.7/97.7 KB 3.0 MB/s eta 0:00:00
Collecting xarray>=0.13.0
Using cached xarray-2023.5.0-py3-none-any.whl (994 kB)
Collecting scikit-image>=0.19.0
Downloading scikit_image-0.21.0-cp310-cp310-macosx_10_9_x86_64.whl (13.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.0/13.0 MB 6.1 MB/s eta 0:00:00
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from pandora) (1.22.4)
Requirement already satisfied: scipy in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from pandora) (1.8.0)
Collecting numba>=0.55.2
Using cached numba-0.57.0-cp310-cp310-macosx_10_9_x86_64.whl (2.5 MB)
Collecting rasterio
Using cached rasterio-1.3.7.tar.gz (411 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [2 lines of output]
WARNING:root:Failed to get options via gdal-config: [Errno 2] No such file or directory: 'gdal-config'
ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Posted on
Thu Jun 08, 2023 8:52 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Sonos Python 3 Beta

To be honest, not quite sure what is causing this problem. :?

As Pandora isn't working at the moment and I am unable to test it being UK based, I have temporarily disabled it so that the plugin should load OK for you. A new version .11 is available on Github, see announcements.

I need to work out how to support Pandora.

I am not sure how many Sonos plugin users use Pandora?

Posted on
Thu Jun 08, 2023 9:13 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Sonos Python 3 Beta

autolog wrote:
To be honest, not quite sure what is causing this problem. :?

As Pandora isn't working at the moment and I am unable to test it being UK based, I have temporarily disabled it so that the plugin should load OK for you. A new version .11 is available on Github, see announcements.

I need to work out how to support Pandora.

I am not sure how many Sonos plugin users use Pandora?


I use Pandora with Sonos, but it's not critical to my Indigo integration.

Who is online

Users browsing this forum: Google [Bot] and 6 guests