sonos plugin and groups

Posted on
Tue Dec 24, 2013 6:41 pm
dduff617 offline
Posts: 661
Joined: Jul 05, 2006
Location: Massachusetts, USA

sonos plugin and groups

i would like to do some basic control and sensing of a local Sonos zone from Indigo.

i'd like to be able to toggle the play/pause state of the local zone from a keypad button. (by "local" i mean from a certain keypad, i would like to control the state of the ZonePlayer in the same same room as the keypad). if the local zone happens to be part of a group, i'd like to toggle the play/pause state of the entire group.

i'd also like to be able to change the state of a button when the local Sonos zone changes state. when the zone's state is PLAYING, i would like the button to be on (i.e., LED is on). when the zone's state is not PLAYING, i would like the button LED to be off.

so that's what i'm trying to do. i think i've got it working ok in the case where there are no groups.

when groups come into the picture, however, i'm not having success. here are some issues/questions i've run into:

  • i expected the value of Zone Coordinator to be true for exactly one zone in a group. instead, i see it is true for all zones. what is this value used for?
  • i expected that the State of a zone would reflect what it is actually doing (i.e. "PLAYING" IFF it is playing music), irrespective of whether it happened to be playing as part of a group. instead, i observe that when my zone is part of a group, the state can be PLAYING even when the zone (and it's group) are paused. in fact, i observe that this zone's state is PLAYING even after i send it a Pause command.
  • in the IOS or MacOSX Sonos apps, there is the concept of a group but there is not anything the interface that makes apparent a "leader" zone. instead, all actions you can perform are performed on the group. in using the Sonos Indigo plugin, i have observed some dependence on a (hidden) state based on whether a given zone is the leader.
  • is there a way for example to tell a zone to pause itself if it is a singleton or the leader of its group, and otherwise to instead tell the leader of the group to pause? i'm guessing a snipped of python code is probably needed for this. is there any other way that i'm missing to achieve this via the standard actions? shouldn't commands like Play/Pause be passed transparently from a zone to it's group leader by default?

thanks in advance for any help or pointers to a wiki or places in the forum where this topic might have been discussed. (it's getting a bit hard to keep track of the various long Sonos Plugin threads).

Posted on
Wed Dec 25, 2013 7:13 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: sonos plugin and groups

I can't answer your questions yet, but am re-exploring the states for groups I did some quick testing today and realize that the Group Coordinator variable is not being populated as expected. It is correct from the ZonePlayer's point of view, but not that useful. It seems that the value is always true regardless of grouping. So the logic I have that relies on Group Coordinator is not working properly. There are some other Zone Topology states that I am going to experiment with and will report back findings.

dduff617 wrote:
i would like to do some basic control and sensing of a local Sonos zone from Indigo.

i'd like to be able to toggle the play/pause state of the local zone from a keypad button. (by "local" i mean from a certain keypad, i would like to control the state of the ZonePlayer in the same same room as the keypad). if the local zone happens to be part of a group, i'd like to toggle the play/pause state of the entire group.

i'd also like to be able to change the state of a button when the local Sonos zone changes state. when the zone's state is PLAYING, i would like the button to be on (i.e., LED is on). when the zone's state is not PLAYING, i would like the button LED to be off.

so that's what i'm trying to do. i think i've got it working ok in the case where there are no groups.

when groups come into the picture, however, i'm not having success. here are some issues/questions i've run into:

  • i expected the value of Zone Coordinator to be true for exactly one zone in a group. instead, i see it is true for all zones. what is this value used for?
  • i expected that the State of a zone would reflect what it is actually doing (i.e. "PLAYING" IFF it is playing music), irrespective of whether it happened to be playing as part of a group. instead, i observe that when my zone is part of a group, the state can be PLAYING even when the zone (and it's group) are paused. in fact, i observe that this zone's state is PLAYING even after i send it a Pause command.
  • in the IOS or MacOSX Sonos apps, there is the concept of a group but there is not anything the interface that makes apparent a "leader" zone. instead, all actions you can perform are performed on the group. in using the Sonos Indigo plugin, i have observed some dependence on a (hidden) state based on whether a given zone is the leader.
  • is there a way for example to tell a zone to pause itself if it is a singleton or the leader of its group, and otherwise to instead tell the leader of the group to pause? i'm guessing a snipped of python code is probably needed for this. is there any other way that i'm missing to achieve this via the standard actions? shouldn't commands like Play/Pause be passed transparently from a zone to it's group leader by default?

thanks in advance for any help or pointers to a wiki or places in the forum where this topic might have been discussed. (it's getting a bit hard to keep track of the various long Sonos Plugin threads).

Posted on
Thu Dec 26, 2013 2:43 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: sonos plugin and groups

After more research it seems that Sonos had made changes with v4 of their firmware. I'll be working on pulling in and making sense of the new states for proper zone control with grouping. Stand by...

Posted on
Thu Dec 26, 2013 4:26 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: sonos plugin and groups

Scratch this previous finding. I found a bug in the Events processor. I was not properly checking for the ZoneGroup Coordinator. I will have a release out in a bit. I'm going to add a bit more logic to copy states from the ZonePlayer master to slave devices.

nlagaros wrote:
After more research it seems that Sonos had made changes with v4 of their firmware. I'll be working on pulling in and making sense of the new states for proper zone control with grouping. Stand by...

Posted on
Thu Dec 26, 2013 6:28 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: sonos plugin and groups

I just posted v0.6.9 of the plugin to my wiki site. I think it takes care of the bug in GroupCoordinator plus most of the issues you raise.

  • The GROUP_Coordinator state is now true for each Zone Group leader. A Zone Group can consist of a single player as well, so if the ZonePlayer is not in a group, this will be true.
  • I now update the following states for Zone Group Slave ZonePlayers: ZP_ALBUM, ZP_ART, ZP_ARTIST, ZP_CREATOR, ZP_CurrentTrack, ZP_CurrentURI, ZP_DURATION, ZP_INFO, ZP_TRACK, ZP_STATION, ZP_NALBUM, ZP_NART, ZP_NARTIST, ZP_NCREATOR, ZP_NTRACK, ZP_STATE.
  • You can infer the Group leader by the GROUP_Name or ZoneGroupID states. It will contain the UID of the zone group leader. Slave ZonePlayers will also have an empty ZoneGroupName.
  • If you play, pause, select a track or station from a slave ZonePlayer, it will send the command to the zone group leader. This does not apply to volume and mute commands.

I hope this helps. Let me know how your keypad programming goes.

nlagaros wrote:
I can't answer your questions yet, but am re-exploring the states for groups I did some quick testing today and realize that the Group Coordinator variable is not being populated as expected. It is correct from the ZonePlayer's point of view, but not that useful. It seems that the value is always true regardless of grouping. So the logic I have that relies on Group Coordinator is not working properly. There are some other Zone Topology states that I am going to experiment with and will report back findings.

dduff617 wrote:
i would like to do some basic control and sensing of a local Sonos zone from Indigo.

i'd like to be able to toggle the play/pause state of the local zone from a keypad button. (by "local" i mean from a certain keypad, i would like to control the state of the ZonePlayer in the same same room as the keypad). if the local zone happens to be part of a group, i'd like to toggle the play/pause state of the entire group.

i'd also like to be able to change the state of a button when the local Sonos zone changes state. when the zone's state is PLAYING, i would like the button to be on (i.e., LED is on). when the zone's state is not PLAYING, i would like the button LED to be off.

so that's what i'm trying to do. i think i've got it working ok in the case where there are no groups.

when groups come into the picture, however, i'm not having success. here are some issues/questions i've run into:

  • i expected the value of Zone Coordinator to be true for exactly one zone in a group. instead, i see it is true for all zones. what is this value used for?
  • i expected that the State of a zone would reflect what it is actually doing (i.e. "PLAYING" IFF it is playing music), irrespective of whether it happened to be playing as part of a group. instead, i observe that when my zone is part of a group, the state can be PLAYING even when the zone (and it's group) are paused. in fact, i observe that this zone's state is PLAYING even after i send it a Pause command.
  • in the IOS or MacOSX Sonos apps, there is the concept of a group but there is not anything the interface that makes apparent a "leader" zone. instead, all actions you can perform are performed on the group. in using the Sonos Indigo plugin, i have observed some dependence on a (hidden) state based on whether a given zone is the leader.
  • is there a way for example to tell a zone to pause itself if it is a singleton or the leader of its group, and otherwise to instead tell the leader of the group to pause? i'm guessing a snipped of python code is probably needed for this. is there any other way that i'm missing to achieve this via the standard actions? shouldn't commands like Play/Pause be passed transparently from a zone to it's group leader by default?

thanks in advance for any help or pointers to a wiki or places in the forum where this topic might have been discussed. (it's getting a bit hard to keep track of the various long Sonos Plugin threads).

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests