VoxCommando

New Features and Feature Requests => Feature Requests => Topic started by: jb5349 on November 18, 2013, 02:00:37 PM

Title: Belkin Wemo and Phillips Hue Support
Post by: jb5349 on November 18, 2013, 02:00:37 PM
Any chance since the APIs and SDKs are available that there could be plugins or support for Belkin Wemo devices (switches, motion sensors, energy usage monitor, etc.) to be used with VC. I know there is an HTTP interface for these and I have seen some python scripts on the Internet, but it would be great to have a nice plugin that 1. detected the devices and added them to a payloadxml and 2. sent commands to the devices

Also, same idea with Phillips Hue Wifi to Zigbee interface to control LED light bulbs.

And by chance, the new LifeX wifi bulbs (which are controlled directly through a nifty mesh network using only 1 IP address) www.lifex.co


I have managed to get VC to work using my Radio Thermostat brand (3M Filtrete model Wifi Thermostat) from Home Depot to read me temperatures and modes, etc. I still need to figure out how to send the JSON formatted commands back to it. Maybe I just need an example of how to send a POST request with text data in it to the interface.

And pretty much being able to control other Internet (wifi) connected devices as they are introduced to the marketplace.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on November 18, 2013, 02:28:00 PM
Sure if there are sdks and apis you can create the plugin yourself.

If you want me to do it, and there is a decent api available, just send me the hardware and I'll see what I can do.  Send me a PM if this is something you are interested in.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jb5349 on November 18, 2013, 08:22:11 PM
How do you make a plugin for VC? I guess I didn't realize we could do that.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on November 18, 2013, 08:53:17 PM
http://voxcommando.com/forum/index.php?topic=943.0
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jb5349 on November 19, 2013, 05:01:52 AM
Thanks! I will take a look. I do program in VB.net and C# isn't that much different, so maybe I will figure out how to make some plug-ins for some things soon.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: xtermin8r on November 19, 2013, 05:09:11 AM
Quote
I still need to figure out how to send the JSON formatted commands back to it. Maybe I just need an example of how to send a POST request with text data in it to the interface.

take a look at this thread it may be of some help.

http://voxcommando.com/forum/index.php?topic=10.0
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jb5349 on November 20, 2013, 01:14:55 PM
I realized I could use the python curl command or pycurl to interact with these devices. Anyone have an example of how this would look in Vc command builder? Python is new to me but I found some existing scripts for several devices I want to try to modify to work with VC so that anyone with these devices can use them right away.

I actually don't own many of these yet but might purchase some to test it with if I can get the code figured out. They aren't cheap though.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jwosi on February 05, 2014, 10:44:42 AM
I came across VoxCommando the other night and I’m on the fence about buying it. Then I came across this post. I have both these products and they are great. It would be even better to control them from one application. Is there any chance that a plugin will be created for these products? Also, if someone got a custom plugin working, any chance you could help someone with no programing experience?   ;)

Thanks
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on February 05, 2014, 11:05:09 AM
Take your time deciding.  You can use the trial mode for as long as you want.

In order for me to make a plugin for these I would need access to the hardware.  They both seem overpriced to me and as yet I don't see enough of a demand to justify spending the money or the time.

That said, both of these can probably be controlled with VoxCommando using existing actions and plugins. Between Scrape, RoboBrowser, the UDP actions, TCP plugin, and EventGhost pretty much anything can be done.

If you are asking whether I can help a non-programmer to program a plugin for VC then the answer is no.  I simply don't have that much time.  However if you come up with some python code for the python plugin and need some help with it we will do our best to help out.

If someone has experience with C# and visual studio then I will try to help with plugin development.  It is not too hard if you have programming experience.

If someone wants to send me hardware to play with I will see about making a plugin for just about anything.  If someone wants to send me a Wemo or Hue to play with I'll be happy to give it a go.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: SuperKronz on March 01, 2014, 01:33:17 AM
I have a wemo wall outlet (plugs into existing outlet)I can donate to the cause.  I picked up a few before I got into the zwave stuff.  Personally, I find they do some funny IP stuff - IP changes frequently for no reason I can determine and I don't see a way to set a static one.

If James wants to send me a private with the shipping address I will send it off (and hardly ever show up at his place looking for custom code).
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: Kalle on March 01, 2014, 05:37:38 AM
Hi SuperKonz, habe mir mal die Beschreibung von WeMo angeschaut und habe nur ein api für iOS und Android gefunden http://developers.belkin.com/wemo/sdk (http://developers.belkin.com/wemo/sdk).
Um das wechseln der IP zu verhindern, musst Du für die WeMo Geräte im Router (über die MAC-Adresse) die IP für jedes Gerät reservieren.

In Canada werden 110 Volt benötigt und daher denke ich, die Schalter werden bei James nicht funktionieren.

Gruß
Kalle
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: nime5ter on March 01, 2014, 08:12:38 AM
Hi Kalle,

Ich glaube, SuperKronz wohnt auch in Kanada. Ha. Es ist aber schwer mit alle diese Benutzernamen!
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: Kalle on March 01, 2014, 09:26:42 AM
Haha, ups  :bonk
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on March 01, 2014, 11:17:01 AM
If James wants to send me a private with the shipping address I will send it off (and hardly ever show up at his place looking for custom code).
You forgot your winky face...

That's great.  Looks like we've got two "Special K's" on the forum now...  :biglaugh

I sent you an email.

You can show up any time as long as you bring beer.  ;D
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: SuperKronz on March 01, 2014, 04:07:00 PM
Hi Kalle,

Thanks for the response, I think I even understood a little bit  ;D.

The wemo seems crazy the way it handles allocating their IPs - They don't show up on my routers list of assigned devices so I wasn't able to reserve an IP via MAC address.  Almost like they sniff the network to find the IP range, and then just pick one themselves (without actually asking the router for one or registering!).

I dunno, probably my crazy network - I'm just mailing one to James and let him sort it out :).  Zwave stuff blows Belkin out of the water anyway so I don't imagine I will use them anyway.

Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on March 01, 2014, 04:32:24 PM
I think the wemo only makes sense if you want one or two switches, and maybe a motion sensor and that is as far as you will ever go with home automation.  As soon as you start to contemplate a more comprehensive house automation solution, it only makes sense to have a centralized controller such as the Vera.  The idea of a lightbulb that has its own IP address is one that I think can only go so far before you are tripping over yourself...

In any case if I can crack the code without too much trouble I will share what I learn and maybe even make a little plugin if we can't make do using exising VC tools.

Thanks again SuperK.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: Casmo on March 01, 2014, 08:24:20 PM
Hi all,

 Just wondering if anyone has went any further with philips hue support?
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: JoshK on March 28, 2014, 04:26:45 AM
Was there any update on how to control the wemo's?

I may be able to offer some advice, but not the entire solution - the wemo's can be set to a specific IP address quite easily from your router, they do however change the ports they listen on

my irulesetup sends the following string via http post to the IP of the wemo, and sends it on port 49152, 4953, and 49154 as this seems to be ports the wemo switches between

On -
Code: [Select]
/upnp/control/basicevent1?<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:SetBinaryState></s:Body></s:Envelope>
Off -
Code: [Select]
/upnp/control/basicevent1?<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>0</BinaryState></u:SetBinaryState></s:Body></s:Envelope>
Getstatus -
Code: [Select]
/upnp/control/basicevent1?<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState></BinaryState></u:GetBinaryState></s:Body></s:Envelope>
If somebody could tell me how send these commands via http post in vc that would be great.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on March 28, 2014, 11:48:48 AM
No, not yet but there will be one or more possible solutions for Wemo very soon.  I just got my hands on one yesterday.

Thanks for the information.  It is very helpful.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on March 28, 2014, 12:33:09 PM
The latest alpha (which I just uploaded) supports new scrape methods including Put and Post.

http://voxcommando.com/forum/index.php?topic=1443.msg12499#msg12499

Here is a sample group with ON and OFF for my Wemo which has an IP of 192.168.0.104
These commands work for me.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.1.9-->
<commandGroup open="True" name="wemo" 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.104: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.104: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>0</cmdRepeat>
    </action>
    <phrase>Turn wemo off</phrase>
  </command>
</commandGroup>
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: JoshK on March 31, 2014, 04:40:23 AM
thankyou, works perfectly.

for future advice for anyone else reading the post, the above command works, however i'd advise creating 3 actions for ports 49152,49153, and 49154 to ensure it always works.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on July 22, 2014, 10:08:00 AM
Just a heads up that I finally got around to making a Wemo plugin, so in the next release of VC2 we will have plugins for both the Belkin Wemo and the Phillps Hue.

http://voxcommando.com/mediawiki/index.php?title=ChangeLog#New_updates_currently_in_progress

For the Wemo we only have support at the moment for querying or controlling switches, because SuperKronz sent me a switch to play with.  I'm not sure if something can also be done with a motion sensor or if there are any other Wemo devices available.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on September 09, 2014, 07:39:34 PM
Hey jitterjames, I Want to start by saying I Love this Software :biglaugh I have been working off and on over the last couple months building all my extra commands to work with Eventghost, A MCE Receiver(IR Blasting), an Amulet Remote and a WeMo Outlet and that's what brings me here I have been using the UPNP method to use it to turn my lamp on and off and the other night when i bought your software i saw there was an update that had the Wemo plugin so i upgraded and tested on my laptop(W7 64 bit) which worked great, so i upgraded on my HTPC (W8.1 64bit), and for some reason when i scan for the device it says no devices found i have restarted VC and restarted the computer also made sure that the windows firewall for VC was set right, everything was good there. I Also un-plugged the outlet and plugged it back in to see if that would help to no avail, when i check the log through the file drop down menu it just has one line that says

"9/9/2014 4:35:34 PM   VoxLog created / UAC test passed."

any help would be great.

UpNp is still working but i would like to be able to use the plugin so i don't have to edit my "turn on / turn off" commands any time my WeMo changes ports
and again Love this software. thanks for the awesome work

Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on September 09, 2014, 09:32:52 PM
Hi PegLeg

I can't think of any reason why it should not work in Windows 8 specifically, other than some firewall/antivirus interference or some other network related problem.

Your vox log is probably empty because you need to enable logging on the options menu.  I doubt it will reveal much to us in this instance though.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on September 09, 2014, 09:39:14 PM
I should mention though that accessing a wemo directly on the lan by any method is essentially a hack.  It is all undocumented stuff and it is not how the normal wemo app operates. If you look around the internet for a couple of minutes you will find many, many people having problems of all sorts with their wemos suddenly disappearing etc.

The VC  Wemo plugin uses UPnP discovery to find the wemo.  If it shows up in your network in explorer then it should also show up in VC.

I don't know if something like this might help you: http://www.honestcanadian.com/2014/03/31/enable-upnp-on-windows-8-1/
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on September 09, 2014, 09:53:04 PM
thanks for the fast response,  I am using a powerline Adapter on the W8.1 computer but that's never caused any issues for anything else I've done, I checked Explorer and its there along with the same info as my W7 computer. ill do some more looking to see what i can find.


thanks 
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on September 11, 2014, 04:34:47 PM
Try the following and see if it detects your wemo.

Download the attached and unzip the two files into an empty folder.  Then run UPNP.exe

Note: depending on your security settings you may need to unlock the Upnp.exe and or the ManagedUPnP.dll files for the program to work.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on September 11, 2014, 05:02:57 PM
I ran it on my W8.1 and my W7 so i could compare the output and it found it on windows 7 but not on the W8.1

 i did some looking the other night and I didn't have any luck figuring a way around it I tried to port forward the ports, and i also double checked the firewall settings to see if i could see the WeMo but its not listed in the firewall for either W7 or W8.1

I also dug out my wife's laptop that's running W8.1 and added VC to it and scanned for the WeMo it couldn't find it on there either.

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")


thanks for responding
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on September 11, 2014, 05:11:00 PM
Yes.  Earlier in this thread is a command that works fine without the plugin...

http://voxcommando.com/forum/index.php?topic=1261.msg12793#msg12793

As long as your Wemo IP address does not change then it should work fine.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames on September 11, 2014, 05:39:04 PM
I tried this on Windows 8.1 and I have the same problem.  I am able to see other UPnP device like my router, my Hue, and my Onkyo.  I have no idea what the problem is.  Just one more reason why I h8.1
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames 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>
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV 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 
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames 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.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on September 11, 2014, 07:15:24 PM
thanks to Nime5ter too  ;D
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV 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 (http://voxcommando.com/forum/index.php?topic=1261.msg16583#msg16583)
Multiple WeMo Setup http://voxcommando.com/forum/index.php?topic=1261.msg16584#msg16584 (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)
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV 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 (http://voxcommando.com/forum/index.php?topic=1261.msg16583#msg16583)
Multiple WeMo Setup http://voxcommando.com/forum/index.php?topic=1261.msg16584#msg16584 (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
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames 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
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV 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
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames 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.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames 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
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames 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
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV 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
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: jitterjames 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...
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV 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 (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


Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV 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
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: nime5ter on December 23, 2014, 01:33:38 PM
Nice! Thanks for the posts, PegLeg.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on February 10, 2015, 11:54:59 AM
I'm getting an error when trying to turn my WeMo on and off when its on the wrong port now

(https://voxcommando.com/forum/proxy.php?request=http%3A%2F%2Fi1296.photobucket.com%2Falbums%2Fag18%2Fpeglegtv%2FPublic%2Fbelkinerror_zps9bcdf051.png&hash=6bb3aea78af0221b575531a2727b0807ad69feaa)

I've been using my Auto Port finder (http://voxcommando.com/forum/index.php?topic=1261.msg16583#msg16583) for awhile now, but I started to get an error that I've never seen before

It no longer triggers the event like it used to

I tried to change the "(A)==(B)" to "last action successes" but it only triggers the port to change once and then scrapes the post the second time even though it was not successful

I only changed the "lights on" command, the "lights off" and "Toggle lights" commands are still the same as the post I shared 
I also included a map builder command, IP will need to be changed
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<commandGroup open="True" name="Lights 2.0" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1235" name="Map Table Creater for lights setup" 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.1.249:49153</param>
        <param>False</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
  </command>
  <command id="774" name="Turn Lights 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>LastActionSuccess</ifType>
      <ifParams>{lastResult}&amp;&amp;{Empty}</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;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>
      </then>
      <else>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>W01</param>
            <param>Lights On</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>Lights on</event>
    <phrase>lights on</phrase>
  </command>
  <command id="782" name="Turn Lights 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>Lights 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>
    <event>Lights off</event>
    <phrase>Lights off</phrase>
  </command>
  <command id="825" name="Toggle Lights" 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>Lights</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>Lights please</phrase>
    <event>Lights</event>
  </command>
  <command id="792" 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>


I really hope Belkin just decided to drop the other two ports ( wishful thinking on my end)

any help would be great

Thanks

EDIT: using VC 2.138
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: nime5ter on February 10, 2015, 01:08:14 PM
Testing out your problem, I ran into the same issue but only with 2.1.3.8.

James suggested I try to run VC as administrator (because he's been attempting to resolve UAC-related user problems in his code recently).

Running as administrator fixed the problem for me. In fact, I only had to run as admin once. Afterward, when I relaunched VC no longer as admin, it continued to work for me.

I'm on a W7 machine though. It would be great if you could test this out on your W8 machine and report back.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on February 10, 2015, 02:39:19 PM
thanks for the reply

tried to run as admin and received a new error this time

(https://voxcommando.com/forum/proxy.php?request=http%3A%2F%2Fi1296.photobucket.com%2Falbums%2Fag18%2Fpeglegtv%2Fwemoerror_zps123a3c01.png&hash=27a2212cb97565bc6165fc85983dff27bdafcdd9)

I then launched it normal (non admin) and had the new error show again

so I'm not seeing the original error
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: nime5ter on February 10, 2015, 03:02:01 PM
Hmm. Now that you mention it, I never had the connection refusal error. The timed out error is actually the only error I was receiving, and that disappeared when I switched to admin.

The "heightened security" of W8, perhaps.  ::)

Anyhoo, for now you may want to revert to 2.1.3.6 for your main config.  (Maybe keep using the xJson.dll from 2.1.3.8, though, since you're a hardcore XBMC user.)

http://voxcommando.com/mediawiki/index.php?title=ChangeLog#Version_2.1.3.8

I'll log the problem so that James can try to investigate using one of the W8 testing machines when he has time. If you make any other discoveries on this, let us know.

Thanks for the report, and sorry for the headache!
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on February 10, 2015, 04:33:20 PM
okay now I'm really lost I switched back to my copy of 2.136 to see if that helped, but no luck

I'll keep doing some digging to see if I can find anything else
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: nime5ter on February 10, 2015, 04:38:47 PM
Nuts.

Any chance you could have added typos/errors to your command xml in the meantime, while attempting to fix the problem?

Might be worth grabbing the xml you posted to the forum and using that as your test group, just in case.
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on February 10, 2015, 04:45:59 PM

It works when I manually change the port number in the map, but it no longer rotates through the ports when my WeMo switches ports, so for now I'll keep digging and just manually switch the ports when needed



Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on February 10, 2015, 10:47:42 PM
did some more testing and was able to get it working using "LastActionSuccess"  instead, this is the only group that I use {Empty} so I'm not sure if there could be something wrong with that (not suggesting there is, just curious)

this command is if the first post of Wemo auto port set (http://voxcommando.com/forum/index.php?topic=1261.msg16583#msg16583) is no longer working for you

Wemo auto port set 2.0:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<commandGroup open="False" name="Wemo auto port set 2.0" 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>LastActionSuccess</ifType>
      <ifParams>{lastResult}&amp;&amp;{Empty}</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;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>
      </then>
      <else>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>W01</param>
            <param>WeMo On</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>LastActionSuccess</ifType>
      <ifParams>{LastResult}&amp;&amp;{Empty}</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>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>W01</param>
            <param>WeMo Off</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Turn wemo off</phrase>
    <event>WeMo Off</event>
  </command>
  <command id="800" 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>LastActionSuccess</ifType>
      <ifParams>{lastResult}&amp;&amp;{Empty}</ifParams>
      <then>
        <action>
          <cmdType>Results.RegEx</cmdType>
          <params>
            <param>BinaryState&gt;([01])&lt;/BinaryState</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>W01</param>
            <param>Toggle WeMo</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>


will post the MultiWeMo auto port set in the next post


Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on February 10, 2015, 10:49:09 PM
use this group if multiWeMo Auto Port set (http://voxcommando.com/forum/index.php?topic=1261.msg16584#msg16584) is no longer working for you

MultiWeMo Auto Port set 2.0:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.8-->
<commandGroup open="False" name="MultiWemo auto port set 2.0" 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>LastActionSuccess</ifType>
      <ifParams>{lastResult}&amp;&amp;{Empty}</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;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>
      </then>
      <else>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>{1}</param>
            <param>WeMo On</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>LastActionSuccess</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>LastActionSuccess</ifType>
      <ifParams>{lastResult}&amp;&amp;{Empty}</ifParams>
      <then>
        <action>
          <cmdType>Results.RegEx</cmdType>
          <params>
            <param>BinaryState&gt;([01])&lt;/BinaryState</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>Wemo.RotatePort</param>
            <param>{1}</param>
            <param>Toggle WeMo</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>

Thanks for the help nime5ter
Title: Re: Belkin Wemo and Phillips Hue Support
Post by: nime5ter on February 11, 2015, 11:21:37 AM
did some more testing and was able to get it working using "LastActionSuccess"  instead, this is the only group that I use {Empty} so I'm not sure if there could be something wrong with that (not suggesting there is, just curious)

For what you're trying to evaluate, "LastActionSuccess" seems like the right choice.

I'm actually not sure how/why evaluating {LastResult} = {Empty} was ever working for you for this command. As I understand it, you were attempting to get a status from your Wemo, and if you could not get a status, then you were triggering the command to try a different port. Is that right?

The problem is that {LastResult} is almost never empty, except maybe when VC launches (and even then, many times we have commands running on VC.Loaded that will return some kind of result).

In this case, your Scrape action isn't returning an "empty" result -- it's not able to execute the scrape at all because it can't connect to the wrong port.

Because {LastResult} is essentially a global variable, if your Scrape action is unsuccessful, the value of {LastResult} will remain as the value that it had previously been set to by some other, successful action that returns a result.

Title: Re: Belkin Wemo and Phillips Hue Support
Post by: PegLegTV on February 11, 2015, 01:53:37 PM
I'm actually not sure how/why evaluating {LastResult} = {Empty} was ever working for you for this command. As I understand it, you were attempting to get a status from your Wemo, and if you could not get a status, then you were triggering the command to try a different port. Is that right?

yep, that is exactly it, I honestly don't remember why I used "(A)==(B)---{LastResult}=={Empty}" but it worked for a while, I was wondering the same thing when I started to have problems with it, so I tried "LastActionSuccses" and that seemed to take care of it.

why they felt the need to rotate ports, is beyond me when each device has it's own IP,

once I get some more Milights I'll only use the WeMo outlet switch for my Christmas Tree so that way hopefully it wont be as big of a headache but still get some good use out of it

Thanks again for the help

Title: Re: Belkin Wemo and Phillips Hue Support
Post by: nime5ter on February 11, 2015, 03:26:31 PM
Yeah, I find the Wemos to be perplexing products in general. :)

Here's hoping the Milights are somewhat durable!