Author Topic: Belkin Wemo and Phillips Hue Support  (Read 24733 times)

0 Members and 1 Guest are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Belkin Wemo and Phillips Hue Support
« Reply #30 on: September 11, 2014, 06:05:55 PM »

using the other method, is there any way to get the on / off state so i can use a logical command to turn the WeMo ON or OFF with one phrase ( ie. "lights Please")


Sorry.  I read your post again and realized that you want to read the state of the Wemo so you can perform a toggle.

Here are all the commands you will need.  But you'll have to monitor and update the IP and ports if they change, which sucks.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.0.1-->
<commandGroup open="True" name="Wemo manual method using HTTP POST" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="758" name="Turn wemo on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.0.111:49153/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <phrase>Turn wemo on</phrase>
  </command>
  <command id="766" name="Turn wemo off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.0.111:49153/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Turn wemo off</phrase>
  </command>
  <command id="774" name="get status" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.0.111:49153/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>BinaryState&gt;([01])&lt;/BinaryState</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>WEMO is On</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>WEMO is Off</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>get wemo status</phrase>
  </command>
  <command id="779" name="toggle wemo" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.0.111:49153/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>BinaryState&gt;([01])&lt;/BinaryState</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://192.168.0.111:49153/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://192.168.0.111:49153/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>toggle wemo</phrase>
  </command>
</commandGroup>

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Belkin Wemo and Phillips Hue Support
« Reply #31 on: September 11, 2014, 06:55:01 PM »
that works GREAT  ;D there's no way i could have figured that one out on my own   :bonk  i can usually figure out what I'm after but at least now i can use that as a reference for other commands if need be, and now i can use one command for my lamp... cause im to lazy to use two commands LOL

thank you so much  and again great software with great customer support 
« Last Edit: December 15, 2014, 05:48:18 PM by PegLegTV »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Belkin Wemo and Phillips Hue Support
« Reply #32 on: September 11, 2014, 07:11:47 PM »
I did not figure any of that out on my own either.  I had to do a lot of web searching and a lot of trial and error. Nime5ter helped a lot too.

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Belkin Wemo and Phillips Hue Support
« Reply #33 on: September 11, 2014, 07:15:24 PM »
thanks to Nime5ter too  ;D

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Belkin Wemo and Phillips Hue Support
« Reply #34 on: December 15, 2014, 05:32:47 PM »
 ::duh New and improved and much much smaller Versions of this command  ::duh
1 WeMo Setup  http://voxcommando.com/forum/index.php?topic=1261.msg16583#msg16583
Multiple WeMo Setup http://voxcommando.com/forum/index.php?topic=1261.msg16584#msg16584



if your using windows 8.1 and the WeMo Plugin isn't working for you :'(, I found a way that you can switch between the three different ports(49153, 49154, 49155) with voice command instead of opening the edit command and changing it manually

these commands will create a WeMo.txt file in your VC folder that will simply have the number 1,2 or 3 to keep track of the port it is set to, when VC is started it will read that file and trigger an event that will set the port to what it was when VC was turned off or restarted, it's also used when you ask "what port is the WeMo set to"

when the WeMo isn't connecting to a Port you can simply say "Switch WeMo to port 1 (2 or 3)"
if it worked it will turn the WeMo on/off or off/on and say "tested port (1)"
if you switch to another port that doesn't work voxcommando will hang while it try's to trigger the command (like it does now when that port doesn't work) then it will say "tested port (1)"

then you simply pick a different port


After you paste these commands into VC you need to restart VC then say "switch WeMo to port 1"
so it can create the WeMo.txt file

then simply find the port you need to use

to toggle the WeMo say "WeMo Please"
also added WeMo on and Wemo off commands for each port just add you own events or phrase for each port 



"Switch WeMo to port..."
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.1.0-->
<commandGroup open="False" name="switching WeMo Ports" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="988" name="Switch WeMo Ports" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{1}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>VC.EnableGroup</cmdType>
          <params>
            <param>WeMo port 49153 (1)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49154 (2)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49155 (3)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>WeMo</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>WeMo</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <params>
            <param>Tested port 1</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>File.Write</cmdType>
          <params>
            <param>{Path.VC}\WeMo.txt</param>
            <param>1</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{LastEvent}&amp;&amp;port 1</ifParams>
      <then>
        <action>
          <cmdType>VC.EnableGroup</cmdType>
          <params>
            <param>WeMo port 49153 (1)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49154 (2)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49155 (3)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{1}&amp;&amp;2</ifParams>
      <then>
        <action>
          <cmdType>VC.EnableGroup</cmdType>
          <params>
            <param>WeMo port 49154 (2)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49153 (1)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49155 (3)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>WeMo</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>WeMo</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <params>
            <param>Tested port 2</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>File.Write</cmdType>
          <params>
            <param>{Path.VC}\WeMo.txt</param>
            <param>2</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{LastEvent}&amp;&amp;port 2</ifParams>
      <then>
        <action>
          <cmdType>VC.EnableGroup</cmdType>
          <params>
            <param>WeMo port 49154 (2)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49153 (1)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49155 (3)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{1}&amp;&amp;3</ifParams>
      <then>
        <action>
          <cmdType>VC.EnableGroup</cmdType>
          <params>
            <param>WeMo port 49155 (3)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49153 (1)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49154 (2)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>WeMo</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>WeMo</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <params>
            <param>Tested port 3</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>File.Write</cmdType>
          <params>
            <param>{Path.VC}\WeMo.txt</param>
            <param>3</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{LastEvent}&amp;&amp;port 3</ifParams>
      <then>
        <action>
          <cmdType>VC.EnableGroup</cmdType>
          <params>
            <param>WeMo port 49155 (3)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49153 (1)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.DisableGroup</cmdType>
          <params>
            <param>WeMo port 49154 (2)</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <phrase>set, switch</phrase>
    <phrase>Wemo to port</phrase>
    <payloadList>1,2,3</payloadList>
    <event>port 1</event>
    <event>port 2</event>
    <event>port 3</event>
  </command>
  <command id="989" name="what port" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>File.Read</cmdType>
      <params>
        <param>{Path.VC}\WeMo.txt</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <params>
        <param>We Moe is set to port {LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>what port is the WeMo</phrase>
    <phrase>set to, on </phrase>
  </command>
  <command id="1000" name="startup: light port set" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>File.Read</cmdType>
      <params>
        <param>{Path.VC}\WeMo.txt</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>port {LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>VC.Loaded</event>
  </command>
</commandGroup>


TO MANY CHARACTERS TO POST ALL COMMANDS IN ONE POST SO THE FOLLOWING POST WILL CONTAIN THE 3 OTHER COMMANDS NEEDED TO MAKE THIS WORK (I also attached XML's with the commands if you want to use them instead)
« Last Edit: December 23, 2014, 03:56:17 AM by PegLegTV »

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Belkin Wemo and Phillips Hue Support
« Reply #35 on: December 15, 2014, 05:37:07 PM »
 ::duh New and improved and much much smaller Versions of this command  ::duh
1 WeMo Setup  http://voxcommando.com/forum/index.php?topic=1261.msg16583#msg16583
Multiple WeMo Setup http://voxcommando.com/forum/index.php?topic=1261.msg16584#msg16584


YOU WILL NEED THE COMMAND FROM ABOVE AND THE NEXT 3 COMMANDS TO MAKE THIS WORK



"WeMo port 49153 (1)"
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.1.0-->
<commandGroup open="False" name="WeMo port 49153 (1)" enabled="False" prefix="" priority="0" requiredProcess="" description="">
  <command id="941" name="WeMo On/Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.1.249:49153/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>BinaryState&gt;([01])&lt;/BinaryState</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://192.168.1.249:49153/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://192.168.1.249:49153/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>WeMo please</phrase>
    <event>WeMo</event>
  </command>
  <command id="956" name="WeMo On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.1.249:49153/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>WeMo on</event>
  </command>
  <command id="875" name="WeMo Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.1.249:49153/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>WeMo off</event>
  </command>
</commandGroup>


"WeMo port 49154 (2)"
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.1.0-->
<commandGroup open="False" name="WeMo port 49154 (2)" enabled="False" prefix="" priority="0" requiredProcess="" description="">
  <command id="936" name="WeMo On/Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.1.249:49154/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>BinaryState&gt;([01])&lt;/BinaryState</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://192.168.1.249:49154/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://192.168.1.249:49154/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>WeMo please</phrase>
    <event>WeMo</event>
  </command>
  <command id="965" name="WeMo On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.1.249:49154/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>WeMo on</event>
  </command>
  <command id="854" name="WeMo Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.1.249:49154/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>WeMo off</event>
  </command>
</commandGroup>


"WeMo port 49155 (3)"
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.1.0-->
<commandGroup open="False" name="WeMo port 49155 (3)" enabled="False" prefix="" priority="0" requiredProcess="" description="">
  <command id="932" name="WeMo On/Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.1.249:49155/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>BinaryState&gt;([01])&lt;/BinaryState</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://192.168.1.249:49155/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://192.168.1.249:49155/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>WeMo please</phrase>
    <event>WeMo</event>
  </command>
  <command id="966" name="WeMo On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.1.249:49155/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>WeMo on</event>
  </command>
  <command id="943" name="WeMo Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://192.168.1.249:49155/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>WeMo off</event>
  </command>
</commandGroup>


dont forget to restart voxcommando then say "switch WeMo to port 1" so the text file can be created

enjoy

EDIT: Don't forget to change the ip addresses to mach your ip address
« Last Edit: December 23, 2014, 03:57:16 AM by PegLegTV »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Belkin Wemo and Phillips Hue Support
« Reply #36 on: December 21, 2014, 03:46:22 PM »
Thanks for sharing your code PegLegTV.  This is a great idea.

I think you could accomplish something like this in a better way though.  You can use map tables to store your IP address and port.  This way you would not need to have multiple groups or to read and write a text file.   This would be a lot easier to manage, especially if you have multiple Wemo devices.  The way you have done it you would need three groups of commands for each switch.

I'm also thinking that it could be set up to periodically check to see if the Wemo is responding on the current port and if not then it could automatically switch to the next one.

http://voxcommando.com/mediawiki/index.php?title=Maps

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Belkin Wemo and Phillips Hue Support
« Reply #37 on: December 22, 2014, 03:46:51 AM »
Thanks for sharing your code PegLegTV.  This is a great idea.

I think you could accomplish something like this in a better way though.  You can use map tables to store your IP address and port.  This way you would not need to have multiple groups or to read and write a text file.   This would be a lot easier to manage, especially if you have multiple Wemo devices.  The way you have done it you would need three groups of commands for each switch.

I'm also thinking that it could be set up to periodically check to see if the Wemo is responding on the current port and if not then it could automatically switch to the next one.

http://voxcommando.com/mediawiki/index.php?title=Maps

Thanks jitterjames,

I went through and built 2 new commands using the map tables instead, much cleaner setup and cut the commands down from 12 to 5 commands,

I have made 2 command setups one for 1 WeMo and one for Multiple WeMos since the command setup is more complicated for multiple WeMos,

do you want me to edit my last 2 post and replace them my new cammands?

also how would i have it periodically check to see if the wemo is responding?,

would it be possible with out having it go off and on since it is my living room lamp?

Thanks for the help

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Belkin Wemo and Phillips Hue Support
« Reply #38 on: December 22, 2014, 09:06:51 AM »
Let me see what I can whip up.  It should be possible to check without turning the lights on, because we have a command that can read a switch's current state.

I think maybe you should leave your original code in place, but edit the post to link to the *improved* version once that is completed, so that others can see alternative methods of solving the same problem, but also, in case your original work is useful for other purposes.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Belkin Wemo and Phillips Hue Support
« Reply #39 on: December 22, 2014, 01:54:53 PM »
Here is a solution that works for a single switch.

It should be pretty easy to adapt to multiple Wemo switches.

See the post below for the code with a correction by PegLegTV: http://voxcommando.com/forum/index.php?topic=1261.msg16575#msg16575
« Last Edit: December 22, 2014, 05:41:59 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Belkin Wemo and Phillips Hue Support
« Reply #40 on: December 22, 2014, 01:58:01 PM »
Note that you need to set the IP address of your wemo once.  There is a help command at the beginning of the group, or you can do it manually but you must use the correct map table name and map key.

map: Wemos
key:  W01

The switch will be checked at startup.  And then rechecked on an interval.
If the switch is found then it will recheck in 30 minutes.
If the switch is not found then it will recheck in 30 seconds.

Ideally you should count how many times in a row it is not found then issue a warning, and stop checking, because every time you check and the switch is not found VC will be frozen for a second, waiting for a response.

For the record, I don't think I've ever seen my Wemo using any port other than :49153  :biglaugh
« Last Edit: December 22, 2014, 02:00:33 PM by jitterjames »

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Belkin Wemo and Phillips Hue Support
« Reply #41 on: December 22, 2014, 05:15:56 PM »
works great, :biglaugh

I noticed on the "toggle WeMo" command  two of the IP addresses didn't get replaced, here is the command with the fixed
IP's

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.1.0-->
<commandGroup open="True" name="Wemo manual method using HTTP POST" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1219" name="!!! Run once to set Map Table  with W01 to 192.168.0.106:49153" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="You can create the table by hand or using this command.  Be sure to set the IP address correctly.">
    <action>
      <cmdType>Map.CreateTable</cmdType>
      <params>
        <param>Wemos</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>Wemos</param>
        <param>W01</param>
        <param>192.168.0.106:49153</param>
        <param>False</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
  <command id="758" name="Turn wemo on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Turn wemo on</phrase>
  </command>
  <command id="766" name="Turn wemo off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Turn wemo off</phrase>
  </command>
  <command id="796" name="Toggle wemo" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>BinaryState&gt;([01])&lt;/BinaryState</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>toggle wemo</phrase>
  </command>
  <command id="774" name="get status" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>BinaryState&gt;([01])&lt;/BinaryState</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>WEMO is On</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>WEMO is Off</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>get wemo status</phrase>
  </command>
  <command id="775" name="check port" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;{Empty}</ifParams>
      <then>
        <action>
          <cmdType>VcAdvanced.Log</cmdType>
          <params>
            <param>Wemo is not reachable</param>
            <param>{M:Wemos.W01}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>W01</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.SetEventTimer</cmdType>
          <params>
            <param>30s</param>
            <param>Wemo.CheckPort</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>VcAdvanced.Log</cmdType>
          <params>
            <param>Wemo W01 is OK.  Will check again in 30 minutes.</param>
            <param>{M:Wemos.W01}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.SetEventTimer</cmdType>
          <params>
            <param>30m</param>
            <param>Wemo.CheckPort</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>get wemo status</phrase>
    <event>VC.Loaded</event>
    <event>Wemo.CheckPort</event>
  </command>
  <command id="776" name="rotate port" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Map.Get</cmdType>
      <params>
        <param>Wemos</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:49155</param>
        <param>:looparound</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:49154</param>
        <param>:49155</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:49153</param>
        <param>:49154</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:looparound</param>
        <param>:49153</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>Wemos</param>
        <param>{1}</param>
        <param>{LastResult}</param>
        <param>True</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VcAdvanced.Log</cmdType>
      <params>
        <param>Setting Wemo {1} addr. to {LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Wemo.RotatePort</event>
  </command>
</commandGroup>


I live in an apartment with 19 other wifi signals so sometimes the signal cuts out and that's when my WeMo switches ports, not that often, usually once every couple weeks (almost always when I'm going to bed) and switches back in a day or two

when i get some more time ill see if i can add this to my multi WeMo command and get it uploaded

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Belkin Wemo and Phillips Hue Support
« Reply #42 on: December 22, 2014, 05:45:00 PM »
Thanks.  :D

I cannot even begin to imagine why the port changes at all.  Since no two devices can have the same IP address, there is no reason to vary the port.  I wonder what Belkin was up to the day they made that decision...

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Belkin Wemo and Phillips Hue Support
« Reply #43 on: December 23, 2014, 03:39:58 AM »
As I was looking over the command you sent me jitterjames, I had an idea, 
instead of having it check every 30min to see if it was still set to the Right port
I thought instead I would have it only search for a new port when I try to use the WeMo and the port is no longer working

so any time I use the command it turns the WeMo on or off as it should, and then the next time I use it the port has changed so it automatically tries to find the port that it needs :clap

here is a sample video of what I mean
http://youtu.be/jcXJXn8wwKo

I made two different versions of this command one is made for 1 WeMo and the Next is made for Multiple WeMo's.

I will post the "WeMo Auto Port set" (1 WeMo) First

There is a Help Command at the Top of this group to create the map table you need, make sure you change the ip address before you execute it,

"WeMo Auto Port set" (1 WeMo)
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.1.0-->
<commandGroup open="True" name="Wemo auto port set" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1219" name="!!! Run once to set Map Table  with W01 to 192.168.0.106:49153" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="You can create the table by hand or using this command.  Be sure to set the IP address correctly. after executing this command then it can be deleted ">
    <action>
      <cmdType>Map.CreateTable</cmdType>
      <params>
        <param>Wemos</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>Wemos</param>
        <param>W01</param>
        <param>192.168.0.106:49153</param>
        <param>False</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
  <command id="758" name="Turn wemo on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{lastResult}&amp;&amp;{Empty}</ifParams>
      <then>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>W01</param>
            <param>WeMo On</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Turn wemo on</phrase>
    <event>WeMo On</event>
  </command>
  <command id="766" name="Turn wemo off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;{Empty}</ifParams>
      <then>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>W01</param>
            <param>WeMo Off</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Turn wemo off</phrase>
    <event>WeMo Off</event>
  </command>
  <command id="796" name="Toggle wemo" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{lastResult}&amp;&amp;{Empty}</ifParams>
      <then>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>W01</param>
            <param>Toggle WeMo</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Results.RegEx</cmdType>
          <params>
            <param>BinaryState&gt;([01])&lt;/BinaryState</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://{M:Wemos.W01}/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>toggle wemo</phrase>
    <event>Toggle WeMo</event>
  </command>
  <command id="776" name="rotate port" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Testing Next Port</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Get</cmdType>
      <params>
        <param>Wemos</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:49155</param>
        <param>:looparound</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:49154</param>
        <param>:49155</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:49153</param>
        <param>:49154</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:looparound</param>
        <param>:49153</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>Wemos</param>
        <param>{1}</param>
        <param>{LastResult}</param>
        <param>True</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VcAdvanced.Log</cmdType>
      <params>
        <param>Setting Wemo {1} addr. to {LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>{2}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Wemo.RotatePort</event>
  </command>
</commandGroup>


Enjoy


« Last Edit: December 23, 2014, 04:13:53 AM by PegLegTV »

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: Belkin Wemo and Phillips Hue Support
« Reply #44 on: December 23, 2014, 03:51:22 AM »
The "MultiWeMo Auto Port set" command is a little Different then the last command,
At the top of this group there is a Help command for building your Map Table
you need to change the IP addresses and the names you want the WeMos to be
 
so for simple use I used Living Room, Bedroom, and Kitchen as the WeMo Names so then I used those same names (exact spelling) in the Payloads for all of the Commands
Any name changes to the Map Table need to be made in the Payloads as well

so i could simply say "Turn Living room WeMo Off" and it uses that payload to know which line to read in the map table

"MultiWeMo Auto Port set" (multiple WeMos)

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.1.0-->
<commandGroup open="False" name="MultiWemo auto port set" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1230" name="!!! Run once to set up MultiWeMo map table !!!!change ip addresses!!!!" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="You can create the table by hand or using this command.  Be sure to set the IP addresses names correctly. after executing this command then it can be deleted ">
    <action>
      <cmdType>Map.CreateTable</cmdType>
      <params>
        <param>MultiWeMos</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>MultiWeMos</param>
        <param>Living Room</param>
        <param>192.168.1.249:49153</param>
        <param>False</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>MultiWeMos</param>
        <param>Bedroom</param>
        <param>192.168.1.249:49154</param>
        <param>False</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>MultiWeMos</param>
        <param>Kitchen</param>
        <param>192.168.1.249:49155</param>
        <param>False</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
  <command id="769" name="Turn wemo on" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:MultiWeMos.{1}}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{lastResult}&amp;&amp;{Empty}</ifParams>
      <then>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>{1}</param>
            <param>WeMo On</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://{M:MultiWeMos.{1}}/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Turn</phrase>
    <payloadList>Living Room, Bedroom, Kitchen</payloadList>
    <phrase>wemo on</phrase>
    <event>WeMo On</event>
  </command>
  <command id="777" name="Turn wemo off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:MultiWeMos.{1}}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;{Empty}</ifParams>
      <then>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>{1}</param>
            <param>WeMo Off</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://{M:MultiWeMos.{1}}/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Turn</phrase>
    <payloadList>Living Room, Bedroom, Kitchen</payloadList>
    <phrase>wemo off</phrase>
    <event>WeMo Off</event>
  </command>
  <command id="807" name="Toggle wemo" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape.Post</cmdType>
      <params>
        <param>http://{M:MultiWeMos.{1}}/upnp/control/basicevent1</param>
        <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:GetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:basicevent:1#GetBinaryState"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{lastResult}&amp;&amp;{Empty}</ifParams>
      <then>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>{1}</param>
            <param>Toggle WeMo</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Results.RegEx</cmdType>
          <params>
            <param>BinaryState&gt;([01])&lt;/BinaryState</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;1</ifParams>
      <then>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://{M:MultiWeMos.{1}}/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;0&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Scrape.Post</cmdType>
          <params>
            <param>http://{M:MultiWeMos.{1}}/upnp/control/basicevent1</param>
            <param>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;s:Body&gt;&lt;u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"&gt;&lt;BinaryState&gt;1&lt;/BinaryState&gt;&lt;/u:SetBinaryState&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
            <param />
            <param />
            <param>text/xml; charset="utf-8"</param>
            <param>SOAPAction: "urn:Belkin:service:basicevent:1#SetBinaryState"</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>toggle</phrase>
    <payloadList>Living Room, Bedroom, Kitchen</payloadList>
    <phrase>wemo</phrase>
    <event>Toggle WeMo</event>
  </command>
  <command id="787" name="rotate port" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Testing Next Port</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Get</cmdType>
      <params>
        <param>MultiWeMos</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:49155</param>
        <param>:looparound</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:49154</param>
        <param>:49155</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:49153</param>
        <param>:49154</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegExReplace</cmdType>
      <params>
        <param>:looparound</param>
        <param>:49153</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Map.Set</cmdType>
      <params>
        <param>MultiWeMos</param>
        <param>{1}</param>
        <param>{LastResult}</param>
        <param>True</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VcAdvanced.Log</cmdType>
      <params>
        <param>Setting Wemo {1} addr. to {LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>{2}</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Wemo.RotatePort</event>
  </command>
</commandGroup>

to use these commands with other commands by using VC.TrigerEvent you need to set payload 1 as the name of the WeMo you want to control

Thanks again jitterjames for all the help    :yay ::banana

Enjoy
« Last Edit: December 23, 2014, 04:14:58 AM by PegLegTV »