nodejs-poolcontroller 7.6.1 → 7.7.0

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.
Files changed (91) hide show
  1. package/.eslintrc.json +44 -44
  2. package/.github/ISSUE_TEMPLATE/1-bug-report.yml +84 -0
  3. package/.github/ISSUE_TEMPLATE/2-docs.md +12 -0
  4. package/.github/ISSUE_TEMPLATE/3-proposal.md +28 -0
  5. package/.github/ISSUE_TEMPLATE/config.yml +8 -0
  6. package/CONTRIBUTING.md +74 -74
  7. package/Changelog +220 -215
  8. package/Dockerfile +17 -17
  9. package/Gruntfile.js +40 -40
  10. package/LICENSE +661 -661
  11. package/README.md +191 -191
  12. package/app.ts +1 -1
  13. package/config/Config.ts +14 -0
  14. package/config/VersionCheck.ts +2 -2
  15. package/controller/Constants.ts +2 -1
  16. package/controller/Equipment.ts +2484 -2459
  17. package/controller/Errors.ts +180 -180
  18. package/controller/Lockouts.ts +502 -436
  19. package/controller/State.ts +106 -30
  20. package/controller/boards/AquaLinkBoard.ts +1000 -0
  21. package/controller/boards/BoardFactory.ts +49 -45
  22. package/controller/boards/EasyTouchBoard.ts +2859 -2653
  23. package/controller/boards/IntelliCenterBoard.ts +4198 -4230
  24. package/controller/boards/IntelliComBoard.ts +63 -63
  25. package/controller/boards/IntelliTouchBoard.ts +273 -241
  26. package/controller/boards/NixieBoard.ts +1728 -1675
  27. package/controller/boards/SystemBoard.ts +4925 -4697
  28. package/controller/comms/Comms.ts +442 -479
  29. package/controller/comms/messages/Messages.ts +171 -25
  30. package/controller/comms/messages/config/ChlorinatorMessage.ts +5 -2
  31. package/controller/comms/messages/config/CircuitGroupMessage.ts +0 -0
  32. package/controller/comms/messages/config/CircuitMessage.ts +1 -0
  33. package/controller/comms/messages/config/ConfigMessage.ts +0 -0
  34. package/controller/comms/messages/config/CoverMessage.ts +0 -0
  35. package/controller/comms/messages/config/CustomNameMessage.ts +30 -30
  36. package/controller/comms/messages/config/EquipmentMessage.ts +0 -0
  37. package/controller/comms/messages/config/ExternalMessage.ts +0 -0
  38. package/controller/comms/messages/config/FeatureMessage.ts +0 -0
  39. package/controller/comms/messages/config/GeneralMessage.ts +0 -0
  40. package/controller/comms/messages/config/HeaterMessage.ts +142 -10
  41. package/controller/comms/messages/config/IntellichemMessage.ts +0 -0
  42. package/controller/comms/messages/config/OptionsMessage.ts +4 -21
  43. package/controller/comms/messages/config/PumpMessage.ts +53 -35
  44. package/controller/comms/messages/config/RemoteMessage.ts +0 -0
  45. package/controller/comms/messages/config/ScheduleMessage.ts +350 -347
  46. package/controller/comms/messages/config/SecurityMessage.ts +0 -0
  47. package/controller/comms/messages/config/ValveMessage.ts +1 -1
  48. package/controller/comms/messages/status/ChlorinatorStateMessage.ts +38 -86
  49. package/controller/comms/messages/status/EquipmentStateMessage.ts +58 -22
  50. package/controller/comms/messages/status/HeaterStateMessage.ts +116 -86
  51. package/controller/comms/messages/status/IntelliChemStateMessage.ts +445 -445
  52. package/controller/comms/messages/status/IntelliValveStateMessage.ts +35 -35
  53. package/controller/comms/messages/status/PumpStateMessage.ts +23 -1
  54. package/controller/comms/messages/status/VersionMessage.ts +0 -0
  55. package/controller/nixie/Nixie.ts +162 -162
  56. package/controller/nixie/NixieEquipment.ts +103 -103
  57. package/controller/nixie/bodies/Body.ts +120 -120
  58. package/controller/nixie/bodies/Filter.ts +135 -135
  59. package/controller/nixie/chemistry/ChemController.ts +2511 -2498
  60. package/controller/nixie/chemistry/Chlorinator.ts +363 -314
  61. package/controller/nixie/circuits/Circuit.ts +261 -248
  62. package/controller/nixie/heaters/Heater.ts +650 -648
  63. package/controller/nixie/pumps/Pump.ts +906 -661
  64. package/controller/nixie/schedules/Schedule.ts +313 -257
  65. package/controller/nixie/valves/Valve.ts +170 -170
  66. package/defaultConfig.json +306 -286
  67. package/logger/DataLogger.ts +448 -448
  68. package/logger/Logger.ts +0 -0
  69. package/package.json +56 -56
  70. package/tsconfig.json +25 -25
  71. package/web/Server.ts +92 -47
  72. package/web/bindings/aqualinkD.json +505 -0
  73. package/web/bindings/influxDB.json +1051 -1021
  74. package/web/bindings/mqtt.json +702 -654
  75. package/web/bindings/mqttAlt.json +731 -684
  76. package/web/bindings/rulesManager.json +54 -54
  77. package/web/bindings/smartThings-Hubitat.json +31 -31
  78. package/web/bindings/valveRelays.json +20 -20
  79. package/web/bindings/vera.json +25 -25
  80. package/web/interfaces/baseInterface.ts +137 -136
  81. package/web/interfaces/httpInterface.ts +145 -124
  82. package/web/interfaces/influxInterface.ts +276 -245
  83. package/web/interfaces/mqttInterface.ts +535 -475
  84. package/web/services/config/Config.ts +39 -18
  85. package/web/services/config/ConfigSocket.ts +0 -0
  86. package/web/services/state/State.ts +10 -0
  87. package/web/services/state/StateSocket.ts +4 -4
  88. package/web/services/utilities/Utilities.ts +44 -42
  89. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -52
  90. package/config copy.json +0 -300
  91. package/issue_template.md +0 -52
@@ -1,655 +1,703 @@
1
- {
2
- "context": {
3
- "name": "MQTT",
4
- "options": {
5
- "formatter": [
6
- {
7
- "transform": ".toLowerCase()"
8
- },
9
- {
10
- "regexkey": "\\s",
11
- "replace": "",
12
- "description": "Remove whitespace"
13
- },
14
- {
15
- "regexkey": "\\/",
16
- "replace": "",
17
- "description": "Remove /"
18
- },
19
- {
20
- "regexkey": "\\+",
21
- "replace": "",
22
- "description": "Remove +"
23
- },
24
- {
25
- "regexkey": "\\$",
26
- "replace": "",
27
- "description": "Remove $"
28
- },
29
- {
30
- "regexkey": "\\#",
31
- "replace": "",
32
- "description": "Remove #"
33
- }
34
- ],
35
- "rootTopic-DIRECTIONS": "You can override the root topic by renaming _rootTopic to rootTopic",
36
- "_rootTopic": "@bind=(state.equipment.alias).replace(' ','-').replace('/','').toLowerCase();",
37
- "clientId": "@bind='mqttjs_njsPC_'+Math.random().toString(16).substr(2, 8);"
38
- }
39
- },
40
- "events": [
41
- {
42
- "name": "config",
43
- "description": "Don't flood the MQTT bus.",
44
- "enabled": false
45
- },
46
- {
47
- "name": "controller",
48
- "description": "Emit time every minute",
49
- "enabled": true,
50
- "topics": [
51
- {
52
- "topic": "state/time",
53
- "message": "@bind=data.time;",
54
- "filter": "@bind=data.status.percent === 100;"
55
- },
56
- {
57
- "topic": "alias",
58
- "message": "@bind=data.alias;"
59
- },
60
- {
61
- "topic": "state/status",
62
- "message": "@bind=data.status;"
63
- },
64
- {
65
- "topic": "state/mode",
66
- "message": "@bind=data.mode;"
67
- },
68
- {
69
- "topic": "state/startTime",
70
- "message": "@bind=data.startTime;"
71
- }
72
- ]
73
- },
74
- {
75
- "name": "circuit",
76
- "description": "Populate the circuits topics",
77
- "topics": [
78
- {
79
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;",
80
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';,\"endTime\":\"@bind=data.endTime;\"}",
81
- "description": "Bind 'on'/'off' as a message to the state topic."
82
- },
83
- {
84
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;/isOn/string",
85
- "message": "@bind=data.isOn?'on':'off';",
86
- "description": "Bind 'on'/'off' as a message to the topic.",
87
- "enabled": false
88
- },
89
- {
90
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;/isOn/boolean",
91
- "message": "@bind=data.isOn;",
92
- "description": "SAMPLE: Bind the isOn as a message to the topic.",
93
- "enabled": false
94
- },
95
- {
96
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;/lightingTheme",
97
- "message": "{\"lightingTheme\":@bind=data.lightingTheme;}",
98
- "description": "SAMPLE: Bind the lighting theme to the topic.",
99
- "filter": "@bind=data.type.isLight === true;"
100
- },
101
- {
102
- "topic": "state/circuits/@bind=data.id;/customTopicFormatter/@bind=data.name;/isOn",
103
- "message": "@bind=data.isOn;",
104
- "description": "SAMPLE: Bind the isOn as a message to the topic with a custom replacer, qos and retain setting.",
105
- "formatter": [
106
- {
107
- "transform": ".toLowerCase()"
108
- },
109
- {
110
- "regexkey": "\\s",
111
- "replace": "__",
112
- "description": "Remove whitespace and replace with __"
113
- },
114
- {
115
- "regexkey": "\\/",
116
- "replace": "__",
117
- "description": "Remove / and replace with __"
118
- }
119
- ],
120
- "options": { "qos": 2 },
121
- "enabled": false
122
- },
123
- {
124
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;/endTime",
125
- "message": "{\"id\":@bind=data.id;,\"endTime\":@bind=data.endTime;}",
126
- "description": "Bind endTime as a message to the state topic."
127
- },
128
- {
129
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;/object",
130
- "message": "@bind=data;",
131
- "description": "SAMPLE: Bind a JSON object as a message to the topic.",
132
- "enabled": false
133
- }
134
- ]
135
- },
136
- {
137
- "name": "virtualCircuit",
138
- "description": "Populate the virtual circuits topics",
139
- "topics": [
140
- {
141
- "topic": "state/virtualcircuits/@bind=data.id;/@bind=data.name;",
142
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
143
- "description": "Bind 'on'/'off' as a message to the state topic."
144
- }
145
- ]
146
- },
147
- {
148
- "name": "valve",
149
- "description": "Populate the valve topics",
150
- "topics": [
151
- {
152
- "topic": "state/valve/@bind=data.id;/@bind=data.name;",
153
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isDiverted?'\"on\"':'\"off\"';,\"isVirtual\":@bind=data.isVirtual? true: false;,\"pinId\": @bind=data.pinId;}",
154
- "description": "Bind 'on'/'off' as a message to the valve state topic."
155
- }
156
- ]
157
- },
158
- {
159
- "name": "feature",
160
- "description": "Populate the features topics",
161
- "topics": [
162
- {
163
- "topic": "state/features/@bind=data.id;/@bind=data.name;",
164
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';,\"endTime\":\"@bind=data.endTime;\"}",
165
- "description": "Bind 'on'/'off' as a message to the state topic."
166
- },
167
- {
168
- "topic": "state/features/@bind=data.id;/@bind=data.name;/endTime",
169
- "message": "{\"id\":@bind=data.id;,\"endTime\":@bind=data.endTime;}",
170
- "description": "Bind endTime as a message to the state topic."
171
- }
172
- ]
173
- },
174
- {
175
- "name": "temps",
176
- "description": "Populate the temps topics",
177
- "topics": [
178
- {
179
- "topic": "state/temps/air",
180
- "message": "{\"temp\":@bind=data.air;}",
181
- "description": "Send air temp."
182
- },
183
- {
184
- "topic": "state/temps/solar",
185
- "message": "{\"temp\":@bind=data.solar;}",
186
- "description": "Send solar temp.",
187
- "filter": "@bind=typeof data.solar === 'undefined';"
188
- },
189
- {
190
- "topic": "state/temps/units",
191
- "message": "{\"units\":@bind=data.units;}"
192
- }
193
- ]
194
- },
195
- {
196
- "name": "circuitGroup",
197
- "description": "Populate the circuitGroup topic",
198
- "topics": [
199
- {
200
- "topic": "state/circuitGroups/@bind=data.id;/name",
201
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
202
- "description": "Bind name to the state topic."
203
- },
204
- {
205
- "topic": "state/circuitGroups/@bind=data.id;/isOn",
206
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
207
- "description": "Bind the on/off status to the topic."
208
- },
209
- {
210
- "topic": "state/circuitGroups/@bind=data.id;/type",
211
- "message": "{\"type\":@bind=data.type;}"
212
- },
213
- {
214
- "topic": "state/circuitGroups/@bind=data.id;/showInFeatures",
215
- "message": "{\"showInFeatures\":@bind=data.showInFeatures;}",
216
- "description": "Indicates wether the item should show in features."
217
- }
218
-
219
- ]
220
- },
221
- {
222
- "name": "body",
223
- "description": "Populate the body topic",
224
- "topics": [
225
- {
226
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;",
227
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
228
- "description": "Bind 'on'/'off' as a message to the state topic."
229
- },
230
- {
231
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/heatMode",
232
- "message": "{\"heatMode\":@bind=data.heatMode;}",
233
- "description": "Send heat mode."
234
- },
235
- {
236
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/heatStatus",
237
- "message": "{\"heatStatus\":@bind=data.heatStatus;}",
238
- "description": "Send heat status."
239
- },
240
- {
241
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/setPoint",
242
- "message": "{\"setPoint\":@bind=data.setPoint;}",
243
- "description": "Send set point."
244
- },
245
- {
246
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/coolSetpoint",
247
- "message": "{\"coolSetpoint\":@bind=data.coolSetpoint;}",
248
- "description": "Send cool set point."
249
- },
250
- {
251
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/temp",
252
- "message": "{\"temp\":@bind=data.temp;}",
253
- "description": "Send temp."
254
- }
255
- ]
256
- },
257
- {
258
- "name": "chlorinator",
259
- "description": "Populate the chlorinator topic",
260
- "topics": [
261
- {
262
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;",
263
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
264
- "description": "Bind 'on'/'off' as a message to the state topic."
265
- },
266
- {
267
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/currentOutput",
268
- "message": "{\"currentOutput\":@bind=data.currentOutput;}",
269
- "description": "Send current output."
270
- },
271
- {
272
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/poolSetpoint",
273
- "message": "{\"poolSetpoint\":@bind=data.poolSetpoint;}",
274
- "description": "Send pool setpoint."
275
- },
276
- {
277
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/spaSetpoint",
278
- "message": "{\"spaSetpoint\":@bind=data.spaSetpoint;}",
279
- "description": "Send set point."
280
- },
281
- {
282
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/status",
283
- "message": "{\"status\":@bind=data.status;}",
284
- "description": "Send status."
285
- },
286
- {
287
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/superChlor",
288
- "message": "{\"superChlor\":@bind=data.superChlor?'\"on\"':'\"off\"';}",
289
- "description": "Send superChlor."
290
- },
291
- {
292
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/superChlorHours",
293
- "message": "{\"superChlorHours\":@bind=data.superChlorHours;}",
294
- "description": "Send superChlorHours."
295
- },
296
- {
297
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/saltLevel",
298
- "message": "{\"saltLevel\":@bind=data.saltLevel;}",
299
- "description": "Send salt level."
300
- },
301
- {
302
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/type",
303
- "message": "{\"type\":@bind=data.type;}",
304
- "description": "Send type."
305
- },
306
- {
307
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/targetOutput",
308
- "message": "{\"targetOutput\":@bind=data.targetOutput;}",
309
- "description": "Send targetOutput."
310
- }
311
- ]
312
- },
313
- {
314
- "name": "lightGroup",
315
- "description": "Populate the lightGroup topic",
316
- "topics": [
317
- {
318
- "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;",
319
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
320
- "description": "Bind 'on'/'off' as a message to the state topic."
321
- },
322
- {
323
- "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/action",
324
- "message": "{\"action\":@bind=data.action;}"
325
- },
326
- {
327
- "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/lightingTheme",
328
- "message": "{\"lightingTheme\":@bind=data.lightingTheme;}"
329
- },
330
- {
331
- "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/type",
332
- "message": "{\"type\":@bind=data.type;}"
333
- },
334
- {
335
- "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/endTime",
336
- "message": "{\"endTime\":@bind=data.endTime;}"
337
- }
338
- ]
339
- },
340
- {
341
- "name": "pump",
342
- "description": "Populate the pumps topic",
343
- "topics": [
344
- {
345
- "topic": "state/pumps/@bind=data.id;/@bind=data.name;",
346
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.flow > 0 || data.rpm > 0?'\"on\"':'\"off\"';}",
347
- "description": "Bind 'on'/'off' as a message to the state topic."
348
- },
349
- {
350
- "topic": "state/pumps/@bind=data.id;/@bind=data.name;/rpm",
351
- "message": "{\"rpm\":@bind=data.rpm;}"
352
- },
353
- {
354
- "topic": "state/pumps/@bind=data.id;/@bind=data.name;/flow",
355
- "message": "{\"flow\":@bind=data.flow;}"
356
- },
357
- {
358
- "topic": "state/pumps/@bind=data.id;/@bind=data.name;/watts",
359
- "message": "{\"watts\":@bind=data.watts;}"
360
- },
361
- {
362
- "topic": "state/pumps/@bind=data.id;/@bind=data.name;/status",
363
- "message": "{\"status\":@bind=data.status;}"
364
- }
365
- ]
366
- },
367
- {
368
- "name": "chemController",
369
- "description": "Populate the chemControllers topic",
370
- "vars": {
371
- "cfg": "@bind=sys.chemControllers.getItemById(data.id).get();"
372
- },
373
- "topics": [
374
- {
375
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/tankLevel",
376
- "message": "@bind=data.ph.tank.level;",
377
- "enabled": true
378
- },
379
- {
380
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/setpoint",
381
- "message": "@bind=data.ph.setpoint;",
382
- "enabled": true
383
- },
384
- {
385
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/level",
386
- "message": "@bind=data.ph.level;",
387
- "enabled": true
388
- },
389
- {
390
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/doseTime",
391
- "message": "@bind=data.ph.doseTime;",
392
- "enabled": true
393
- },
394
- {
395
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/doseVolume",
396
- "message": "@bind=data.ph.doseVolume;",
397
- "enabled": true
398
- },
399
- {
400
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/tankLevel",
401
- "message": "@bind=data.orp.tank.level;",
402
- "enabled": true
403
- },
404
- {
405
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/setpoint",
406
- "message": "@bind=data.orp.setpoint;",
407
- "enabled": true
408
- },
409
- {
410
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/level",
411
- "message": "@bind=data.orp.level;",
412
- "enabled": true
413
- },
414
- {
415
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/demand",
416
- "message": "@bind=data.orp.demand;",
417
- "enabled": true
418
- },
419
- {
420
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/doseTime",
421
- "message": "@bind=data.orp.doseTime;",
422
- "enabled": true
423
- },
424
- {
425
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/doseVolume",
426
- "message": "@bind=data.orp.doseVolume;",
427
- "enabled": true
428
- },
429
- {
430
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/saltLevel",
431
- "message": "@bind=data.orp.saltLevel;",
432
- "enabled": true
433
- },
434
- {
435
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/acidTankLevel",
436
- "message": "{\"acidTankLevel\":@bind=data.ph.tank.level;}"
437
- },
438
- {
439
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpTankLevel",
440
- "message": "{\"orpTankLevel\":@bind=data.orp.tank.level;}"
441
- },
442
- {
443
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDosingTime",
444
- "message": "{\"orpDosingTime\":@bind=data.orp.doseTime;}"
445
- },
446
- {
447
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHDosingTime",
448
- "message": "{\"pHDosingTime\":@bind=data.ph.doseTime;}"
449
- },
450
- {
451
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHDosingVolume",
452
- "message": "{\"pHDosingVolume\":@bind=data.ph.doseVolume;}"
453
- },
454
- {
455
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDosingVolume",
456
- "message": "{\"orpDosingVolume\":@bind=data.orp.doseVolume;}"
457
- },
458
- {
459
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpSetpoint",
460
- "message": "{\"orpSetpoint\":@bind=data.orp.setpoint;}"
461
- },
462
- {
463
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHSetpoint",
464
- "message": "{\"pHSetpoint\":@bind=data.ph.setpoint;}"
465
- },
466
- {
467
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpLevel",
468
- "message": "{\"orpLevel\":@bind=data.orp.level;}"
469
- },
470
- {
471
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHLevel",
472
- "message": "{\"pHLevel\":@bind=data.ph.level;}"
473
- },
474
- {
475
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/saltLevel",
476
- "message": "{\"saltLevel\":@bind=data.orp.probe.saltLevel;}"
477
- },
478
- {
479
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/saturationIndex",
480
- "message": "{\"saturationIndex\":@bind=data.saturationIndex;}"
481
- },
482
- {
483
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/status",
484
- "message": "@bind=data.status;"
485
- },
486
- {
487
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/type",
488
- "message": "@bind=data.type;"
489
- },
490
- {
491
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alkalinity",
492
- "message": "@bind=vars.cfg.alkalinity;"
493
- },
494
- {
495
- "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/alkalinity",
496
- "message": "{\"alkalinity\":@bind=vars.cfg.alkalinity;}"
497
- },
498
- {
499
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/calciumHardness",
500
- "message": "@bind=vars.cfg.calciumHardness;"
501
- },
502
- {
503
- "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/calciumHardness",
504
- "message": "@bind=vars.cfg.calciumHardness;"
505
- },
506
- {
507
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/cyanuricAcid",
508
- "message": "@bind=vars.cfg.cyanuricAcid;"
509
- },
510
- {
511
- "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/cyanuricAcid",
512
- "message": "@bind=vars.cfg.cyanuricAcid;"
513
- },
514
- {
515
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/borates",
516
- "message": "@bind=vars.cfg.borates;"
517
- },
518
- {
519
- "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/borates",
520
- "message": "@bind=vars.cfg.borates;"
521
- },
522
- {
523
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/acidDemand",
524
- "message": "@bind=data.ph.demand;"
525
- },
526
- {
527
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDemand",
528
- "message": "@bind=data.orp.demand;"
529
- },
530
- {
531
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/flow",
532
- "message": "@bind=data.alarms.flow;"
533
- },
534
- {
535
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/ph",
536
- "message": "@bind=data.alarms.pH;"
537
- },
538
- {
539
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/orp",
540
- "message": "@bind=data.alarms.orp;"
541
- },
542
- {
543
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/phTank",
544
- "message": "@bind=data.alarms.pHTank;"
545
- },
546
- {
547
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/orpTank",
548
- "message": "@bind=data.alarms.orpTank;"
549
- },
550
- {
551
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/orpProbeFault",
552
- "message": "@bind=data.alarms.orpProbeFault;"
553
- },
554
- {
555
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/pHProbeFault",
556
- "message": "@bind=data.alarms.pHProbeFault;"
557
- },
558
-
559
- {
560
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/waterChemistry",
561
- "message": "@bind=data.warnings.waterChemistry;"
562
- },
563
- {
564
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/pHLockout",
565
- "message": "@bind=data.warnings.pHLockout;"
566
- },
567
- {
568
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/pHDailyLimitReached",
569
- "message": "@bind=data.warnings.pHDailyLimitReached;"
570
- },
571
- {
572
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/orpDailyLimitReached",
573
- "message": "@bind=data.warnings.orpDailyLimitReached;"
574
- },
575
- {
576
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/invalidSetup",
577
- "message": "@bind=data.warnings.invalidSetup;"
578
- },
579
- {
580
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/chlorinatorCommError",
581
- "message": "@bind=data.warnings.chlorinatorCommError;"
582
- }
583
- ]
584
- },
585
- {
586
- "name": "chemicalDose",
587
- "description": "Event when a chemical is being dosed",
588
- "topics": [
589
- {
590
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.chem;",
591
- "message": "@bind=data;",
592
- "enabled": true
593
- }
594
- ]
595
- },
596
- {
597
- "name": "filter",
598
- "description": "Populate the filter topic",
599
- "topics": [
600
- {
601
- "topic": "state/filters/@bind=data.id;/@bind=data.name;",
602
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
603
- "description": "Bind 'on'/'off' as a message to the state topic."
604
- },
605
- {
606
- "topic": "state/filters/@bind=data.id;/@bind=data.name;/pressure",
607
- "message": "{\"pressure\":@bind=data.pressure;}",
608
- "description": "Send current pressure."
609
- },
610
- {
611
- "topic": "state/filters/@bind=data.id;/@bind=data.name;/refPressure",
612
- "message": "{\"refPressure\":@bind=data.refPressure;}",
613
- "description": "Send reference pressure (when circuits are on)."
614
- },
615
- {
616
- "topic": "state/filters/@bind=data.id;/@bind=data.name;/body",
617
- "message": "{\"body\":@bind=data.body.desc;}",
618
- "description": "Send associated body."
619
- },
620
- {
621
- "topic": "state/filters/@bind=data.id;/@bind=data.name;/filterType",
622
- "message": "{\"filterType\":@bind=data.filterType.desc;}",
623
- "description": "Send filter type."
624
- },
625
- {
626
- "topic": "state/filters/@bind=data.id;/@bind=data.name;/pressureUnits",
627
- "message": "{\"pressureUnits\":@bind=data.pressureUnits.desc;}",
628
- "description": "Send pressureUnits."
629
- },
630
- {
631
- "topic": "state/filters/@bind=data.id;/@bind=data.name;/cleanPercentage",
632
- "message": "{\"cleanPercentage\":@bind=data.cleanPercentage;}",
633
- "description": "Send cleanPercentage."
634
- }
635
- ]
636
- },
637
- {
638
- "name": "cover",
639
- "description": "Populate the cover topic",
640
- "topics": [
641
- {
642
- "topic": "state/covers/@bind=data.id;/@bind=data.name;",
643
- "message": "{\"id\":@bind=data.id;,\"isClosed\":@bind=data.isClosed?'\"true\"':'\"false\"';}",
644
- "description": "Bind isClosed as a message to the state topic."
645
- }
646
- ]
647
- },
648
- {
649
- "name": "*",
650
- "description": "DEFAULT: Sends the entire emitted response.",
651
- "body": "@bind=data;",
652
- "enabled": false
653
- }
654
- ]
1
+ {
2
+ "context": {
3
+ "name": "MQTT",
4
+ "options": {
5
+ "formatter": [
6
+ {
7
+ "transform": ".toLowerCase()"
8
+ },
9
+ {
10
+ "regexkey": "\\s",
11
+ "replace": "",
12
+ "description": "Remove whitespace"
13
+ },
14
+ {
15
+ "regexkey": "\\/",
16
+ "replace": "",
17
+ "description": "Remove /"
18
+ },
19
+ {
20
+ "regexkey": "\\+",
21
+ "replace": "",
22
+ "description": "Remove +"
23
+ },
24
+ {
25
+ "regexkey": "\\$",
26
+ "replace": "",
27
+ "description": "Remove $"
28
+ },
29
+ {
30
+ "regexkey": "\\#",
31
+ "replace": "",
32
+ "description": "Remove #"
33
+ }
34
+ ],
35
+ "rootTopic-DIRECTIONS": "You can override the root topic by renaming _rootTopic to rootTopic",
36
+ "_rootTopic": "@bind=(state.equipment.alias).replace(' ','-').replace('/','').toLowerCase();",
37
+ "clientId": "@bind='mqttjs_njsPC_'+Math.random().toString(16).substr(2, 8);"
38
+ }
39
+ },
40
+ "events": [
41
+ {
42
+ "name": "config",
43
+ "description": "Don't flood the MQTT bus.",
44
+ "enabled": false
45
+ },
46
+ {
47
+ "name": "controller",
48
+ "description": "Emit time every minute",
49
+ "enabled": true,
50
+ "topics": [
51
+ {
52
+ "topic": "state/time",
53
+ "message": "@bind=data.time;",
54
+ "filter": "@bind=data.status.percent === 100;"
55
+ },
56
+ {
57
+ "topic": "alias",
58
+ "message": "@bind=data.alias;"
59
+ },
60
+ {
61
+ "topic": "state/status",
62
+ "message": "@bind=data.status;"
63
+ },
64
+ {
65
+ "topic": "state/mode",
66
+ "message": "@bind=data.mode;"
67
+ },
68
+ {
69
+ "topic": "state/startTime",
70
+ "message": "@bind=data.startTime;"
71
+ }
72
+ ]
73
+ },
74
+ {
75
+ "name": "circuit",
76
+ "description": "Populate the circuits topics",
77
+ "topics": [
78
+ {
79
+ "topic": "state/circuits/@bind=data.id;/@bind=data.name;",
80
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';,\"endTime\":\"@bind=data.endTime;\"}",
81
+ "description": "Bind 'on'/'off' as a message to the state topic."
82
+ },
83
+ {
84
+ "topic": "state/circuits/@bind=data.id;/@bind=data.name;/isOn/string",
85
+ "message": "@bind=data.isOn?'on':'off';",
86
+ "description": "Bind 'on'/'off' as a message to the topic.",
87
+ "enabled": false
88
+ },
89
+ {
90
+ "topic": "state/circuits/@bind=data.id;/@bind=data.name;/isOn/boolean",
91
+ "message": "@bind=data.isOn;",
92
+ "description": "SAMPLE: Bind the isOn as a message to the topic.",
93
+ "enabled": false
94
+ },
95
+ {
96
+ "topic": "state/circuits/@bind=data.id;/@bind=data.name;/lightingTheme",
97
+ "message": "{\"lightingTheme\":@bind=data.lightingTheme;}",
98
+ "description": "SAMPLE: Bind the lighting theme to the topic.",
99
+ "filter": "@bind=data.type.isLight === true;"
100
+ },
101
+ {
102
+ "topic": "state/circuits/@bind=data.id;/customTopicFormatter/@bind=data.name;/isOn",
103
+ "message": "@bind=data.isOn;",
104
+ "description": "SAMPLE: Bind the isOn as a message to the topic with a custom replacer, qos and retain setting.",
105
+ "formatter": [
106
+ {
107
+ "transform": ".toLowerCase()"
108
+ },
109
+ {
110
+ "regexkey": "\\s",
111
+ "replace": "__",
112
+ "description": "Remove whitespace and replace with __"
113
+ },
114
+ {
115
+ "regexkey": "\\/",
116
+ "replace": "__",
117
+ "description": "Remove / and replace with __"
118
+ }
119
+ ],
120
+ "options": { "qos": 2 },
121
+ "enabled": false
122
+ },
123
+ {
124
+ "topic": "state/circuits/@bind=data.id;/@bind=data.name;/endTime",
125
+ "message": "{\"id\":@bind=data.id;,\"endTime\":@bind=data.endTime;}",
126
+ "description": "Bind endTime as a message to the state topic."
127
+ },
128
+ {
129
+ "topic": "state/circuits/@bind=data.id;/@bind=data.name;/object",
130
+ "message": "@bind=data;",
131
+ "description": "SAMPLE: Bind a JSON object as a message to the topic.",
132
+ "enabled": false
133
+ }
134
+ ]
135
+ },
136
+ {
137
+ "name": "virtualCircuit",
138
+ "description": "Populate the virtual circuits topics",
139
+ "topics": [
140
+ {
141
+ "topic": "state/virtualcircuits/@bind=data.id;/@bind=data.name;",
142
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
143
+ "description": "Bind 'on'/'off' as a message to the state topic."
144
+ }
145
+ ]
146
+ },
147
+ {
148
+ "name": "valve",
149
+ "description": "Populate the valve topics",
150
+ "topics": [
151
+ {
152
+ "topic": "state/valve/@bind=data.id;/@bind=data.name;",
153
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isDiverted?'\"on\"':'\"off\"';,\"isVirtual\":@bind=data.isVirtual? true: false;,\"pinId\": @bind=data.pinId;}",
154
+ "description": "Bind 'on'/'off' as a message to the valve state topic."
155
+ }
156
+ ]
157
+ },
158
+ {
159
+ "name": "feature",
160
+ "description": "Populate the features topics",
161
+ "topics": [
162
+ {
163
+ "topic": "state/features/@bind=data.id;/@bind=data.name;",
164
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';,\"endTime\":\"@bind=data.endTime;\"}",
165
+ "description": "Bind 'on'/'off' as a message to the state topic."
166
+ },
167
+ {
168
+ "topic": "state/features/@bind=data.id;/@bind=data.name;/endTime",
169
+ "message": "{\"id\":@bind=data.id;,\"endTime\":@bind=data.endTime;}",
170
+ "description": "Bind endTime as a message to the state topic."
171
+ }
172
+ ]
173
+ },
174
+ {
175
+ "name": "temps",
176
+ "description": "Populate the temps topics",
177
+ "topics": [
178
+ {
179
+ "topic": "state/temps/air",
180
+ "message": "{\"temp\":@bind=data.air;}",
181
+ "description": "Send air temp."
182
+ },
183
+ {
184
+ "topic": "state/temps/solar",
185
+ "message": "{\"temp\":@bind=data.solar;}",
186
+ "description": "Send solar temp.",
187
+ "filter": "@bind=typeof data.solar !== 'undefined';"
188
+ },
189
+ {
190
+ "topic": "state/temps/solarSensor2",
191
+ "message": "{\"temp\":@bind=data.solarSensor2;}",
192
+ "description": "Solar temp",
193
+ "filter": "@bind=typeof data.solarSensor2 !== 'undefined';"
194
+ },
195
+ {
196
+ "topic": "state/temps/solarSensor3",
197
+ "message": "{\"temp\":@bind=data.solarSensor3;}",
198
+ "description": "Solar temp",
199
+ "filter": "@bind=typeof data.solarSensor3 !== 'undefined';"
200
+ },
201
+ {
202
+ "topic": "state/temps/solarSensor4",
203
+ "message": "{\"temp\":@bind=data.solarSensor4;}",
204
+ "description": "Solar temp",
205
+ "filter": "@bind=typeof data.solarSensor4 !== 'undefined';"
206
+ },
207
+
208
+ {
209
+ "topic": "state/temps/waterSensor1",
210
+ "message": "{\"temp\":@bind=data.waterSensor1;}",
211
+ "description": "Water temp sensor 1",
212
+ "filter": "@bind=typeof data.waterSensor1 !== 'undefined';"
213
+ },
214
+ {
215
+ "topic": "state/temps/waterSensor2",
216
+ "message": "{\"temp\":@bind=data.waterSensor2;}",
217
+ "description": "Water temp sensor 2",
218
+ "filter": "@bind=typeof data.waterSensor2 !== 'undefined';"
219
+ },
220
+ {
221
+ "topic": "state/temps/waterSensor3",
222
+ "message": "{\"temp\":@bind=data.waterSensor3;}",
223
+ "description": "Water temp sensor 3",
224
+ "filter": "@bind=typeof data.waterSensor3 !== 'undefined';"
225
+ },
226
+ {
227
+ "topic": "state/temps/waterSensor4",
228
+ "message": "{\"temp\":@bind=data.waterSensor4;}",
229
+ "description": "Water temp sensor 4",
230
+ "filter": "@bind=typeof data.waterSensor4 !== 'undefined';"
231
+ },
232
+ {
233
+ "topic": "state/temps/units",
234
+ "message": "{\"units\":@bind=data.units;}"
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ "name": "circuitGroup",
240
+ "description": "Populate the circuitGroup topic",
241
+ "topics": [
242
+ {
243
+ "topic": "state/circuitGroups/@bind=data.id;/name",
244
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
245
+ "description": "Bind name to the state topic."
246
+ },
247
+ {
248
+ "topic": "state/circuitGroups/@bind=data.id;/isOn",
249
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
250
+ "description": "Bind the on/off status to the topic."
251
+ },
252
+ {
253
+ "topic": "state/circuitGroups/@bind=data.id;/type",
254
+ "message": "{\"type\":@bind=data.type;}"
255
+ },
256
+ {
257
+ "topic": "state/circuitGroups/@bind=data.id;/showInFeatures",
258
+ "message": "{\"showInFeatures\":@bind=data.showInFeatures;}",
259
+ "description": "Indicates wether the item should show in features."
260
+ }
261
+
262
+ ]
263
+ },
264
+ {
265
+ "name": "body",
266
+ "description": "Populate the body topic",
267
+ "topics": [
268
+ {
269
+ "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;",
270
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
271
+ "description": "Bind 'on'/'off' as a message to the state topic."
272
+ },
273
+ {
274
+ "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/heatMode",
275
+ "message": "{\"heatMode\":@bind=data.heatMode;}",
276
+ "description": "Send heat mode."
277
+ },
278
+ {
279
+ "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/heatStatus",
280
+ "message": "{\"heatStatus\":@bind=data.heatStatus;}",
281
+ "description": "Send heat status."
282
+ },
283
+ {
284
+ "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/setPoint",
285
+ "message": "{\"setPoint\":@bind=data.setPoint;}",
286
+ "description": "Send set point."
287
+ },
288
+ {
289
+ "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/coolSetpoint",
290
+ "message": "{\"coolSetpoint\":@bind=data.coolSetpoint;}",
291
+ "description": "Send cool set point."
292
+ },
293
+ {
294
+ "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/temp",
295
+ "message": "{\"temp\":@bind=data.temp;}",
296
+ "description": "Send temp."
297
+ }
298
+ ]
299
+ },
300
+ {
301
+ "name": "chlorinator",
302
+ "description": "Populate the chlorinator topic",
303
+ "topics": [
304
+ {
305
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;",
306
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
307
+ "description": "Bind 'on'/'off' as a message to the state topic."
308
+ },
309
+ {
310
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/currentOutput",
311
+ "message": "{\"currentOutput\":@bind=data.currentOutput;}",
312
+ "description": "Send current output."
313
+ },
314
+ {
315
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/poolSetpoint",
316
+ "message": "{\"poolSetpoint\":@bind=data.poolSetpoint;}",
317
+ "description": "Send pool setpoint."
318
+ },
319
+ {
320
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/spaSetpoint",
321
+ "message": "{\"spaSetpoint\":@bind=data.spaSetpoint;}",
322
+ "description": "Send set point."
323
+ },
324
+ {
325
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/status",
326
+ "message": "{\"status\":@bind=data.status;}",
327
+ "description": "Send status."
328
+ },
329
+ {
330
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/superChlor",
331
+ "message": "{\"superChlor\":@bind=data.superChlor?'\"on\"':'\"off\"';}",
332
+ "description": "Send superChlor."
333
+ },
334
+ {
335
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/superChlorHours",
336
+ "message": "{\"superChlorHours\":@bind=data.superChlorHours;}",
337
+ "description": "Send superChlorHours."
338
+ },
339
+ {
340
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/saltLevel",
341
+ "message": "{\"saltLevel\":@bind=data.saltLevel;}",
342
+ "description": "Send salt level."
343
+ },
344
+ {
345
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/type",
346
+ "message": "{\"type\":@bind=data.type;}",
347
+ "description": "Send type."
348
+ },
349
+ {
350
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/model",
351
+ "message": "{\"type\":@bind=data.model;}",
352
+ "description": "Send Model."
353
+ },
354
+ {
355
+ "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/targetOutput",
356
+ "message": "{\"targetOutput\":@bind=data.targetOutput;}",
357
+ "description": "Send targetOutput."
358
+ }
359
+ ]
360
+ },
361
+ {
362
+ "name": "lightGroup",
363
+ "description": "Populate the lightGroup topic",
364
+ "topics": [
365
+ {
366
+ "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;",
367
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
368
+ "description": "Bind 'on'/'off' as a message to the state topic."
369
+ },
370
+ {
371
+ "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/action",
372
+ "message": "{\"action\":@bind=data.action;}"
373
+ },
374
+ {
375
+ "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/lightingTheme",
376
+ "message": "{\"lightingTheme\":@bind=data.lightingTheme;}"
377
+ },
378
+ {
379
+ "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/type",
380
+ "message": "{\"type\":@bind=data.type;}"
381
+ },
382
+ {
383
+ "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/endTime",
384
+ "message": "{\"endTime\":@bind=data.endTime;}"
385
+ }
386
+ ]
387
+ },
388
+ {
389
+ "name": "pump",
390
+ "description": "Populate the pumps topic",
391
+ "topics": [
392
+ {
393
+ "topic": "state/pumps/@bind=data.id;/@bind=data.name;",
394
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.flow > 0 || data.rpm > 0?'\"on\"':'\"off\"';}",
395
+ "description": "Bind 'on'/'off' as a message to the state topic."
396
+ },
397
+ {
398
+ "topic": "state/pumps/@bind=data.id;/@bind=data.name;/rpm",
399
+ "message": "{\"rpm\":@bind=data.rpm;}"
400
+ },
401
+ {
402
+ "topic": "state/pumps/@bind=data.id;/@bind=data.name;/flow",
403
+ "message": "{\"flow\":@bind=data.flow;}"
404
+ },
405
+ {
406
+ "topic": "state/pumps/@bind=data.id;/@bind=data.name;/watts",
407
+ "message": "{\"watts\":@bind=data.watts;}"
408
+ },
409
+ {
410
+ "topic": "state/pumps/@bind=data.id;/@bind=data.name;/status",
411
+ "message": "{\"status\":@bind=data.status;}"
412
+ }
413
+ ]
414
+ },
415
+ {
416
+ "name": "chemController",
417
+ "description": "Populate the chemControllers topic",
418
+ "vars": {
419
+ "cfg": "@bind=sys.chemControllers.getItemById(data.id).get();"
420
+ },
421
+ "topics": [
422
+ {
423
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/tankLevel",
424
+ "message": "@bind=data.ph.tank.level;",
425
+ "enabled": true
426
+ },
427
+ {
428
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/setpoint",
429
+ "message": "@bind=data.ph.setpoint;",
430
+ "enabled": true
431
+ },
432
+ {
433
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/level",
434
+ "message": "@bind=data.ph.level;",
435
+ "enabled": true
436
+ },
437
+ {
438
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/doseTime",
439
+ "message": "@bind=data.ph.doseTime;",
440
+ "enabled": true
441
+ },
442
+ {
443
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/doseVolume",
444
+ "message": "@bind=data.ph.doseVolume;",
445
+ "enabled": true
446
+ },
447
+ {
448
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/tankLevel",
449
+ "message": "@bind=data.orp.tank.level;",
450
+ "enabled": true
451
+ },
452
+ {
453
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/setpoint",
454
+ "message": "@bind=data.orp.setpoint;",
455
+ "enabled": true
456
+ },
457
+ {
458
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/level",
459
+ "message": "@bind=data.orp.level;",
460
+ "enabled": true
461
+ },
462
+ {
463
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/demand",
464
+ "message": "@bind=data.orp.demand;",
465
+ "enabled": true
466
+ },
467
+ {
468
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/doseTime",
469
+ "message": "@bind=data.orp.doseTime;",
470
+ "enabled": true
471
+ },
472
+ {
473
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/doseVolume",
474
+ "message": "@bind=data.orp.doseVolume;",
475
+ "enabled": true
476
+ },
477
+ {
478
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/saltLevel",
479
+ "message": "@bind=data.orp.saltLevel;",
480
+ "enabled": true
481
+ },
482
+ {
483
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/acidTankLevel",
484
+ "message": "{\"acidTankLevel\":@bind=data.ph.tank.level;}"
485
+ },
486
+ {
487
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpTankLevel",
488
+ "message": "{\"orpTankLevel\":@bind=data.orp.tank.level;}"
489
+ },
490
+ {
491
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDosingTime",
492
+ "message": "{\"orpDosingTime\":@bind=data.orp.doseTime;}"
493
+ },
494
+ {
495
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHDosingTime",
496
+ "message": "{\"pHDosingTime\":@bind=data.ph.doseTime;}"
497
+ },
498
+ {
499
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHDosingVolume",
500
+ "message": "{\"pHDosingVolume\":@bind=data.ph.doseVolume;}"
501
+ },
502
+ {
503
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDosingVolume",
504
+ "message": "{\"orpDosingVolume\":@bind=data.orp.doseVolume;}"
505
+ },
506
+ {
507
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpSetpoint",
508
+ "message": "{\"orpSetpoint\":@bind=data.orp.setpoint;}"
509
+ },
510
+ {
511
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHSetpoint",
512
+ "message": "{\"pHSetpoint\":@bind=data.ph.setpoint;}"
513
+ },
514
+ {
515
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpLevel",
516
+ "message": "{\"orpLevel\":@bind=data.orp.level;}"
517
+ },
518
+ {
519
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHLevel",
520
+ "message": "{\"pHLevel\":@bind=data.ph.level;}"
521
+ },
522
+ {
523
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/saltLevel",
524
+ "message": "{\"saltLevel\":@bind=data.orp.probe.saltLevel;}"
525
+ },
526
+ {
527
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/saturationIndex",
528
+ "message": "{\"saturationIndex\":@bind=data.saturationIndex;}"
529
+ },
530
+ {
531
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/status",
532
+ "message": "@bind=data.status;"
533
+ },
534
+ {
535
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/type",
536
+ "message": "@bind=data.type;"
537
+ },
538
+ {
539
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alkalinity",
540
+ "message": "@bind=vars.cfg.alkalinity;"
541
+ },
542
+ {
543
+ "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/alkalinity",
544
+ "message": "{\"alkalinity\":@bind=vars.cfg.alkalinity;}"
545
+ },
546
+ {
547
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/calciumHardness",
548
+ "message": "@bind=vars.cfg.calciumHardness;"
549
+ },
550
+ {
551
+ "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/calciumHardness",
552
+ "message": "@bind=vars.cfg.calciumHardness;"
553
+ },
554
+ {
555
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/cyanuricAcid",
556
+ "message": "@bind=vars.cfg.cyanuricAcid;"
557
+ },
558
+ {
559
+ "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/cyanuricAcid",
560
+ "message": "@bind=vars.cfg.cyanuricAcid;"
561
+ },
562
+ {
563
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/borates",
564
+ "message": "@bind=vars.cfg.borates;"
565
+ },
566
+ {
567
+ "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/borates",
568
+ "message": "@bind=vars.cfg.borates;"
569
+ },
570
+ {
571
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/acidDemand",
572
+ "message": "@bind=data.ph.demand;"
573
+ },
574
+ {
575
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDemand",
576
+ "message": "@bind=data.orp.demand;"
577
+ },
578
+ {
579
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/flow",
580
+ "message": "@bind=data.alarms.flow;"
581
+ },
582
+ {
583
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/ph",
584
+ "message": "@bind=data.alarms.pH;"
585
+ },
586
+ {
587
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/orp",
588
+ "message": "@bind=data.alarms.orp;"
589
+ },
590
+ {
591
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/phTank",
592
+ "message": "@bind=data.alarms.pHTank;"
593
+ },
594
+ {
595
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/orpTank",
596
+ "message": "@bind=data.alarms.orpTank;"
597
+ },
598
+ {
599
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/orpProbeFault",
600
+ "message": "@bind=data.alarms.orpProbeFault;"
601
+ },
602
+ {
603
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/pHProbeFault",
604
+ "message": "@bind=data.alarms.pHProbeFault;"
605
+ },
606
+
607
+ {
608
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/waterChemistry",
609
+ "message": "@bind=data.warnings.waterChemistry;"
610
+ },
611
+ {
612
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/pHLockout",
613
+ "message": "@bind=data.warnings.pHLockout;"
614
+ },
615
+ {
616
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/pHDailyLimitReached",
617
+ "message": "@bind=data.warnings.pHDailyLimitReached;"
618
+ },
619
+ {
620
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/orpDailyLimitReached",
621
+ "message": "@bind=data.warnings.orpDailyLimitReached;"
622
+ },
623
+ {
624
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/invalidSetup",
625
+ "message": "@bind=data.warnings.invalidSetup;"
626
+ },
627
+ {
628
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/chlorinatorCommError",
629
+ "message": "@bind=data.warnings.chlorinatorCommError;"
630
+ }
631
+ ]
632
+ },
633
+ {
634
+ "name": "chemicalDose",
635
+ "description": "Event when a chemical is being dosed",
636
+ "topics": [
637
+ {
638
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.chem;",
639
+ "message": "@bind=data;",
640
+ "enabled": true
641
+ }
642
+ ]
643
+ },
644
+ {
645
+ "name": "filter",
646
+ "description": "Populate the filter topic",
647
+ "topics": [
648
+ {
649
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;",
650
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
651
+ "description": "Bind 'on'/'off' as a message to the state topic."
652
+ },
653
+ {
654
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/pressure",
655
+ "message": "{\"pressure\":@bind=data.pressure;}",
656
+ "description": "Send current pressure."
657
+ },
658
+ {
659
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/refPressure",
660
+ "message": "{\"refPressure\":@bind=data.refPressure;}",
661
+ "description": "Send reference pressure (when circuits are on)."
662
+ },
663
+ {
664
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/body",
665
+ "message": "{\"body\":@bind=data.body.desc;}",
666
+ "description": "Send associated body."
667
+ },
668
+ {
669
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/filterType",
670
+ "message": "{\"filterType\":@bind=data.filterType.desc;}",
671
+ "description": "Send filter type."
672
+ },
673
+ {
674
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/pressureUnits",
675
+ "message": "{\"pressureUnits\":@bind=data.pressureUnits.desc;}",
676
+ "description": "Send pressureUnits."
677
+ },
678
+ {
679
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/cleanPercentage",
680
+ "message": "{\"cleanPercentage\":@bind=data.cleanPercentage;}",
681
+ "description": "Send cleanPercentage."
682
+ }
683
+ ]
684
+ },
685
+ {
686
+ "name": "cover",
687
+ "description": "Populate the cover topic",
688
+ "topics": [
689
+ {
690
+ "topic": "state/covers/@bind=data.id;/@bind=data.name;",
691
+ "message": "{\"id\":@bind=data.id;,\"isClosed\":@bind=data.isClosed?'\"true\"':'\"false\"';}",
692
+ "description": "Bind isClosed as a message to the state topic."
693
+ }
694
+ ]
695
+ },
696
+ {
697
+ "name": "*",
698
+ "description": "DEFAULT: Sends the entire emitted response.",
699
+ "body": "@bind=data;",
700
+ "enabled": false
701
+ }
702
+ ]
655
703
  }