-
Notifications
You must be signed in to change notification settings - Fork 12
/
maxcube.html
executable file
·104 lines (95 loc) · 2.76 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
<script type="text/javascript">
RED.nodes.registerType('maxcube in',{
category: 'output',
color: '#F3B567',
defaults: {
server: { value: '', type: 'maxcube-server' }
},
inputs: 1,
outputs: 0,
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' }
},
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>
</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": "0abc12",
"initialized": true,
"fromCmd": false,
"error": false,
"valid": true,
"mode": "MANUAL",
"dst_active": true,
"gateway_known": true,
"panel_locked": false,
"link_error": false,
"battery_low": false,
"valve": 0,
"setpoint": 5,
"temp": 15.4
}</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() }
},
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>
</script>