Author Topic: WeMo Lights (Bridge)  (Read 4260 times)

0 Members and 1 Guest are viewing this topic.

Jazzik

  • Jr. Member
  • **
  • Posts: 14
  • Karma: 1
    • View Profile
WeMo Lights (Bridge)
« on: December 29, 2014, 05:07:30 AM »
Hey Guys,

*added for clarity -  I bought one of these http://www.belkin.com/uk/p/P-F5Z0489/ and found it was not compatible with the WeMo plugin, due to it not having a switch. After a bit of messing around a friend and I worked out whats being sent to the WeMo bridge in order to control the lights that arent on WeMo switches

This is the xml for controlling a single bulb, i have also attached my payload as the value to control the brightness is between 0-255

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.0.7-->
<commandGroup open="True" name="WeMo - Lights" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="772" name="Dim Lights" 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.19:49153/upnp/control/bridge1</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:SetDeviceStatus xmlns:u="urn:Belkin:service:bridge:1"&gt;&lt;DeviceStatusList&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;lt;DeviceStatus&amp;gt;&amp;lt;IsGroupAction&amp;gt;NO&amp;lt;/IsGroupAction&amp;gt;&amp;lt;DeviceID available=&amp;quot;YES&amp;quot;&amp;gt;94103EA2B27844D2&amp;lt;/DeviceID&amp;gt;&amp;lt;CapabilityID&amp;gt;10008&amp;lt;/CapabilityID&amp;gt;&amp;lt;CapabilityValue&amp;gt;{1}:0&amp;lt;/CapabilityValue&amp;gt;&amp;lt;/DeviceStatus&amp;gt;&lt;/DeviceStatusList&gt;&lt;/u:SetDeviceStatus&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;
        <param />
        <param />
        <param>text/xml; charset="utf-8"</param>
        <param>SOAPAction: "urn:Belkin:service:bridge:1#SetDeviceStatus"</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">set,dim</phrase>
    <phrase>lights</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">lights.xml</payloadFromXML>
    <phrase optional="true">percent</phrase>
  </command>
</commandGroup>


Some things you will need to change:
94103EA2B27844D2, this is your UDN (Unique Device Number) for each bulb, which can be gotten through the WeMoManager app.

The IP and Port will need to change as applicable to you. Have found that the bridge can use one of three ports so may be worth factoring that in aswell. (49154,49153,49152).
Everything between the <Device Status> tags can be duplicated in a single command to allow the same command to control more than one light. For example, my current command for controlling both of my lounge lights looks like this:


Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.0.7-->
<command id="772" name="Dim Lights" 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.19:49153/upnp/control/bridge1</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:SetDeviceStatus xmlns:u="urn:Belkin:service:bridge:1"&gt;&lt;DeviceStatusList&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&amp;lt;DeviceStatus&amp;gt;&amp;lt;IsGroupAction&amp;gt;NO&amp;lt;/IsGroupAction&amp;gt;&amp;lt;DeviceID available=&amp;quot;YES&amp;quot;&amp;gt;94103EA2B27844D2&amp;lt;/DeviceID&amp;gt;&amp;lt;CapabilityID&amp;gt;10008&amp;lt;/CapabilityID&amp;gt;&amp;lt;CapabilityValue&amp;gt;{1}:0&amp;lt;/CapabilityValue&amp;gt;&amp;lt;/DeviceStatus&amp;gt;&amp;lt;DeviceStatus&amp;gt;&amp;lt;IsGroupAction&amp;gt;NO&amp;lt;/IsGroupAction&amp;gt;&amp;lt;DeviceID available=&amp;quot;YES&amp;quot;&amp;gt;94103EA2B2786628&amp;lt;/DeviceID&amp;gt;&amp;lt;CapabilityID&amp;gt;10008&amp;lt;/CapabilityID&amp;gt;&amp;lt;CapabilityValue&amp;gt;{1}:0&amp;lt;/CapabilityValue&amp;gt;&amp;lt;/DeviceStatus&amp;gt;&lt;/DeviceStatusList&gt;&lt;/u:SetDeviceStatus&gt;&lt;/s:Body&gt;&lt;/s:Envelope&gt;</param>
      <param />
      <param />
      <param>text/xml; charset="utf-8"</param>
      <param>SOAPAction: "urn:Belkin:service:bridge:1#SetDeviceStatus"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase optional="true">set,dim</phrase>
  <phrase>lights</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">lights.xml</payloadFromXML>
  <phrase optional="true">percent</phrase>
</command>
« Last Edit: December 29, 2014, 10:00:23 AM by Jazzik »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: WeMo Lights (Bridge)
« Reply #1 on: December 29, 2014, 09:37:35 AM »
What is a Wemo bridge?

Jazzik

  • Jr. Member
  • **
  • Posts: 14
  • Karma: 1
    • View Profile
Re: WeMo Lights (Bridge)
« Reply #2 on: December 29, 2014, 09:57:10 AM »
When you buy a WeMo LED starter set, it comes with a bridge which has a direct IP address, the lights themselves do not have one, and no switches to control instead.

http://www.belkin.com/uk/p/P-F5Z0489/


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: WeMo Lights (Bridge)
« Reply #3 on: December 29, 2014, 11:27:36 AM »
I see, thanks. Looks like Wemo is coming out with some new stuff.  Unfortunately I only have the one switch that was donated to me that I can test with.

Thanks for posting your command.  Hopefully it will be helpful to others that have this device.