Author Topic: Samsung multiroom extensions  (Read 2301 times)

0 Members and 1 Guest are viewing this topic.

momkivi

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Samsung multiroom extensions
« on: October 06, 2017, 09:52:28 AM »
I am a new user voxcommando,from Finland. I wish some on could help me:
My problem is how to get Samsung multiroom extensions (speakers wam350) to work with voxcommando?
I found https://sites.google.com/site/moosyresearch/projects/samsung_shape information

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: Samsung multiroom extensions
« Reply #1 on: October 06, 2017, 10:09:38 AM »
Hi momkivi and welcome in the VC forum.


I will post later a command group with a lot of examples and instructions for using.


Kalle
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Samsung multiroom extensions
« Reply #2 on: October 06, 2017, 10:15:35 AM »
Thanks Kalle,

I saw your demo when we visited you in September and it looks like control of the Samsung system works very well, at least the commands that you have figured out so far!  Hopefully others will be able to take advantage of this too.  :D
« Last Edit: October 06, 2017, 02:56:56 PM by nime5ter »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2318
  • Karma: 47
    • View Profile
Re: Samsung multiroom extensions
« Reply #3 on: October 06, 2017, 12:11:26 PM »
OK, let us start.

There are some things good to know:

1. The command list is not my work (HTTPCommandsSamsung_R_series.txt) I just extracted it and saved it as a text file (there are more than 200 commands available).
2. The Samsung API is completely open and can be used with HTTP requests which makes it easy to use it with VoxCommando's Scrape Action.
3. You must know the IP address of your speaker(s) - you will find them in your router webUI or Windows Network view in the Windows file manager.
4. All commands which you will send must start with the speaker IP, followed by a special port and the command itself. Here is an example (you have to use your speaker IP) to SET the volume of a speaker to 5:


http://192.168.0.27:55001/UIC?cmd=<pwron>on</pwron><name>SetVolume</name><p%20type="dec"%20name="Volume"%20val="5"/>

5. There are SET and GET commands (and some others) available. SET means to change a value at your speaker and GET means to read a value from your speaker.
The command above sets the volume and there is also a GET command to read the current volume from a speaker - here is the GET volume example:

http://192.168.0.27:55001/UIC?cmd=<name>GetVolume</name>

This will show you the current volume of the speaker.
Try both commands in a web browser and you will see for both the result in the web browser.

As next try out some VoxCommando command samples for the Samsung Wireless WAM-Series:


1. Download the "MultiRoomSAM_commands_xml.xml" and "SAMSUNG_IP.xml" files from the attachment and store it in the main payload folder in your VC installation.

2. Start VC and open the command editor.

3. copy and past the code from followed codebox in your command tree:


Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.7-->
<groupCollection open="False" name="Samsung Wireless Audio easy">
  <commandGroup open="False" name="SAMSUNG Volume" enabled="True" prefix="" priority="0" requiredProcess="" description="">
    <command id="143" name="get Volume" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
      <action>
        <cmdType>Scrape.Simple</cmdType>
        <params>
          <param>{1}UIC?cmd=&lt;name&gt;GetVolume&lt;/name&gt;</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.RegEx</cmdType>
        <params>
          <param>volume&gt;(\d+)</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>the current volume is {Match.1.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.SpeakSync</cmdType>
        <params>
          <param>the current volume is {Match.1.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <phrase>get Volume</phrase>
      <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\SAMSUNG_IP.xml</payloadFromXML>
    </command>
    <command id="128" name="set Volume" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
      <action>
        <cmdType>Scrape.Simple</cmdType>
        <params>
          <param>{1}UIC?cmd=&lt;pwron&gt;on&lt;/pwron&gt;&lt;name&gt;SetVolume&lt;/name&gt;&lt;p%20type="dec"%20name="Volume"%20val="{2}"/&gt;</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.RegEx</cmdType>
        <params>
          <param>&gt;(\d+)&lt;/volume&gt;</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>volume level on {PF.1} is now set to {Match.1.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.SpeakSync</cmdType>
        <params>
          <param>volume level on {PF.1} is now set to {Match.1.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <phrase>set volume, volume</phrase>
      <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\SAMSUNG_IP.xml</payloadFromXML>
      <phrase optional="true">to</phrase>
      <payloadRange>1,20</payloadRange>
    </command>
  </commandGroup>
  <commandGroup open="False" name="Some Samsung Wireless Audio commands" enabled="True" prefix="" priority="0" requiredProcess="" description="">
    <command id="116" name="some commands to test from XML" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
      <action>
        <cmdType>Scrape.Simple</cmdType>
        <params>
          <param>{2}{1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <phrase>please, do, samsung</phrase>
      <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\MultiRoomSAM_commands_xml.xml</payloadFromXML>
      <phrase optional="true">in, on</phrase>
      <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\SAMSUNG_IP.xml</payloadFromXML>
    </command>
  </commandGroup>
</groupCollection>


4. search for the "SAMSUNG_IP. xml" in the commands, open it with a double click and select "open/edit". Now you have to change the IP address to your speaker(s) in the "value" column.
Change the name for the speaker in the "Phrases" column to your needs.


4a. search also for the "MultiRoomSAM_commands_xml.xml" in the commands and open it in the same way as above - then you can change the command phrases in the "Phrases" column to your needs.


5. save the command tree and restart VoxCommando


Ask me if you have questions.


To create a group of speakers, the Mac-Address of each speaker is needed.
I will continue later ... I'm still working on it, but it takes some time to write it all down - you can take a look at the available API commands for the Samsung (in the second attach, a bit hard to see).


Kalle
« Last Edit: October 06, 2017, 06:51:35 PM by Kalle »
***********  get excited and make things  **********

Dominique

  • Jr. Member
  • **
  • Posts: 41
  • Karma: -1
    • View Profile
Re: Samsung multiroom extensions
« Reply #4 on: November 15, 2017, 01:05:42 PM »
Woooooow.  I have a Samsung speaker.  Perhaps I should buy a few more. 

Thanks for the code.  I wanna try this.