I have Holmes WeMo humidifier that I would like to be able to control with ST. I am not a programmer and would appreciate it if anyone can help me! Thanks!
I took a crack at it a while ago and it looks like their UPnP implementation just plain doesnāt work. The only way to control it is via the WeMo app.
Thank you for the response!
I canāt even find references to an api for the humidifier. What did you turn up?
It looked like the exact same implementation as on the Crock Pot, only it didnāt work. It even had methods with ācrockpotā in their names.
I think I figured this outā¦ I used a packet sniffer and got the following when setting fan to āMINā valueā¦
POST /upnp/control/deviceevent1 HTTP/1.0
Content-Type: text/xml; charset="utf-8"
HOST: 192.168.1.74
Content-Length: 1052
SOAPACTION: "urn:Belkin:service:deviceevent:1#SetAttributes"
Connection: close
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:SetAttributes xmlns:u="urn:Belkin:service:deviceevent:1">
<attributeList><attribute><name>FanMode</name><value>1</value></attribute><attribute><name>DesiredHumidity</name><value>NULL</value></attribute><attribute><name>CurrentHumidity</name><value>NULL</value></attribute><attribute><name>WaterAdvise</name><value>NULL</value></attribute><attribute><name>NoWater</name><value>NULL</value></attribute><attribute><name>FilterLife</name><value>NULL</value></attribute><attribute><name>ExpiredFilterTime</name><value>NULL</value></attribute></attributeList>
</u:SetAttributes>
</s:Body>
</s:Envelope>
And the following response:
HTTP/1.0 200 OK
CONTENT-LENGTH: 288
CONTENT-TYPE: text/xml; charset="utf-8"
DATE: Tue, 08 Dec 2015 04:14:21 GMT
EXT:
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: redsonic
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:SetAttributesResponse xmlns:u="urn:Belkin:service:deviceevent:1">
<attributeList>0</attributeList>
</u:SetAttributesResponse>
</s:Body> </s:Envelope>
interestingly enough, if I paste the text inside the āattributeListā tag here and donāt make it āpreformatted textā I get something more readable since the above code has XML entity references.
<attribute><name>FanMode</name><value>1</value></attribute>
<attribute><name>DesiredHumidity</name><value>NULL</value></attribute>
<attribute><name>CurrentHumidity</name><value>NULL</value></attribute>
<attribute><name>WaterAdvise</name><value>NULL</value></attribute>
<attribute><name>NoWater</name><value>NULL</value></attribute>
<attribute><name>FilterLife</name><value>NULL</value></attribute>
<attribute><name>ExpiredFilterTime</name><value>NULL</value></attribute>
So I guess to extrapolateā¦ to set Fan mode, you pick a value 1-5 (MIN-MAX), and all other values to NULL.
to set humidityā¦ desired humidity is 0-5 (45%,50%,55%,60%,Max%)
Alsoā¦ to turn the unit āOFFā you set the FanMode to 0 (which would make sense) and this shows as power off on the WeMo app.
Interesting. Iām pretty sure this stuff wasnāt there when I looked at it way back when. I guess one of the firmware updates over the last year came with some updates for this as well.
Alright guys, the OP was looking for a guide on how to implement this for a non-technical type. Is there a link that could be used to get started based on the above?
Well this explains why I couldnāt take my code for the WeMo crockpot and modify it to work with the humidifier
I had tried to help @btk get his to work like 6 months back.
hereās what my crockpot command looks like when sent via curl
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:SetCrockpotState xmlns:u="urn:Belkin:service:basicevent:1">
<mode>50</mode>
<time>0</time>
</u:SetCrockpotState>
</s:Body>
</s:Envelope>
Hereās how I send the command
def bodyMap = [mode:ā50ā,time:ā0ā]
sendCommand(ā/upnp/control/basicevent1ā,āurn:Belkin:service:basicevent:1ā,āSetCrockpotStateā,bodyMap)
def sendCommand(path,urn,action,body){
log.debug "Send command called with path: ${path} , urn: ${urn}, action: ${action} , body: ${body}"
def result = new physicalgraph.device.HubSoapAction(
path: path,
urn: urn,
action: action,
body: body,
headers: [Host:getHostAddress(), CONNEC`TION: "close"]
)
return result
}
looks like you could use my function and call it like this
def bodyMap = [attributelist:āFULL_ATTRIBUTE_LIST_STRINGā]
sendCommand(ā/upnp/control/deviceevent1ā,āurn:Belkin:service:deviceevent:1ā,āSetAttributesā,bodyMap)
Oh and if you havenāt seen it, IFTTT has added support for a bunch of new WeMo devices
Just got the wemo humidifier today. Any thoughts on if it has to be added as a custom hardware device, then an app written for it? Iām comfortable with the St ide and can help out if anyone had some starter coffee to test out. Thanks!
Itāll require a custom SmartApp which will discover and then install a custom device type. Now that we have a better understanding of how the command is formatted, we should be able to get it working.
While other devices have used
<attributeName>AttributeValue</attributeName>
The Humidifier uses
<attribute><name>attributeName</name><value>attributeValue</value></attribute>
My WeMo Crockpot code should give someone a good starting point. I know @btk tried to get his connected before, but the issue we now know is that the command is structured a little differently then other devices
Iāve recently cleaned up my device handler and it should be easier to understand how itās working and modify compared to my earlier version that I tried to help @btk use.
Also as a reference, hereās the docs on LAN connected devices that may help
thanks for the detail! Iāll take a stab at it and see if I can figure it out using your crockpot code as the base. Thank you!
Would you be willing to share your code? I can test it out on mine and see what errrors, port changes I get. Thx!
Itās alive!
Iāve confirmed @btk code works as expted with some UI hiccups out of our control. Good work to everyone here!