forked from makermusings/fauxmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protocol_notes.txt
executable file
·99 lines (82 loc) · 2.81 KB
/
protocol_notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
This is the sequence of network traffic that takes place when the Amazon Echo
discovers Belkin WeMo devices and then is asked to turn on one of the
devices.
For a more complete explanation of how this works, see
http://www.makermusings.com/2015/07/13/amazon-echo-and-home-automation/
### This is what the Amazon Echo sends to discover WeMo devices
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
MX: 15
ST: urn:Belkin:device:**
### This is the reply the Amazon Echo asks for
HTTP/1.1 200 OK ## copy
CACHE-CONTROL: max-age=86400
DATE: Mon, 22 Jun 2015 17:24:01 GMT
EXT:
LOCATION: http://192.168.5.190:49153/setup.xml
OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS: 905bfa3c-1dd2-11b2-8928-fd8aebaf491c
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: redsonic
ST: urn:Belkin:device:**
USN: uuid:Socket-1_0-221517K0101769::urn:Belkin:device:**
### Then this is what the Amazon Echo sends to get the Wemo device info
GET /setup.xml HTTP/1.1
Host: 192.168.5.189:49153
Accept: */*
### This is the reply to the request for setup.xml
### Most of the XML has not been reproduced here and turns
### out not to be needed to interface with the Amazon Echo
HTTP/1.1 200 OK
CONTENT-LENGTH: 5436
CONTENT-TYPE: text/xml
DATE: Mon, 22 Jun 2015 22:34:59 GMT
LAST-MODIFIED: Sat, 01 Jan 2000 00:01:15 GMT
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: redsonic
CONNECTION: close
<?xml version="1.0"?>
<root xmlns="urn:Belkin:device-1-0">
.
.
.
<device>
<deviceType>urn:Belkin:device:controllee:1</deviceType>
<friendlyName>kitchen lights</friendlyName>
<manufacturer>Belkin International Inc.</manufacturer>
.
.
.
<modelName>Socket</modelName>
<modelNumber>1.0</modelNumber>
.
.
.
<UDN>uuid:Socket-1_0-221517K0101769</UDN>
.
. ### and lots of other stuff that is not reproduced here
.
</device>
</root>
### Turn on request:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.5.189:49153
Accept: */*
Content-type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#SetBinaryState"
Content-Length: 299
<?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>
### Turn on response:
HTTP/1.1 200 OK
CONTENT-LENGTH: 295
CONTENT-TYPE: text/xml; charset="utf-8"
DATE: Mon, 22 Jun 2015 22:45:57 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:SetBinaryStateResponse xmlns:u="urn:Belkin:service:basicevent:1">
<CountdownEndTime>0</CountdownEndTime>
</u:SetBinaryStateResponse>
</s:Body> </s:Envelope>