forked from maxill1/node-red-contrib-maxcube2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
maxcube.html
executable file
·257 lines (242 loc) · 7.41 KB
/
maxcube.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
256
257
<script type="text/javascript">
RED.nodes.registerType('maxcube in',{
category: 'output',
color: '#F3B567',
defaults: {
server: { value: '', type: 'maxcube-server' }
},
inputs: 1,
outputs: 1,
icon: 'bridge.png',
label: function() {
return this.name || 'Maxcube';
},
align: 'right'
});
</script>
<script type="text/x-red" data-template-name="maxcube in">
<div class="form-row">
<label for="node-input-server"><i class="icon-tag"></i> Server</label>
<input type="text" id="node-input-server">
</div>
</script>
<script type="text/x-red" data-help-name="maxcube in">
<p>A node to control the eQ-3 Max! Cube</p>
<p>Accepts messages with payload of type object with following structure:
<pre>{
"rf_address": "0abc12",
"degrees": 20,
"mode": "MANUAL"
}</pre>
</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('maxcube out',{
category: 'input',
color: '#F3B567',
defaults: {
server: { value: '', type: 'maxcube-server' },
singleMessage : { value: false, required: false }
},
inputs: 1,
outputs: 1,
icon: 'bridge.png',
label: function() {
return this.name || 'Maxcube';
},
align: 'left'
});
</script>
<script type="text/x-red" data-template-name="maxcube out">
<div class="form-row">
<label for="node-input-server"><i class="icon-tag"></i> Server</label>
<input type="text" id="node-input-server">
</div>
<div class="form-row">
<label for="node-input-singleMessage"><i class="icon-file"></i></label>
<input type="checkbox" id="node-input-singleMessage" style="display:inline-block; width:15px; vertical-align:baseline;"> Output to single message
</div>
<div class="form-tips">
<span<b>Note:</b> If "Output to single message" is checked the node will send only one message containing all devices requested data</span>
</div>
</script>
<script type="text/x-red" data-help-name="maxcube out">
<p>A node to query the eQ-3 Max! Cube</p>
<p>Whenever an input is received, device status is updated from the Maxcube, and sent as separate messages (one for each device) of form:
<pre>{
"rf_address": "1709d7",
"initialized": true,
"fromCmd": false,
"error": false,
"valid": true,
"mode": "AUTO",
"dst_active": true,
"gateway_known": true,
"panel_locked": false,
"link_error": false,
"battery_low": false,
"valve": 0,
"setpoint": 17,
"temp": 0,
"device_type": 1,
"device_name": "Termosifone Sala TV",
"room_name": "Piano terra",
"room_id": 1
}</pre>
</p>
<p>or sent as single message of form:
<pre>
{
"1709d7": {
"rf_address": "1709d7",
"initialized": true,
"fromCmd": false,
"error": false,
"valid": true,
"mode": "AUTO",
"dst_active": true,
"gateway_known": true,
"panel_locked": false,
"link_error": false,
"battery_low": false,
"valve": 0,
"setpoint": 17,
"temp": 0,
"device_type": 1,
"device_name": "Termosifone Sala TV",
"room_name": "Piano terra",
"room_id": 1
},
"18eb18": {
"rf_address": "18eb18",
"initialized": true,
"fromCmd": false,
"error": false,
"valid": true,
"mode": "AUTO",
"dst_active": true,
"gateway_known": true,
"panel_locked": false,
"link_error": false,
"battery_low": false,
"valve": 4,
"setpoint": 17
"temp": 27.2,
"device_type": 3,
"device_name": "Termostato a parete",
"room_name": "Piano terra",
"room_id": 1
}
"0a1d0e": {
"rf_address": "0a1d0e",
"open": false,
"device_type": 5,
"device_name": "Pulsante Eco"
}
}
</pre></p>
</script>
<script type="text/javascript">
RED.nodes.registerType('maxcube device config',{
category: 'input',
color: '#F3B567',
defaults: {
server: { value: '', type: 'maxcube-server' },
singleMessage : { value: false, required: false }
},
inputs: 1,
outputs: 1,
icon: 'bridge.png',
label: function() {
return this.name || 'Maxcube configuration';
},
align: 'left'
});
</script>
<script type="text/x-red" data-template-name="maxcube device config">
<div class="form-row">
<label for="node-input-server"><i class="icon-tag"></i> Server</label>
<input type="text" id="node-input-server">
</div>
<div class="form-row">
<label for="node-input-singleMessage"><i class="icon-file"></i></label>
<input type="checkbox" id="node-input-singleMessage" style="display:inline-block; width:15px; vertical-align:baseline;"> Output to single message
</div>
<div class="form-tips">
<span<b>Note:</b> If "Output to single message" is checked the node will send only one message containing all devices requested data</span>
</div>
</script>
<script type="text/x-red" data-help-name="maxcube device config">
<p>A node to query the eQ-3 Max! Cube devices configuration</p>
<p>Whenever an input is received, devices configuration is updated from the Maxcube, and sent as separate messages (one for each device) of form:
<pre>
{
"rf_address":"18b444",
"device_type":1,
"serial_number":"OEQ1131666",
"comfort_temp":21.5,
"eco_temp":16.5,
"max_setpoint_temp":30,
"min_setpoint_temp":4.5,
"temp_offset":0,
"max_valve":100
}
</pre>
</p>
<p>or sent as single message of form:
<pre>
<pre>
{
"18b444":{
"rf_address":"18b444",
"device_type":1,
"serial_number":"OEQ1131666",
"comfort_temp":21.5,
"eco_temp":16.5,
"max_setpoint_temp":30,
"min_setpoint_temp":4.5,
"temp_offset":0,
"max_valve":100
},
"1709a1":{
"rf_address":"1709a1",
"device_type":1,
"serial_number":"NKF0004984",
"comfort_temp":21.5,
"eco_temp":16.5,
"max_setpoint_temp":30,
"min_setpoint_temp":4.5,
"temp_offset":0,
"max_valve":100
}
}
</pre>
</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('maxcube-server',{
category: 'config',
defaults: {
host: { value:'', required: true },
port: { value: 62910, required: true, validate: RED.validators.number() },
disabled: { value: true, required: false }
},
label: function() {
return this.host + ':' + this.port ;
}
});
</script>
<script type="text/x-red" data-template-name="maxcube-server">
<div class="form-row">
<label for="node-config-input-host"><i class="icon-tag"></i> Host</label>
<input type="text" id="node-config-input-host" placeholder="host">
</div>
<div class="form-row">
<label for="node-config-input-port"><i class="icon-tag"></i> Port</label>
<input type="text" id="node-config-input-port" placeholder="port">
</div>
<div class="form-row">
<label for="node-config-input-disabled"><i class="icon-pause"></i> Disabled</label>
<input type="checkbox" id="node-config-input-disabled" >
</div>
</script>