forked from biddster/node-red-contrib-wemo-emulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
202 lines (189 loc) · 7.47 KB
/
index.html
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!--
The MIT License (MIT)
Copyright (c) 2016 @biddster
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<script type="text/javascript">
RED.nodes.registerType('wemo-emulator', {
category: 'input',
color: '#f37a33',
defaults: {
name: {
value: ''
},
friendlyName: {
value: ''
},
serial: {
value: ''
},
port: {
value: ''
},
onTopic: {
value: ''
},
onPayload: {
value: ''
},
offTopic: {
value: ''
},
offPayload: {
value: ''
}
},
inputs: 0,
outputs: 1,
icon: 'wemo.png',
label: function () {
return this.name || 'wemo-emulator';
},
paletteLabel: 'wemo emu',
align: 'left'
});
</script>
<script type="text/x-red" data-template-name="wemo-emulator">
<div class="form-row">
<label for="node-input-name">
<i class="icon-tag"></i>Node Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<hr>
<div class="form-row">
<label for="node-input-friendlyName">
<i class="icon-tag"></i>Friendly Name *</label>
<input type="text" id="node-input-friendlyName" placeholder="Friendly Name">
</div>
<div class="form-row">
<label for="node-input-serial">
<i class="fa fa-globe"></i> Unique ID *</label>
<input type="text" id="node-input-serial" placeholder="Unique ID">
</div>
<div class="form-row">
<label for="node-input-port">
<i class="fa fa-globe"></i> Port *</label>
<input type="text" id="node-input-port" placeholder="Port">
</div>
<hr>
<div class="form-row">
<label for="node-input-onTopic">
<i class="icon-tag"></i>On Topic</label>
<input type="text" id="node-input-onTopic" placeholder="">
</div>
<div class="form-row">
<label for="node-input-onPayload">
<i class="icon-tag"></i>On Payload</label>
<input type="text" id="node-input-onPayload" placeholder="">
</div>
<hr>
<div class="form-row">
<label for="node-input-offTopic">
<i class="icon-tag"></i>Off Topic</label>
<input type="text" id="node-input-offTopic" placeholder="">
</div>
<div class="form-row">
<label for="node-input-offPayload">
<i class="icon-tag"></i>Off Payload</label>
<input type="text" id="node-input-offPayload" placeholder="">
</div>
</script>
<script type="text/x-red" data-help-name="wemo-emulator">
<h1>Wemo Emulator</h1>
<p> Why might you want to emulate Wemo? Well I wanted to be able to control my Node-RED Raspberry Pi using my Amazon Echo.
The Echo has Wemo support built in so I thought I'd give it a try.
<p>
<p>
It's pretty cool to be able to say 'Alexa, turn my garden watering system on' and my Pi turns on the outdoor watering system.
</p>
<p>
This Node-RED node is only a slim wrapper around the marvellous [wemore](https://github.com/dhleong/wemore) Wemo library
written by Daniel Leong.
</p>
<h2>Configuration</h2>
<p>
Drag the node on to your workspace, configure it as below and then ask Alexa to discover devices.
</p>
<table>
<thead>
<tr>
<th>Config</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code>Node Name</code>
</td>
<td>This is the name of the node as it appears in the Node-RED workspace</td>
</tr>
<tr>
<td>
<code>Friendly Name</code>
</td>
<td>This is the name that you'll see in the list of devices known to Alexa, it's also the name that you
use in voice commands</td>
</tr>
<tr>
<td>
<code>Unique ID</code>
</td>
<td>This ID should be unique across all the wemo-emulator nodes in your workspace</td>
</tr>
<tr>
<td>
<code>Port</code>
</td>
<td>Wemore can automatically select a port to listen on, but it is recommended that you enter a unique
port and increment it for each wemo emulator node you add to your workspace. This ensures that
the port never changes.</td>
</tr>
<tr>
<td>
<code>On Topic</code>
</td>
<td>This is the topic sent when you ask Alexa to turn your thing on</td>
</tr>
<tr>
<td>
<code>On Payload</code>
</td>
<td>This is the payload sent when you ask Alexa to turn your thing on</td>
</tr>
<tr>
<td>
<code>Off Topic</code>
</td>
<td>This is the topic sent when you ask Alexa to turn your thing off</td>
</tr>
<tr>
<td>
<code>Off Payload</code>
</td>
<td>This is the payload sent when you ask Alexa to turn your thing off</td>
</tr>
</tbody>
</table>
<h2>Troubleshooting</h2>
If Alexa can't discover the devices emulated by this node, please check you don't have a firewall blocking the following
ports:
<ul>
<li>1900/udp</li>
<li>You must also open the ports for all of the wemo emulator nodes configured.</li>
</ul>
</script>