WeMo Insight Hacking


This is a web service breakdown that I have used to create an interface with the WeMo Insight to not only set its state but also pull information about its energy usage.

[ads]The potentials for this are endless.  An example use case for a device like this that I have used it for is I hooked this up to my Lasko Humidifier.   It has a built in humidity sensor which will cycle the unit on and off as needed.  The WeMo Insight gives me the ability to see if the unit is running or not.  When my  is running on maximum setting it uses 70W.  When it cycles off it uses less than 2W.  So with the WeMo Insight I can see how many hours of the day the humidifier has been running as well as an estimated monthly cost of running the unit based on past usage.  I had originally intended to use the humidity output of my Nest to drive a Wemo switch on and off.  But for now this was much faster and easier to set up and I can see all the metrics I wanted.

By using the information below you can integrate these units into custom applications for remotely monitoring energy usage.  You also get the same functionality the original Wemo offers.

If you find this page useful please leave your comments below or link to this page.

Wemo Insight /setup.xml

<?xml version="1.0"?>
<root xmlns="urn:Belkin:device-1-0">
  <specVersion>
    <major>1</major>
    <minor>0</minor>
  </specVersion>
  <device>
<deviceType>urn:Belkin:device:insight:1</deviceType>
<friendlyName>WeMo Insight</friendlyName>
    <manufacturer>Belkin International Inc.</manufacturer>
    <manufacturerURL>http://www.belkin.com</manufacturerURL>
    <modelDescription>Belkin Insight 1.0</modelDescription>
    <modelName>Insight</modelName>
    <modelNumber>1.0</modelNumber>
    <modelURL>http://www.belkin.com/plugin/</modelURL>
<serialNumber>221342K12000FD</serialNumber>
<UDN>uuid:Insight-1_0-221342K12000FD</UDN>
    <UPC>123456789</UPC>
<macAddress>EC1A59F6D578</macAddress>
<firmwareVersion>WeMo_WW_2.00.3949.PVT</firmwareVersion>
<iconVersion>0|49153</iconVersion>
<binaryState>8</binaryState>
    <iconList> 
      <icon> 
        <mimetype>jpg</mimetype> 
        <width>100</width> 
        <height>100</height> 
        <depth>100</depth> 
         <url>icon.jpg</url> 
      </icon> 
    </iconList>
    <serviceList>

      <service>
        <serviceType>urn:Belkin:service:WiFiSetup:1</serviceType>
        <serviceId>urn:Belkin:serviceId:WiFiSetup1</serviceId>
        <controlURL>/upnp/control/WiFiSetup1</controlURL>
        <eventSubURL>/upnp/event/WiFiSetup1</eventSubURL>
        <SCPDURL>/setupservice.xml</SCPDURL>
      </service>

      <service>
        <serviceType>urn:Belkin:service:timesync:1</serviceType>
        <serviceId>urn:Belkin:serviceId:timesync1</serviceId>
        <controlURL>/upnp/control/timesync1</controlURL>
        <eventSubURL>/upnp/event/timesync1</eventSubURL>
        <SCPDURL>/timesyncservice.xml</SCPDURL>
      </service>

      <service>
        <serviceType>urn:Belkin:service:basicevent:1</serviceType>
        <serviceId>urn:Belkin:serviceId:basicevent1</serviceId>
        <controlURL>/upnp/control/basicevent1</controlURL>
        <eventSubURL>/upnp/event/basicevent1</eventSubURL>
        <SCPDURL>/eventservice.xml</SCPDURL>
      </service>

      <service>
        <serviceType>urn:Belkin:service:firmwareupdate:1</serviceType>
        <serviceId>urn:Belkin:serviceId:firmwareupdate1</serviceId>
        <controlURL>/upnp/control/firmwareupdate1</controlURL>
        <eventSubURL>/upnp/event/firmwareupdate1</eventSubURL>
        <SCPDURL>/firmwareupdate.xml</SCPDURL>
      </service>

      <service>
        <serviceType>urn:Belkin:service:rules:1</serviceType>
        <serviceId>urn:Belkin:serviceId:rules1</serviceId>
        <controlURL>/upnp/control/rules1</controlURL>
        <eventSubURL>/upnp/event/rules1</eventSubURL>
        <SCPDURL>/rulesservice.xml</SCPDURL>
      </service>
	  
      <service>
        <serviceType>urn:Belkin:service:metainfo:1</serviceType>
        <serviceId>urn:Belkin:serviceId:metainfo1</serviceId>
        <controlURL>/upnp/control/metainfo1</controlURL>
        <eventSubURL>/upnp/event/metainfo1</eventSubURL>
        <SCPDURL>/metainfoservice.xml</SCPDURL>
      </service>

      <service>
        <serviceType>urn:Belkin:service:remoteaccess:1</serviceType>
        <serviceId>urn:Belkin:serviceId:remoteaccess1</serviceId>
        <controlURL>/upnp/control/remoteaccess1</controlURL>
        <eventSubURL>/upnp/event/remoteaccess1</eventSubURL>
        <SCPDURL>/remoteaccess.xml</SCPDURL>
      </service>
	   
      <service>
        <serviceType>urn:Belkin:service:deviceinfo:1</serviceType>
        <serviceId>urn:Belkin:serviceId:deviceinfo1</serviceId>
        <controlURL>/upnp/control/deviceinfo1</controlURL>
        <eventSubURL>/upnp/event/deviceinfo1</eventSubURL>
        <SCPDURL>/deviceinfoservice.xml</SCPDURL>
      </service>

      <service>
        <serviceType>urn:Belkin:service:insight:1</serviceType>
        <serviceId>urn:Belkin:serviceId:insight1</serviceId>
        <controlURL>/upnp/control/insight1</controlURL>
        <eventSubURL>/upnp/event/insight1</eventSubURL>
        <SCPDURL>/insightservice.xml</SCPDURL>
      </service>

    </serviceList>
   <presentationURL>/pluginpres.html</presentationURL>
</device>
</root>

Wemo Insight /setupservice.xml

I am posting this as reference and I have only used the official apps to setup the WeMo.

<?xml version="1.0"?>
<scpd xmlns="urn:Belkin:service-1-0">

  <specVersion>
    <major>1</major>
    <minor>0</minor>
  </specVersion>
  
<actionList>
    <action>
        <name>GetApList</name>
        <argumentList>
         <argument>
         <retval/>
         <name>ApList</name>
         <relatedStateVariable>ApList</relatedStateVariable>
         <direction>out</direction>
         </argument>
         </argumentList>
    </action>
    
    <action>
        <name>GetNetworkList</name>
        <argumentList>
         <argument>
         <retval/>
         <name>NetworkList</name>
         <relatedStateVariable>NetworkList</relatedStateVariable>
         <direction>out</direction>
         </argument>
         </argumentList>
    </action>
    
    <action>
      <name>ConnectHomeNetwork</name>    
      <argumentList>

         <argument>
           <retval />
           <name>ssid</name>
           <relatedStateVariable>ssid</relatedStateVariable>
           <direction>in</direction>
          </argument>
          
          <argument>
         <retval />
        <name>auth</name>
        <relatedStateVariable>auth</relatedStateVariable>
        <direction>in</direction>
        </argument>

       <argument>
             <retval />
             <name>password</name>
             <relatedStateVariable>password</relatedStateVariable>
             <direction>in</direction>
       </argument>

       <argument>
             <retval />
             <name>encrypt</name>
             <relatedStateVariable>encrypt</relatedStateVariable>
             <direction>in</direction>
       </argument>

       <argument>
             <retval />
             <name>channel</name>
             <relatedStateVariable>channel</relatedStateVariable>
             <direction>in</direction>
       </argument>
       
      </argumentList>
          
    </action>
    
        <action>
          <name>GetNetworkStatus</name>    
          <argumentList>
             <argument>
               <retval />
               <name>NetworkStatus</name>
               <relatedStateVariable>NetworkStatus</relatedStateVariable>
               <direction>out</direction>
              </argument>
          </argumentList>
    </action>

    <action>
          <name>CloseSetup</name>    
          <argumentList>
          </argumentList>
    </action>
	
	<action>
          <name>StopPair</name>    
          <argumentList>
          </argumentList>
    </action>
    
</actionList>

  <serviceStateTable>
  
  <!-- connected, connecting, disconnected, time out error -->
  <stateVariable sendEvents="yes">
      <name>NetworkStatus</name>
      <dataType>string</dataType>
      <defaultValue>Disconnected</defaultValue>
    </stateVariable>
  <stateVariable sendEvents="yes">	
	<name>PairingStatus</name>
      <dataType>string</dataType>
      <defaultValue>Connecting</defaultValue>
    </stateVariable>
    
    <stateVariable sendEvents="yes">
      <name>ApList</name>
      <dataType>string</dataType>
      <defaultValue></defaultValue>
    </stateVariable>
	
    <stateVariable sendEvents="yes">
      <name>NetworkList</name>
      <dataType>string</dataType>
      <defaultValue></defaultValue>
    </stateVariable>
	
  </serviceStateTable>
  
  </scpd>

WeMo Insight /insightservice.xml

I have successfully interfaced with the WeMo Insight and have been able to pull useful data from the unit.  I have not been able to successfully get the unit to respond to most of the commands below.  The one that I have been able to is the “GetInsightParams” value.  This value returns a string similar to:

8|1392596207|921|39438|165498|247887|65|120|44711511|186987220.000000|8000

I have been able to make educated guesses as to what each of these values are:

  1. State
  2. Seconds Since 1970 of Last State Change
  3. Last On Seconds
  4. Seconds On Today
  5. Unknown – Unit is Seconds
  6. Total Seconds
  7. Unknown – Units are Watts
  8. Energy Used Today in mW * minutes
  9. Energy Used Total in mW * minutes
  10. Unknown

Please let me know what 5, 7, and 10 are if you figure them out.

<?xml version="1.0"?>
<scpd xmlns="urn:Belkin:service-1-0">

  <specVersion>
    <major>1</major>
    <minor>0</minor>
  </specVersion>
  
  <actionList>

<action>
  <name>GetPower</name>
  <argumentList>
     <argument>
       <retval />
       <name>InstantPower</name>
       <relatedStateVariable>InstantPower</relatedStateVariable>
       <direction>out</direction>
      </argument>
  </argumentList>
</action>

<action>
  <name>GetTodayKWH</name>
  <argumentList>
     <argument>
       <retval />
       <name>TodayKWH</name>
       <relatedStateVariable>TodayKWH</relatedStateVariable>
       <direction>out</direction>
      </argument>
  </argumentList>
</action>

<action>
  <name>SetAutoPowerThreshold</name>
  <argumentList>
     <argument>
       <retval />
       <name>PowerThreshold</name>
       <relatedStateVariable>PowerThreshold</relatedStateVariable>
       <direction>in</direction>
      </argument>
  </argumentList>
</action>

<action>
  <name>GetPowerThreshold</name>
  <argumentList>
     <argument>
       <retval />
       <name>PowerThreshold</name>
       <relatedStateVariable>PowerThreshold</relatedStateVariable>
       <direction>out</direction>
      </argument>
  </argumentList>
</action>

<action>
  <name>SetPowerThreshold</name>
  <argumentList>
     <argument>
       <retval />
       <name>PowerThreshold</name>
       <relatedStateVariable>PowerThreshold</relatedStateVariable>
       <direction>in</direction>
      </argument>
  </argumentList>
</action>

<action>
  <name>ResetPowerThreshold</name>
  <argumentList>
     <argument>
       <retval />
       <name>PowerThreshold</name>
       <relatedStateVariable>PowerThreshold</relatedStateVariable>
       <direction>in</direction>
      </argument>
  </argumentList>
</action>

<action>
  <name>GetInsightInfo</name>
  <argumentList>
  <argument>
  <retval />
  <name>InsightInfo</name>
  <relatedStateVariable>InsightInfo</relatedStateVariable>
  <direction>out</direction>
  </argument>
  </argumentList>
</action>

<action>
  <name>GetInsightParams</name>
  <argumentList>
  <argument>
  <retval />
  <name>InsightParams</name>
  <relatedStateVariable>InsightParams</relatedStateVariable>
  <direction>out</direction>
  </argument>
  </argumentList>
</action>

<action>
  <name>GetONFor</name>
  <argumentList>
  <argument>
  <retval />
  <name>ONFor</name>
  <relatedStateVariable>ONFor</relatedStateVariable>
  <direction>out</direction>
  </argument>
  </argumentList>
</action>

<action>
  <name>GetInSBYSince</name>
  <argumentList>
  <argument>
  <retval />
  <name>InSBYSince</name>
  <relatedStateVariable>InSBYSince</relatedStateVariable>
  <direction>out</direction>
   </argument>
   </argumentList>
</action>


<action>
  <name>GetTodayONTime</name>
  <argumentList>
  <argument>
  <retval />
  <name>TodayONTime</name>
  <relatedStateVariable>TodayONTime</relatedStateVariable>
  <direction>outdirection>
   </argument>
   </argumentList>
</action>


<action>
  <name>GetTodaySBYTime</name>
  <argumentList>
  <argument>
  <retval />
  <name>TodaySBYTime</name>
  <relatedStateVariable>TodaySBYTime</relatedStateVariable>
  <direction>out</direction>
   </argument>
   </argumentList>
</action>
  
<action>
  <name>ScheduleDataExport</name>
  <argumentList>
     <argument>
       <retval />
       <name>EmailAddress</name>
       <relatedStateVariable>EmailAddress</relatedStateVariable>
       <direction>in</direction>
     </argument>
     <argument>
       <retval />
       <name>DataExportType</name>
       <relatedStateVariable>DataExportType</relatedStateVariable>
       <direction>in</direction>
     </argument>
  </argumentList>
</action>

<action>
  <name>GetDataExportInfo</name>
  <argumentList>
     <argument>
       <retval />
       <name>LastDataExportTS</name>
       <relatedStateVariable>LastDataExportTS</relatedStateVariable>
       <direction>out</direction>
     </argument>
     <argument>
       <retval />
       <name>DataExportType</name>
       <relatedStateVariable>DataExportType</relatedStateVariable>
       <direction>out</direction>
     </argument>
     <argument>
       <retval />
       <name>EmailAddress</name>
       <relatedStateVariable>EmailAddress</relatedStateVariable>
       <direction>out</direction>
     </argument>
  </argumentList>
</action>

</actionList>
  

  <serviceStateTable>
  
    <stateVariable sendEvents="yes">
      <name>InstantPower</name>
      <dataType>String</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>TodayKWH</name>
      <dataType>String</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>InsightInfo</name>
      <dataType>String</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>InsightParams</name>
      <dataType>String</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>TodayONTime</name>
      <dataType>String</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>InSBYSince</name>
      <dataType>String</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>ONFor</name>
      <dataType>String</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>TodaySBYTime</name>
      <dataType>String</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>PowerThreshold</name>
      <dataType>String</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>EmailAddress</name>
      <dataType>string</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>DataExportType</name>
      <dataType>string</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>
    <stateVariable sendEvents="yes">
      <name>LastDataExportTS</name>
      <dataType>string</dataType>
      <defaultValue>0</defaultValue>
    </stateVariable>

  </serviceStateTable>
  
  </scpd>

6 responses to “WeMo Insight Hacking”

  1. Did you ever get the other Insight services to work? All I can get out of them is {‘faultcode’: ‘s:Client’, ‘detail’: ‘\n’, ‘faultstring’: ‘UPnPError’}.

  2. I think field 5 might be “Total seconds of on time” (vs. field 6 which is total time the unit has been running.”

  3. I haven’t done exhaustive tests, but I’m pretty sure that field 7 is WiFi signal strength. At least it seems to always be in the the range from 0-100 and higher numbers are correlated with being closer to an access point.

  4. I figured out what all the Insight params are except for that last 8000 one. I relied heavily on a custom polling script to watch how the Insight params’ values changed in real-time, and compared my calculations of statistics using those values with the statistics given by the Wemo app.

    There are 11 fields — the breakdown in the post accidentally skipped one. Example param string:

    1|1427230660|4702|25528|82406|1209600|39|40880|15620649|54450534.000000|8000

    1. State (0 = off, 1 = on)
    2. Unix timestamp of last time it changed state (If currently on, when it was turned on. If currently off, last time it was on.)
    3. Seconds it has been on since getting turned on (0 if off)
    4. Seconds it has been on today
    5. Number of seconds it has been on over the past two weeks. Verified against the Wemo app’s average time on per day calculation and average instantaneous power calculation.
    6. Was constant between different devices I saw — always 1209600. This is two weeks in seconds. Specifies the time window for average time on per day and average instantaneous power calculations.
    7. Average power (W)
    8. Instantaneous power (mW)
    9. Energy used today in mW-minutes
    10. Energy used over past two weeks in mW-minutes. Verified against the Wemo app’s reported average instantaneous power.
    11. Unknown

    I just went through a firmware update last night, so this is based on the most recent behavior to-date.

  5. Hi,

    Your missing a state (the first field)

    It can also read 8 which signifies that the socket is on, but not drawing more than it’s threshold power level

Leave a Reply

Your email address will not be published.