Page 1 of 2

Plugin Fails with new version 2023.1.0

PostPosted: Sun Dec 17, 2023 6:48 pm
by farberm
Here is the error I am getting with the new plugin.

Code: Select all
Dec 17, 2023 at 7:43:58 PM
   Reloading plugin "Sonos 2023.1.0" using API v3.1
   Starting plugin "Sonos 2023.1.0" (pid 1121)
   Sonos                           Plugin logging now started.
   Sonos                           Distribution: Package=lxml, Version=4.9.2
   Embedded script executor host1 started
   Sonos Error                     Error in plugin execution InitializeMain:

  File "<string>", line 1, in <module>
  File "plugin.py", line 149, in __init__
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 79, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/soco/__init__.py", line 12, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/soco/core.py", line 58, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/soco/zonegroupstate.py", line 67, in <module>
type: cannot import name 'etree' from 'lxml' (unknown location)

   Stopping plugin "Sonos 2023.1.0" (pid 1121)
   Stopped plugin "Sonos 2023.1.0"

Re: Plugin Fails with new version 2023.1.0

PostPosted: Mon Dec 18, 2023 8:50 am
by autolog
Not sure what is happening with that error?

What version of MacOS and Indigo are you running?

Can you try, running this in terminal (change Indigo version if different) and then reload the plugin:
Code: Select all
pip3.10 install lxml==4.9.2 --target "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Preferences/Plugins/com.ssi.indigoplugin.Sonos.python_packages"

Re: Plugin Fails with new version 2023.1.0

PostPosted: Mon Dec 18, 2023 10:24 am
by farberm
I am running Indigo 2023.1 and Sonoma 14.1.2

I ran the command and got the following.... which I assume means it was already installed). Still get the same error and the plug-in stops as before

Code: Select all
Collecting lxml==4.9.2
  Using cached lxml-4.9.2-cp310-cp310-macosx_10_15_x86_64.whl (4.7 MB)
Installing collected packages: lxml
Successfully installed lxml-4.9.2
WARNING: Target directory /Library/Application Support/Perceptive Automation/Indigo 2023.1/Preferences/Plugins/com.ssi.indigoplugin.Sonos.python_packages/lxml-4.9.2.dist-info already exists. Specify --upgrade to force replacement.

Re: Plugin Fails with new version 2023.1.0

PostPosted: Mon Dec 18, 2023 10:48 am
by autolog
What version of the plugin where you previously running?

Re: Plugin Fails with new version 2023.1.0

PostPosted: Mon Dec 18, 2023 6:59 pm
by farberm
.27

Re: Plugin Fails with new version 2023.1.0

PostPosted: Mon Dec 18, 2023 7:16 pm
by farberm
I deleted all my devices, deleted the plugin and all the associated files and reinstalled everything.....

I still get the following error.....
Code: Select all
 Reloading plugin "Sonos 2023.1.0" using API v3.1
   Starting plugin "Sonos 2023.1.0" (pid 1602)
   Sonos                           Plugin logging now started.
   Sonos                           Distribution: Package=lxml, Version=4.9.2
   Sonos Error                     Error in plugin execution InitializeMain:

  File "<string>", line 1, in <module>
  File "plugin.py", line 149, in __init__
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 79, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/soco/__init__.py", line 12, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/soco/core.py", line 58, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/soco/zonegroupstate.py", line 67, in <module>
type: cannot import name 'etree' from 'lxml' (unknown location)

   Stopping plugin "Sonos 2023.1.0" (pid 1602)
   Stopped plugin "Sonos 2023.1.0"

Re: Plugin Fails with new version 2023.1.0

PostPosted: Tue Dec 19, 2023 9:59 am
by autolog
Can you try reinstalling .27 and see if that still works?

It could be something related to the upgrade to the SoCo package, not that I have had any problems getting it to work.

Re: Plugin Fails with new version 2023.1.0

PostPosted: Tue Dec 19, 2023 10:12 am
by farberm
Ok tried reinstalling. It asked me to install Twisted, so I did... but I still got the following error even with 0.27
Now, I am not sure what is going on???

Code: Select all
 Sonos                           Plugin logging now started.
   Sonos Error                     Error in plugin execution InitializeMain:

  File "<string>", line 1, in <module>
  File "plugin.py", line 149, in __init__
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 79, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/soco/__init__.py", line 11, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/soco/core.py", line 57, in <module>
  File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/soco/zonegroupstate.py", line 67, in <module>
type: cannot import name 'etree' from 'lxml' (unknown location)

   Stopping plugin "Sonos 2023.0.27" (pid 93287)
   Stopped plugin "Sonos 2023.0.27"

Re: Plugin Fails with new version 2023.1.0

PostPosted: Tue Dec 19, 2023 10:48 am
by autolog
Try this, re-install the latest version of the plugin from the Indigo Plugin Store.

It should fail.

Then run the following install in the a terminal window:
Code: Select all
pip3 install lxml
Then restart the plugin

Re: Plugin Fails with new version 2023.1.0

PostPosted: Tue Dec 19, 2023 12:26 pm
by farberm
OK id that now the plugin just stops....no error messages...Confusing?

Code: Select all
   Sonos                           Plugin __init__ ended.
   Started plugin "Sonos 2023.1.0"
   Sonos                           Plugin startup started.
   Sonos                           Plugin being stopped.
   Stopping plugin "Sonos 2023.1.0" (pid 7430)
   Sonos                           Plugin stop request completed.
   Sonos                           Plugin startup ended.

Re: Plugin Fails with new version 2023.1.0

PostPosted: Tue Dec 19, 2023 12:40 pm
by farberm
Success... Had to also reinstall Twisted 23.8.0

Re: Plugin Fails with new version 2023.1.0

PostPosted: Tue Dec 19, 2023 1:05 pm
by autolog
That's a relief - well done! :)

Just to double check, you are up and running on 2023.1.0?

Re: Plugin Fails with new version 2023.1.0

PostPosted: Tue Dec 19, 2023 2:12 pm
by farberm
yes

Re: Plugin Fails with new version 2023.1.0

PostPosted: Tue Jan 02, 2024 9:55 am
by wideglidejrp
Good day, and happy new year. I am having trouble with Sonos plugin. I had everything except Sirius/XM working but now new problems. I am running Indigo 2023.1.1. Here is what I am getting.....

Sonos Error 'local variable 'l2p' referenced before assignment' in module 'Sonos.py', method 'actionAnnouncement [2023.0.26]'
Failing statement [line 2736]: 'self.SOAPSend(zoneIP, "/MediaRenderer", "/AVTransport", "AddURIToQueue", "<EnqueuedURI>"+l2p+"</EnqueuedURI><EnqueuedURIMetaData></EnqueuedURIMetaData><DesiredFirstTrackNumberEnqueued>0</DesiredFirstTrackNumberEnqueued><EnqueueAsNext>1</EnqueueAsNext>")'


Any suggestions?

Re: Plugin Fails with new version 2023.1.0

PostPosted: Tue Jan 02, 2024 10:45 am
by autolog
wideglidejrp wrote:
Good day, and happy new year. I am having trouble with Sonos plugin. I had everything except Sirius/XM working but now new problems. I am running Indigo 2023.1.1. Here is what I am getting.....

Sonos Error 'local variable 'l2p' referenced before assignment' in module 'Sonos.py', method 'actionAnnouncement [2023.0.26]'
Failing statement [line 2736]: 'self.SOAPSend(zoneIP, "/MediaRenderer", "/AVTransport", "AddURIToQueue", "<EnqueuedURI>"+l2p+"</EnqueuedURI><EnqueuedURIMetaData></EnqueuedURIMetaData><DesiredFirstTrackNumberEnqueued>0</DesiredFirstTrackNumberEnqueued><EnqueueAsNext>1</EnqueueAsNext>")'


Any suggestions?

Happy new year to you to. :)

This looks like a bug in the plugin. It is occurring in an area of code that hasn't been changed logic wise since the Python 2 version. I will have to try and work out what it is doing in order to resolve this.

Were you playing anything when you played the announcement because it seems like it was trying to recover what was playing and failed?