-
Notifications
You must be signed in to change notification settings - Fork 42
/
index.html
255 lines (204 loc) · 9.11 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<script type="text/javascript">
RED.nodes.registerType('amazon-echo-hub', {
category: "input",
color: "#31C4F3",
defaults: {
port: {
value: "80",
required: true,
validate: function(port) {
return port > 0 && port < 65536;
}
},
processinput: {
value: 0
},
discovery: {
value: true
}
},
inputs: 1,
outputs: 1,
icon: "amazon-echo-hub.png",
label: function() {
return "Amazon Echo Hub";
}
});
</script>
<script type="text/x-red" data-template-name="amazon-echo-hub">
<style media="screen">
.form-row label {
width: 140px;
}
.form-row input,
.form-row select {
width: 260px;
}
</style>
<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="80">
</div>
<div class="form-row">
<label for="node-input-processinput"><i class="fa fa-tag"></i> Process Input</label>
<select class="form-control" id="node-input-processinput">
<option value="0">No</option>
<option value="1">Process</option>
<option value="2">Process and output</option>
<option value="3">Process and output on state change</option>
</select>
</div>
<div class="form-row">
<label for="node-input-discovery"><i class="fa fa-search"></i> Device discovery</label>
<input type="checkbox" id="node-input-discovery">
</div>
<div class="form-tips">
Tips:
<p>
<ul>
<li>Set port to <strong>80</strong> if you have latest generation Amazon Echo devices.</li>
<li>Set process input if you want to send signal to Amazon Echo Hub.</li>
</ul>
</p>
</div>
</script>
<script type="text/x-red" data-help-name="amazon-echo-hub">
<p>Amazon Echo Hub</p>
<h3>Inputs</h3>
Enable input processing to allow input payload signals
<dl class="message-properties">
<dt>payload <span class="property-type">string | buffer</span></dt>
<dd> the payload of the message to publish</dd>
<dt>payload.nodeid <span class="property-type">string</span></dt>
<dd>Node ID is Amazon Echo Device Node ID</dd>
<dt>payload.nodename <span class="property-type">string</span></dt>
<dd>Node Name is Amazon Echo Device Node Name. If payload.nodeid is set, it will be used instead</dd>
<dt>payload.on <span class="property-type">boolean</span></dt>
<dd>On state of the light (on - true, off - false)</dd>
<dt>payload.bri <span class="property-type">number</span></dt>
<dd>Brightness of the light (min 1, max 254)</dd>
<dt>payload.hue <span class="property-type">number</span></dt>
<dd>Hue of the light (min 0, max 65535)</dd>
<dt>payload.sat <span class="property-type">number</span></dt>
<dd>Saturation of the light (min 0, max 65535)</dd>
<dt>payload.ct <span class="property-type">string</span></dt>
<dd>The mired color temperature of the light (min 153, max 500)</dd>
<dt>payload.xy <span class="property-type">array</span></dt>
<dd>The x and y coordinates of a color in CIE color space (Both x and y are between 0 and 1)</dd>
<dt>payload.rgb <span class="property-type">array</span></dt>
<dd>The light color in RGB format</dd>
<dt>payload.colormode <span class="property-type">string</span></dt>
<dd>Indicates the color mode (ct - Color Temperature | hs - Hue and Saturation)</dd>
</dl>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">string</span></dt>
<dd>State of the light (on, off)</dd>
<dt>on <span class="property-type">boolean</span></dt>
<dd>On state of the light (on - true, off - false)</dd>
<dt>bri <span class="property-type">number</span></dt>
<dd>Brightness of the light (min 1, max 254)</dd>
<dt>hue <span class="property-type">number</span></dt>
<dd>Hue of the light (min 0, max 65535)</dd>
<dt>sat <span class="property-type">number</span></dt>
<dd>Saturation of the light (min 0, max 254)</dd>
<dt>ct <span class="property-type">string</span></dt>
<dd>The mired color temperature of the light (min 153, max 500)</dd>
<dt>xy <span class="property-type">array</span></dt>
<dd>The x and y coordinates of a color in CIE color space (Both x and y are between 0 and 1)</dd>
<dt>rgb <span class="property-type">array</span></dt>
<dd>The light color in RGB format</dd>
<dt>colormode <span class="property-type">string</span></dt>
<dd>Indicates the color mode (ct - Color Temperature | hs - Hue and Saturation)</dd>
<dt>percentage <span class="property-type">number</span></dt>
<dd>The brightness % level (min 1, max 100)</dd>
<dt>meta <span class="property-type">array</span></dt>
<dd>Meta data hashmap</dd>
<dt>meta.insert.by <span class="property-type">string</span></dt>
<dd>The insert type (alexa | input)</dd>
<dt>meta.insert.date <span class="property-type">string</span></dt>
<dd>The insert date and time</dd>
<dt>meta.insert.details.ip <span class="property-type">string</span></dt>
<dd>Alexa master device IP address.<br/>Only if <b>meta.insert.by</b>=<i>alexa</i></li></dd>
<dt>meta.insert.details.user_agent <span class="property-type">string</span></dt>
<dd>Alexa master device user agent.<br/>Only if <b>meta.insert.by</b>=<i>alexa</i></dd>
<dt>meta.input <span class="property-type">array</span></dt>
<dd>Hashmap with all input attributes</dd>
<dt>meta.changes <span class="property-type">array</span></dt>
<dd>Hashmap of all changed attributes and the corresponding old values</dd>
</dl>
</script>
<script type="text/javascript">
RED.nodes.registerType('amazon-echo-device', {
category: "input",
color: "#31C4F3",
defaults: {
name: {
value: "",
required: true
},
topic: {
value: "",
required: false
},
},
inputs: 1,
outputs: 1,
icon: "amazon-echo-device.png",
label: function() {
return this.name || "Amazon Echo Device";
}
});
</script>
<script type="text/x-red" data-template-name="amazon-echo-device">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Bedroom light">
</div>
<div class="form-tips">Alexa uses this <strong>Name</strong> to indentify your device by voice. This has to be unique for each device. If you have renamed your device, please ask Alexa to discover again.</div>
<p></p>
<div class="form-row">
<label for="node-input-topic"><i class="fa fa-tasks"></i> Topic</label>
<input type="text" id="node-input-topic">
</div>
</script>
<script type="text/x-red" data-help-name="amazon-echo-device">
<p>Amazon Echo Device</p>
<h3>Outputs</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">string</span></dt>
<dd>On state of the light (on - true, off - false)</dd>
<dt>on <span class="property-type">boolean</span></dt>
<dd>On/Off state of the light</dd>
<dt>bri <span class="property-type">number</span></dt>
<dd>Brightness of the light (min 1, max 254)</dd>
<dt>hue <span class="property-type">number</span></dt>
<dd>Hue of the light (min 0, max 65535)</dd>
<dt>sat <span class="property-type">number</span></dt>
<dd>Saturation of the light (min 0, max 254)</dd>
<dt>ct <span class="property-type">string</span></dt>
<dd>The mired color temperature of the light (min 153, max 500)</dd>
<dt>xy <span class="property-type">array</span></dt>
<dd>The x and y coordinates of a color in CIE color space (Both x and y are between 0 and 1)</dd>
<dt>rgb <span class="property-type">array</span></dt>
<dd>The light color in RGB format</dd>
<dt>colormode <span class="property-type">string</span></dt>
<dd>Indicates the color mode (ct - Color Temperature | hs - Hue and Saturation)</dd>
<dt>percentage <span class="property-type">number</span></dt>
<dd>The brightness % level (min 1, max 100)</dd>
<dt>meta <span class="property-type">array</span></dt>
<dd>Meta data hashmap</dd>
<dt>meta.insert.by <span class="property-type">string</span></dt>
<dd>The insert type (alexa | input)</dd>
<dt>meta.insert.date <span class="property-type">string</span></dt>
<dd>The insert date and time</dd>
<dt>meta.insert.details.ip <span class="property-type">string</span></dt>
<dd>Alexa master device IP address.<br/>Only if <b>meta.insert.by</b>=<i>alexa</i></li></dd>
<dt>meta.insert.details.user_agent <span class="property-type">string</span></dt>
<dd>Alexa master device user agent.<br/>Only if <b>meta.insert.by</b>=<i>alexa</i></dd>
<dt>meta.input <span class="property-type">array</span></dt>
<dd>Hashmap with all input attributes</dd>
<dt>meta.changes <span class="property-type">array</span></dt>
<dd>Hashmap of all changed attributes and the corresponding old values</dd>
</dl>
</script>