executeAction for playing Sonos Favorites Playlist

Posted on
Wed Jun 06, 2018 12:05 am
rbdubz3 offline
User avatar
Posts: 85
Joined: Sep 18, 2016
Location: San Diego, CA

executeAction for playing Sonos Favorites Playlist

I'm attempting to dynamically cycle thru different playlists in association with an Indigo trigger. However, I am not sure which properties to pass into the method. See a sample code snippet below:

Code: Select all
theDevice = indigo.devices['Sonos Great Room Playbar']
sonosPlugin = indigo.server.getPlugin("com.ssi.indigoplugin.Sonos")
sonosProps = { 'mode':'Play Now',
            'setting':'Rock Radio',            
}

if sonosPlugin.isEnabled():
    sonosPlugin.executeAction("actionZP_SonosFavorites", deviceId=theDevice.id, props=sonosProps)


Any tips are greatly appreciated

Mac OS X on a Quad-Core MacMini running Fingscan, Messages, Sonos, HomeBridge Buddy, and homegrown Osram Lightify Plugin / Insteon Smart Thermostat python code

Posted on
Wed Jun 06, 2018 8:42 am
rbdubz3 offline
User avatar
Posts: 85
Joined: Sep 18, 2016
Location: San Diego, CA

Re: executeAction for playing Sonos Favorites Playlist

Ok - i answered my own question.. Added a bit of debug logging into the plugin to see what it was looking for.. See the property for 'setting' in the code snippet below.. It was looking for an abbreviated reference string for the favorite 'FV:2/6'

Code: Select all
theDevice = indigo.devices['Sonos Great Room Playbar']
sonosPlugin = indigo.server.getPlugin("com.ssi.indigoplugin.Sonos")
sonosProps = { 'mode':'Play Now',
            'setting':'FV:2/6',           
}


if sonosPlugin.isEnabled():
sonosPlugin.executeAction("actionZP_SonosFavorites", deviceId=theDevice.id, props=sonosProps)

Mac OS X on a Quad-Core MacMini running Fingscan, Messages, Sonos, HomeBridge Buddy, and homegrown Osram Lightify Plugin / Insteon Smart Thermostat python code

Posted on
Fri Jun 08, 2018 10:23 pm
rbdubz3 offline
User avatar
Posts: 85
Joined: Sep 18, 2016
Location: San Diego, CA

Re: executeAction for playing Sonos Favorites Playlist

one follow-on question on these Sonos Favorites.. For some reason, several of the playlists error out when attempting to run them.. BTW - this same error will occur when running via the UI Action : Sonos -> Music Source -> Sonos Favorites. Below is the some logging info followed by the error:

Code: Select all
   Trigger                         Back Patio Sonos Rock
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, mode=Play Now
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, uri0=x-sonosapi-radio:spotify%3aartistRadio%3a7CajNmpbOovFoOoasH2HaY?sid=12&flags=8300&sn=7, uri4=FV:2/14
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, uri0=x-rincon-cpcontainer:0006206cspotify%3auser%3aspotify%3aplaylist%3a5O2ERf8kAYARVVdfCKZ9G7, uri4=FV:2/6
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, uri0=x-rincon-cpcontainer:10062a6cspotify%3auser%3a671woodshomey%3aplaylist%3a1eWK2S8rSdFq6aZ8TQh8gL?sid=12&flags=10860&sn=7, uri4=FV:2/12
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, uri0=x-rincon-cpcontainer:10062a6cspotify%3auser%3a671woodshomey%3aplaylist%3a24YY3t6SheyiWlyvOsubE2, uri4=FV:2/8
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, uri0=x-rincon-cpcontainer:10062a6cspotify%3auser%3a671woodshomey%3aplaylist%3a0m9MdpCZ8J7GKCAXPIjNkN, uri4=FV:2/10
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, uri0=x-sonosapi-radio:spotify%3aartistRadio%3a31TPClRtHm23RisEBtV3X7?sid=12&flags=8300&sn=7, uri4=FV:2/11
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, uri0=x-sonosapi-stream:s34633?sid=254&flags=8224&sn=0, uri4=FV:2/1
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, uri0=x-rincon-cpcontainer:10062a6cspotify%3auser%3a671woodshomey%3aplaylist%3a4MNziK5OwHpw7Hjva0hjwa, uri4=FV:2/9
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, uri0=x-rincon-cpcontainer:0006206cspotify%3auser%3aspotify%3aplaylist%3a2Qi8yAzfj1KavAhWz1gaem, uri4=FV:2/5
   Sonos                           ZP_SonosFavorites: setting=FV:2/16, uri0=x-rincon-cpcontainer:1006206cspotify%3auser%3aspotify%3aplaylist%3a37i9dQZF1DWWJOmJ7nRx0C?sid=12&flags=8300&sn=7, uri4=FV:2/16
   Sonos                           ZP_SonosFavorites 1: setting=FV:2/16, uri0=x-rincon-cpcontainer:1006206cspotify%3auser%3aspotify%3aplaylist%3a37i9dQZF1DWWJOmJ7nRx0C?sid=12&flags=8300&sn=7, uri4=FV:2/16
   Sonos                           ZP_SonosFavorites 4: setting=FV:2/16, uri0=x-rincon-cpcontainer:1006206cspotify%3auser%3aspotify%3aplaylist%3a37i9dQZF1DWWJOmJ7nRx0C?sid=12&flags=8300&sn=7, uri4=FV:2/16
   Sonos Error                     UPNP Error: Invalid Args
   Sonos Error                     Offending Command -> zoneIP: 10.0.1.6, soapRoot: /MediaRenderer, soapBranch: /AVTransport, soapAction: AddURIToQueue
   Sonos Error                     Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 171, in actionZP_SonosFavorites
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 1754, in actionDirect
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 1693, in actionDirect
TypeError: cannot concatenate 'str' and 'NoneType' objects


Any idea why some of these Spotify Playlists choke?

Mac OS X on a Quad-Core MacMini running Fingscan, Messages, Sonos, HomeBridge Buddy, and homegrown Osram Lightify Plugin / Insteon Smart Thermostat python code

Posted on
Sat Jul 21, 2018 5:19 am
bjones offline
Posts: 13
Joined: Oct 22, 2017

Re: executeAction for playing Sonos Favorites Playlist

I have the same issue, except for all of my Sonos favorites choke.

Code: Select all
   Sonos Error                     UPNP Error: Invalid Args
   Sonos Error                     Offending Command -> zoneIP: 192.168.7.116, soapRoot: /MediaRenderer, soapBranch: /AVTransport, soapAction: AddURIToQueue
   Sonos Error                     Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 171, in actionZP_SonosFavorites
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 1747, in actionDirect
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 1706, in actionDirect
TypeError: cannot concatenate 'str' and 'NoneType' objects

   Sonos Error                     UPNP Error: No Such Object
   Sonos Error                     Offending Command -> zoneIP: 192.168.7.116, soapRoot: /MediaRenderer, soapBranch: /AVTransport, soapAction: Play
   Sonos                           ZonePlayer: Living Room Sonos, Play

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests