This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

SONOS commands to group players
#7
Hello, still having a minor problem with grouping and ungrouping players.
I use KNX pushbuttons to control my SONOS players and use following command to stop the player if it's playing (1 toggle button to switch between ON and OFF)

Code:
 -- Pause if status is playing, play otherwise
 if (status_beneden == "PLAYING") then
   upnpavcmd(IP_Beneden, 1400, 'BecomeCoordinatorOfStandaloneGroup')
   upnpavcmd(IP_Beneden, 1400, 'Pause')

This works flawlessly if the player is indeed part of a group: the player is removed from the group and paused, as one would expect  Smile
When the player is not part of a group however the first command causes some sort of stop command and the current playlist is not paused but stopped.
To illustrate this see the attached screenshots:
  • screenshot 1 and 2 when the player was part of a group and was successfully ungrouped
           
  • screenshot 3 and 4 when the player was not part of a group and thus stopped instead of paused
           
Seems like I would need a code to first check whether the player is part of the group so I could avoid the first command line with an IF conditional check.

Any suggestions are kindly appreciated.

Best regards, David
Reply


Messages In This Thread
RE: SONOS commands to group players - by david.rombaut@gmail.com - 14.12.2018, 09:35

Forum Jump: