Skip to content

Instantly share code, notes, and snippets.

@mrinalwadhwa
Last active October 16, 2021 20:51
Show Gist options
  • Save mrinalwadhwa/475ad9481e80ae66a81512db38b4dafb to your computer and use it in GitHub Desktop.
Save mrinalwadhwa/475ad9481e80ae66a81512db38b4dafb to your computer and use it in GitHub Desktop.
curl wemo connected switch
curl -0 -v -X POST http://wemo:49153/upnp/control/basicevent1 -H 'SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"' -H 'Content-Type: text/xml; charset=utf-8' -d @- << EOF
<?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:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1" />
</s:Body>
</s:Envelope>
EOF
curl -0 -v -X POST http://wemo:49153/upnp/control/basicevent1 -H 'SOAPACTION: "urn:Belkin:service:basicevent:1#SetBinaryState"' -H 'Content-Type: text/xml; charset=utf-8' -d @- << EOF
<?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:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">
<BinaryState>0</BinaryState>
</u:SetBinaryState>
</s:Body>
</s:Envelope>
EOF
curl -0 -v -X POST http://wemo:49153/upnp/control/basicevent1 -H 'SOAPACTION: "urn:Belkin:service:basicevent:1#SetBinaryState"' -H 'Content-Type: text/xml; charset=utf-8' -d @- << EOF
<?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:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">
<BinaryState>1</BinaryState>
</u:SetBinaryState>
</s:Body>
</s:Envelope>
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment