node-red-contrib-3dm-space 0.0.8 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,236 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType("3dm-config-store", {
3
+ category: "3DM.space",
4
+ color: "#6D6D6D",
5
+ defaults: {
6
+ name: { value: "" },
7
+ configName: { value: "" },
8
+ tickSeconds: {
9
+ value: 20,
10
+ validate: function (v) {
11
+ var n = Number(v);
12
+ return !isNaN(n) && n >= 1 && n <= 60;
13
+ }
14
+ },
15
+ outputMode: { value: "change" },
16
+ configOutput: { value: 0 },
17
+ emitConfigOnUpdate: { value: false }
18
+ },
19
+ inputs: 1,
20
+ outputs: 24,
21
+ icon: "font-awesome/fa-database",
22
+ label: function () {
23
+ return this.name || "3DM config store";
24
+ },
25
+ paletteLabel: "3DM config store",
26
+ outputLabels: function (index) {
27
+ return "Output " + (index + 1);
28
+ }
29
+ });
30
+ </script>
31
+
32
+ <script type="text/html" data-template-name="3dm-config-store">
33
+ <div class="form-row">
34
+ <label for="node-input-name">
35
+ <i class="fa fa-tag"></i> Node Name
36
+ </label>
37
+ <input type="text" id="node-input-name" placeholder="Optional, e.g. Pump Config Store">
38
+ </div>
39
+
40
+ <div class="form-row">
41
+ <label for="node-input-configName">
42
+ <i class="fa fa-folder-open"></i> Config Name
43
+ </label>
44
+ <input type="text" id="node-input-configName" placeholder="Optional, e.g. mainScheduler">
45
+ </div>
46
+
47
+ <div class="form-row">
48
+ <label for="node-input-tickSeconds">
49
+ <i class="fa fa-clock-o"></i> Check Every
50
+ </label>
51
+ <input type="number" id="node-input-tickSeconds" min="1" max="60" placeholder="20" style="width:100px;">
52
+ <span> seconds</span>
53
+ </div>
54
+
55
+ <div class="form-row">
56
+ <label for="node-input-outputMode">
57
+ <i class="fa fa-sign-out"></i> Output Mode
58
+ </label>
59
+ <select id="node-input-outputMode" style="width:70%;">
60
+ <option value="change">Only when output changes</option>
61
+ <option value="always">Every check</option>
62
+ </select>
63
+ </div>
64
+
65
+ <div class="form-row">
66
+ <label for="node-input-configOutput">
67
+ <i class="fa fa-share-square-o"></i> Config Output
68
+ </label>
69
+ <select id="node-input-configOutput" style="width:70%;">
70
+ <option value="0">Disabled</option>
71
+ <option value="1">Output 1</option>
72
+ <option value="2">Output 2</option>
73
+ <option value="3">Output 3</option>
74
+ <option value="4">Output 4</option>
75
+ <option value="5">Output 5</option>
76
+ <option value="6">Output 6</option>
77
+ <option value="7">Output 7</option>
78
+ <option value="8">Output 8</option>
79
+ <option value="9">Output 9</option>
80
+ <option value="10">Output 10</option>
81
+ <option value="11">Output 11</option>
82
+ <option value="12">Output 12</option>
83
+ <option value="13">Output 13</option>
84
+ <option value="14">Output 14</option>
85
+ <option value="15">Output 15</option>
86
+ <option value="16">Output 16</option>
87
+ <option value="17">Output 17</option>
88
+ <option value="18">Output 18</option>
89
+ <option value="19">Output 19</option>
90
+ <option value="20">Output 20</option>
91
+ <option value="21">Output 21</option>
92
+ <option value="22">Output 22</option>
93
+ <option value="23">Output 23</option>
94
+ <option value="24">Output 24</option>
95
+ </select>
96
+ </div>
97
+
98
+ <div class="form-row">
99
+ <label for="node-input-emitConfigOnUpdate">
100
+ <i class="fa fa-refresh"></i> Send Config
101
+ </label>
102
+ <input type="checkbox" id="node-input-emitConfigOnUpdate" style="display:inline-block; width:auto; vertical-align:top;">
103
+ <span> send stored config when updated</span>
104
+ </div>
105
+
106
+ <div class="form-tips">
107
+ <b>Tip:</b> Leave Config Name blank to allow this node to store and use all config blocks sent under <code>configStore</code>.
108
+ </div>
109
+ </script>
110
+
111
+ <script type="text/html" data-help-name="3dm-config-store">
112
+ <p>
113
+ Stores configuration sent from 3DM.space and runs local schedule/control logic.
114
+ </p>
115
+
116
+ <p>
117
+ This node is normally placed after a <b>3DM In</b> node.
118
+ </p>
119
+
120
+ <pre>3DM In → 3DM Config Store → 24 outputs</pre>
121
+
122
+ <h3>Config Store Format</h3>
123
+
124
+ <p>
125
+ Incoming messages should contain a main <code>configStore</code> object.
126
+ Each config block inside it should have its own name.
127
+ </p>
128
+
129
+ <pre>{
130
+ "configStore": {
131
+ "mainScheduler": {
132
+ "type": "scheduler",
133
+ "data": []
134
+ },
135
+ "pumpSetpoints": {
136
+ "type": "setpoints",
137
+ "data": {
138
+ "startLevel": 30,
139
+ "stopLevel": 80
140
+ }
141
+ }
142
+ }
143
+ }</pre>
144
+
145
+ <h3>Scheduler Config</h3>
146
+
147
+ <p>
148
+ Scheduler blocks use <code>type: "scheduler"</code>.
149
+ </p>
150
+
151
+ <pre>{
152
+ "configStore": {
153
+ "mainScheduler": {
154
+ "type": "scheduler",
155
+ "data": [
156
+ {
157
+ "name": "Pump 1 Morning Run",
158
+ "output": "output1",
159
+ "controlType": "schedule",
160
+ "mode": "Auto Schedule",
161
+ "days": ["mon", "tue", "wed", "thu", "fri"],
162
+ "startHour": 6,
163
+ "startMinute": 0,
164
+ "runHour": 1,
165
+ "runMinute": 30
166
+ }
167
+ ]
168
+ }
169
+ }
170
+ }</pre>
171
+
172
+ <h3>Control Config</h3>
173
+
174
+ <p>
175
+ Control entries can use live input values and stored setpoints.
176
+ </p>
177
+
178
+ <pre>{
179
+ "name": "Tank Level Control",
180
+ "output": "output1",
181
+ "controlType": "control",
182
+ "mode": "AUTO",
183
+ "variable": "tank_level",
184
+ "lowSetpointKey": "pumpSetpoints.data.startLevel",
185
+ "highSetpointKey": "pumpSetpoints.data.stopLevel",
186
+ "direction": "in"
187
+ }</pre>
188
+
189
+ <h3>Config Name</h3>
190
+
191
+ <p>
192
+ Leave <b>Config Name</b> blank to allow all config blocks.
193
+ </p>
194
+
195
+ <p>
196
+ Enter a name such as <code>mainScheduler</code> if this node should only use one config block.
197
+ </p>
198
+
199
+ <h3>Outputs</h3>
200
+
201
+ <p>
202
+ The node has 24 outputs.
203
+ </p>
204
+
205
+ <p>
206
+ Scheduler and control items use output names such as:
207
+ </p>
208
+
209
+ <pre>output1
210
+ output2
211
+ output3</pre>
212
+
213
+ <p>
214
+ If multiple schedule/control entries use the same output, they are combined using OR logic.
215
+ If any entry wants the output ON, the final output is ON.
216
+ </p>
217
+
218
+ <h3>Local Storage</h3>
219
+
220
+ <p>
221
+ Config is saved locally on the gateway. If Node-RED restarts, the last saved config is loaded again.
222
+ </p>
223
+
224
+ <h3>Output Mode</h3>
225
+
226
+ <ul>
227
+ <li><b>Only when output changes</b>: sends an output only when the final state changes.</li>
228
+ <li><b>Every check</b>: sends outputs every check cycle.</li>
229
+ </ul>
230
+
231
+ <h3>Config Output</h3>
232
+
233
+ <p>
234
+ Optional. Select an output if you want the full stored config sent out as a message.
235
+ </p>
236
+ </script>