Author Topic: Sonos Create Group command  (Read 3992 times)

0 Members and 1 Guest are viewing this topic.

Styxman

  • Jr. Member
  • **
  • Posts: 14
  • Karma: 0
    • View Profile
Sonos Create Group command
« on: August 09, 2015, 06:28:33 PM »
First post on the forum and a newby to Vox, but am reading the wiki and using the tutorials before coming here.  Delving into the Sonos plug in, specifically the CreateGroup command.  In the Sample, the player names have been hard coded (Den, Playroom).  I've tried using payload.xml (value, phrase and phrase) to achieve this programmatically, but am having trouble setting up the command.  What I've done is:

Phrase: Sonos set group
Payload.xml: Den
Phrase: and
Payload.xml: Kitchen
(Also, altered the parameters in LCB accordingly)

After I save, then I close the command window, VC throws a .cfg exeption, so I must be doing something wrong.

I'm using VC2 & voxcommandoSP.exe.  Thanks for the help.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Sonos Create Group command
« Reply #1 on: August 09, 2015, 06:41:11 PM »
Hi Styxman, welcome to the forum.

1. Can you be more specific about which version number of VC2 you are using? (e.g. 2.1.4.8 or 2.2.07 or something else?)

2. Can you please post the xml for your command?

To do so, just select the command in your command tree, copy it (Ctrl-C), and then paste it into a code box in your forum post.

http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum#Posting_Your_Code_to_the_Forum

Thanks.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Styxman

  • Jr. Member
  • **
  • Posts: 14
  • Karma: 0
    • View Profile
Re: Sonos Create Group command
« Reply #2 on: August 10, 2015, 06:47:49 AM »
Thanks for the reply...I'm using VC 2.1.4.8.  Here's the code you requested:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.8-->
<command id="780" name="Sample create group" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Sonos.CreateGroup</cmdType>
    <params>
      <param>{1}</param>
      <param>{2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Sonos create Group</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="plus" Phrase2wildcard="anyone" optional="False">SonosPayloads\Players.xml</payloadFromXML>
  <phrase>and</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">SonosPayloads\Players.xml</payloadFromXML>
</command>
« Last Edit: August 10, 2015, 08:16:07 AM by Kalle »

Styxman

  • Jr. Member
  • **
  • Posts: 14
  • Karma: 0
    • View Profile
Re: Sonos Create Group command
« Reply #3 on: August 10, 2015, 08:18:41 AM »
nime5ter - I've got it.  I was using value, phrase when I just needed to use phrase to draw from my payloads.  Also, I didn't need the "and" in between each one.  Silly me....learning a lot!!! 

On the same note, the Sonos.CreateGroup command on has 4 parameters I can use, but I have 6 players.  Can I add additional parameters to the command or is this a limitation?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Sonos Create Group command
« Reply #4 on: August 10, 2015, 09:16:32 AM »
Glad you figured it out. As it happens, when I asked for you to post your command, I forgot to ask for your payload xml at the same time. (Always a good idea to include those, though, when asking for help with a command that uses payload xmls).

We only have 2 Sonoses, so we can't test what will happen if you try to add a bunch at once, but in general in VC you can add extra parameter fields via the parameter helper (by clicking on the + sign): http://voxcommando.com/mediawiki/index.php?title=Parameter_Helper

So, give it a try -- it may or may not work.

If you want to control all Sonos devices at once, you can actually use the Sonos.PartyMode action.

Another option, if adding 6 devices at once doesn't seem to be working, is to try repeating the Sonos.SetGroup action in the command, so that you can add x payload values in the first action and another y payload values in the second.

That's another untested suggestion, but worth a try.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Styxman

  • Jr. Member
  • **
  • Posts: 14
  • Karma: 0
    • View Profile
Re: Sonos Create Group command
« Reply #5 on: August 10, 2015, 07:08:26 PM »
Adding an extra param in param helper did the trick.  I then added it to my command in LCB and away it went.  You're awesome. 

Now the next trick is to dissolve a specific group, which seems a bit tricky.  I know we can dissolve all, but if I have 2 groups set up, that's a different story.

Thanks again, nime5ter

Styxman

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Sonos Create Group command
« Reply #6 on: August 10, 2015, 08:56:57 PM »
Hopefully not too tricky. Probably you just need to review the available actions again ... and know what your groups are called.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)