Changing the group coordinator

83 views
Skip to first unread message

Paulo Matos

unread,
Feb 1, 2021, 4:24:28 AM2/1/21
to SoCo - Sonos Controller

Hi,

On an event I want to play a local file on a speaker without disturbing the rest of the network. This speaker is not in a stereo group but it might be a group coordinator, so I cannot afaiu remove him from the group without destroying the group. Is there a way to swap the coordinator of a group while keeping the state intact?

Regards,

Paulo Matos

Psychlist

unread,
Feb 1, 2021, 6:37:43 AM2/1/21
to SoCo - Sonos Controller
There isn't a SoCo-native way of doing this, but the capability exists in the underlying UPnP control plane.

The UPnP function definition is:

DelegateGroupCoordinationTo(InstanceID: ui4, NewCoordinator: string, RejoinGroup: boolean) -> {}

To use this in SoCo, if speaker_1 is the coordinator, and speaker_2 is a group member, group coordination control can be passed to speaker_2 using:

bool_result = speaker_1.avTransport.DelegateGroupCoordinationTo([("InstanceID", 0), ("NewCoordinator", speaker_2.uid), ("RejoinGroup", 1)])

While I know that the function works, I've only given it superficial testing. Might be something worth adding as a native SoCo function.

-- Peter

Paulo Matos

unread,
Feb 1, 2021, 6:57:51 AM2/1/21
to Psychlist, pytho...@googlegroups.com

Psychlist writes:

> There isn't a SoCo-native way of doing this, but the capability exists in
> the underlying UPnP control plane.
>
> The UPnP function definition is:
>
> DelegateGroupCoordinationTo(InstanceID: ui4, NewCoordinator: string,
> RejoinGroup: boolean) -> {}
>
> To use this in SoCo, if speaker_1 is the coordinator, and speaker_2 is a
> group member, group coordination control can be passed to speaker_2 using:
>
> bool_result = speaker_1.avTransport.DelegateGroupCoordinationTo([(
> "InstanceID", 0), ("NewCoordinator", speaker_2.uid), ("RejoinGroup", 1)])
>
> While I know that the function works, I've only given it superficial
> testing. Might be something worth adding as a native SoCo function.

Interesting - thanks for that. Had no idea about it. I will give it some
testing and open a PR for a native SoCo function.

Thanks.

>
> -- Peter
> On Monday, February 1, 2021 at 9:24:28 AM UTC pa...@matos-sorge.com wrote:
>
>>
>> Hi,
>>
>> On an event I want to play a local file on a speaker without disturbing
>> the rest of the network. This speaker is not in a stereo group but it might
>> be a group coordinator, so I cannot afaiu remove him from the group without
>> destroying the group. Is there a way to swap the coordinator of a group
>> while keeping the state intact?
>>
>> Regards,
>>
>> Paulo Matos
>>


--
Paulo Matos

Barry4679

unread,
Feb 1, 2021, 8:22:56 AM2/1/21
to SoCo - Sonos Controller
A group isn't "destroyed" when you remove the coordinator, using the Sonos controller. Sonos just promote a new coordinator from the other group members, and the music continues without interruption.

Maybe the same thing happens when you do the same thing using SoCo? I haven't tried it, but I presume that the same thing will happen.


Paulo Matos

unread,
Feb 1, 2021, 8:38:21 AM2/1/21
to Barry4679, pytho...@googlegroups.com

Barry4679 writes:

> A group isn't "destroyed" when you remove the coordinator, *using the Sonos
> controller*. Sonos just promote a new coordinator from the other group
> members, and the music continues without interruption.
>
> Maybe the same thing happens when you do the same thing using SoCo? I
> haven't tried it, but I presume that the same thing will happen.
>

OK thanks for pointing that out. Maybe I should have tested, although I
am pretty sure I tested it in the past *using the controller* and the
group was split. But it seems I could have been dreaming.

>
> On Monday, 1 February 2021 at 19:24:28 UTC+10 pa...@matos-sorge.com wrote:
>
>>
>> Hi,
>>
>> On an event I want to play a local file on a speaker without disturbing
>> the rest of the network. This speaker is not in a stereo group but it might
>> be a group coordinator, so I cannot afaiu remove him from the group without
>> destroying the group. Is there a way to swap the coordinator of a group
>> while keeping the state intact?
>>
>> Regards,
>>
>> Paulo Matos
>>


--
Paulo Matos
Reply all
Reply to author
Forward
0 new messages