nodejs-poolcontroller 7.3.1 → 7.6.1

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 (85) hide show
  1. package/.eslintrc.json +44 -44
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +52 -52
  3. package/CONTRIBUTING.md +74 -74
  4. package/Changelog +215 -195
  5. package/Dockerfile +17 -17
  6. package/Gruntfile.js +40 -40
  7. package/LICENSE +661 -661
  8. package/README.md +191 -186
  9. package/app.ts +2 -0
  10. package/config/Config.ts +27 -2
  11. package/config/VersionCheck.ts +33 -14
  12. package/config copy.json +299 -299
  13. package/controller/Constants.ts +88 -0
  14. package/controller/Equipment.ts +2459 -2225
  15. package/controller/Errors.ts +180 -157
  16. package/controller/Lockouts.ts +437 -0
  17. package/controller/State.ts +364 -79
  18. package/controller/boards/BoardFactory.ts +45 -45
  19. package/controller/boards/EasyTouchBoard.ts +2653 -2489
  20. package/controller/boards/IntelliCenterBoard.ts +4230 -3973
  21. package/controller/boards/IntelliComBoard.ts +63 -63
  22. package/controller/boards/IntelliTouchBoard.ts +241 -167
  23. package/controller/boards/NixieBoard.ts +1675 -1105
  24. package/controller/boards/SystemBoard.ts +4697 -3201
  25. package/controller/comms/Comms.ts +222 -10
  26. package/controller/comms/messages/Messages.ts +13 -9
  27. package/controller/comms/messages/config/ChlorinatorMessage.ts +13 -4
  28. package/controller/comms/messages/config/CircuitGroupMessage.ts +6 -0
  29. package/controller/comms/messages/config/CircuitMessage.ts +0 -0
  30. package/controller/comms/messages/config/ConfigMessage.ts +0 -0
  31. package/controller/comms/messages/config/CoverMessage.ts +1 -0
  32. package/controller/comms/messages/config/CustomNameMessage.ts +30 -30
  33. package/controller/comms/messages/config/EquipmentMessage.ts +4 -0
  34. package/controller/comms/messages/config/ExternalMessage.ts +53 -33
  35. package/controller/comms/messages/config/FeatureMessage.ts +8 -1
  36. package/controller/comms/messages/config/GeneralMessage.ts +8 -0
  37. package/controller/comms/messages/config/HeaterMessage.ts +14 -28
  38. package/controller/comms/messages/config/IntellichemMessage.ts +4 -1
  39. package/controller/comms/messages/config/OptionsMessage.ts +38 -2
  40. package/controller/comms/messages/config/PumpMessage.ts +4 -20
  41. package/controller/comms/messages/config/RemoteMessage.ts +4 -0
  42. package/controller/comms/messages/config/ScheduleMessage.ts +347 -331
  43. package/controller/comms/messages/config/SecurityMessage.ts +1 -0
  44. package/controller/comms/messages/config/ValveMessage.ts +13 -3
  45. package/controller/comms/messages/status/ChlorinatorStateMessage.ts +2 -3
  46. package/controller/comms/messages/status/EquipmentStateMessage.ts +79 -25
  47. package/controller/comms/messages/status/HeaterStateMessage.ts +86 -53
  48. package/controller/comms/messages/status/IntelliChemStateMessage.ts +445 -386
  49. package/controller/comms/messages/status/IntelliValveStateMessage.ts +35 -35
  50. package/controller/comms/messages/status/PumpStateMessage.ts +0 -0
  51. package/controller/comms/messages/status/VersionMessage.ts +0 -0
  52. package/controller/nixie/Nixie.ts +162 -160
  53. package/controller/nixie/NixieEquipment.ts +103 -103
  54. package/controller/nixie/bodies/Body.ts +120 -117
  55. package/controller/nixie/bodies/Filter.ts +135 -135
  56. package/controller/nixie/chemistry/ChemController.ts +2498 -2395
  57. package/controller/nixie/chemistry/Chlorinator.ts +314 -313
  58. package/controller/nixie/circuits/Circuit.ts +248 -210
  59. package/controller/nixie/heaters/Heater.ts +649 -441
  60. package/controller/nixie/pumps/Pump.ts +661 -599
  61. package/controller/nixie/schedules/Schedule.ts +257 -256
  62. package/controller/nixie/valves/Valve.ts +170 -170
  63. package/defaultConfig.json +286 -271
  64. package/issue_template.md +51 -51
  65. package/logger/DataLogger.ts +448 -433
  66. package/logger/Logger.ts +0 -0
  67. package/package.json +56 -54
  68. package/tsconfig.json +25 -25
  69. package/web/Server.ts +522 -31
  70. package/web/bindings/influxDB.json +1022 -894
  71. package/web/bindings/mqtt.json +654 -543
  72. package/web/bindings/mqttAlt.json +684 -574
  73. package/web/bindings/rulesManager.json +54 -54
  74. package/web/bindings/smartThings-Hubitat.json +31 -31
  75. package/web/bindings/valveRelays.json +20 -20
  76. package/web/bindings/vera.json +25 -25
  77. package/web/interfaces/baseInterface.ts +136 -136
  78. package/web/interfaces/httpInterface.ts +124 -122
  79. package/web/interfaces/influxInterface.ts +245 -240
  80. package/web/interfaces/mqttInterface.ts +475 -464
  81. package/web/services/config/Config.ts +181 -152
  82. package/web/services/config/ConfigSocket.ts +0 -0
  83. package/web/services/state/State.ts +118 -7
  84. package/web/services/state/StateSocket.ts +18 -1
  85. package/web/services/utilities/Utilities.ts +42 -42
@@ -1,544 +1,655 @@
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
- },
70
- {
71
- "name": "circuit",
72
- "description": "Populate the circuits topics",
73
- "topics": [
74
- {
75
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;",
76
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
77
- "description": "Bind 'on'/'off' as a message to the state topic."
78
- },
79
- {
80
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;/isOn/string",
81
- "message": "@bind=data.isOn?'on':'off';",
82
- "description": "Bind 'on'/'off' as a message to the topic.",
83
- "enabled": false
84
- },
85
- {
86
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;/isOn/boolean",
87
- "message": "@bind=data.isOn;",
88
- "description": "SAMPLE: Bind the isOn as a message to the topic.",
89
- "enabled": false
90
- },
91
- {
92
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;/lightingTheme",
93
- "message": "{\"lightingTheme\":@bind=data.lightingTheme;}",
94
- "description": "SAMPLE: Bind the lighting theme to the topic.",
95
- "filter": "@bind=data.type.isLight === true;"
96
- },
97
- {
98
- "topic": "state/circuits/@bind=data.id;/customTopicFormatter/@bind=data.name;/isOn",
99
- "message": "@bind=data.isOn;",
100
- "description": "SAMPLE: Bind the isOn as a message to the topic with a custom replacer, qos and retain setting.",
101
- "formatter": [
102
- {
103
- "transform": ".toLowerCase()"
104
- },
105
- {
106
- "regexkey": "\\s",
107
- "replace": "__",
108
- "description": "Remove whitespace and replace with __"
109
- },
110
- {
111
- "regexkey": "\\/",
112
- "replace": "__",
113
- "description": "Remove / and replace with __"
114
- }
115
- ],
116
- "options": { "qos": 2 },
117
- "enabled": false
118
- },
119
- {
120
- "topic": "state/circuits/@bind=data.id;/@bind=data.name;/object",
121
- "message": "@bind=data;",
122
- "description": "SAMPLE: Bind a JSON object as a message to the topic.",
123
- "enabled": false
124
- }
125
- ]
126
- },
127
- {
128
- "name": "virtualCircuit",
129
- "description": "Populate the virtual circuits topics",
130
- "topics": [
131
- {
132
- "topic": "state/virtualcircuits/@bind=data.id;/@bind=data.name;",
133
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
134
- "description": "Bind 'on'/'off' as a message to the state topic."
135
- }
136
- ]
137
- },
138
- {
139
- "name": "valve",
140
- "description": "Populate the valve topics",
141
- "topics": [
142
- {
143
- "topic": "state/valve/@bind=data.id;/@bind=data.name;",
144
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isDiverted?'\"on\"':'\"off\"';,\"isVirtual\":@bind=data.isVirtual? true: false;,\"pinId\": @bind=data.pinId;}",
145
- "description": "Bind 'on'/'off' as a message to the valve state topic."
146
- }
147
- ]
148
- },
149
-
150
- {
151
- "name": "feature",
152
- "description": "Populate the features topics",
153
- "topics": [
154
- {
155
- "topic": "state/features/@bind=data.id;/@bind=data.name;",
156
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
157
- "description": "Bind 'on'/'off' as a message to the state topic."
158
- }
159
- ]
160
- },
161
- {
162
- "name": "temps",
163
- "description": "Populate the temps topics",
164
- "topics": [
165
- {
166
- "topic": "state/temps/air",
167
- "message": "{\"temp\":@bind=data.air;}",
168
- "description": "Send air temp."
169
- },
170
- {
171
- "topic": "state/temps/solar",
172
- "message": "{\"temp\":@bind=data.solar;}",
173
- "description": "Send solar temp.",
174
- "filter": "@bind=typeof data.solar === 'undefined';"
175
- },
176
- {
177
- "topic": "state/temps/units",
178
- "message": "{\"units\":@bind=data.units;}"
179
- }
180
- ]
181
- },
182
- {
183
- "name": "body",
184
- "description": "Populate the body topic",
185
- "topics": [
186
- {
187
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;",
188
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
189
- "description": "Bind 'on'/'off' as a message to the state topic."
190
- },
191
- {
192
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/heatMode",
193
- "message": "{\"heatMode\":@bind=data.heatMode;}",
194
- "description": "Send heat mode."
195
- },
196
- {
197
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/heatStatus",
198
- "message": "{\"heatStatus\":@bind=data.heatStatus;}",
199
- "description": "Send heat status."
200
- },
201
- {
202
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/setPoint",
203
- "message": "{\"setPoint\":@bind=data.setPoint;}",
204
- "description": "Send set point."
205
- },
206
- {
207
- "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/temp",
208
- "message": "{\"temp\":@bind=data.temp;}",
209
- "description": "Send temp."
210
- }
211
- ]
212
- },
213
- {
214
- "name": "chlorinator",
215
- "description": "Populate the chlorinator topic",
216
- "topics": [
217
- {
218
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;",
219
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
220
- "description": "Bind 'on'/'off' as a message to the state topic."
221
- },
222
- {
223
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/currentOutput",
224
- "message": "{\"currentOutput\":@bind=data.currentOutput;}",
225
- "description": "Send current output."
226
- },
227
- {
228
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/poolSetpoint",
229
- "message": "{\"poolSetpoint\":@bind=data.poolSetpoint;}",
230
- "description": "Send pool setpoint."
231
- },
232
- {
233
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/spaSetpoint",
234
- "message": "{\"spaSetpoint\":@bind=data.spaSetpoint;}",
235
- "description": "Send set point."
236
- },
237
- {
238
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/status",
239
- "message": "{\"status\":@bind=data.status;}",
240
- "description": "Send status."
241
- },
242
- {
243
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/superChlor",
244
- "message": "{\"superChlor\":@bind=data.superChlor?'\"on\"':'\"off\"';}",
245
- "description": "Send superChlor."
246
- },
247
- {
248
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/superChlorHours",
249
- "message": "{\"superChlorHours\":@bind=data.superChlorHours;}",
250
- "description": "Send superChlorHours."
251
- },
252
- {
253
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/saltLevel",
254
- "message": "{\"saltLevel\":@bind=data.saltLevel;}",
255
- "description": "Send salt level."
256
- },
257
- {
258
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/type",
259
- "message": "{\"type\":@bind=data.type;}",
260
- "description": "Send type."
261
- },
262
- {
263
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/targetOutput",
264
- "message": "{\"targetOutput\":@bind=data.targetOutput;}",
265
- "description": "Send targetOutput."
266
- }
267
- ]
268
- },
269
- {
270
- "name": "lightGroup",
271
- "description": "Populate the lightGroup topic",
272
- "topics": [
273
- {
274
- "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;",
275
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
276
- "description": "Bind 'on'/'off' as a message to the state topic."
277
- },
278
- {
279
- "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/action",
280
- "message": "{\"action\":@bind=data.action;}"
281
- },
282
- {
283
- "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/lightingTheme",
284
- "message": "{\"lightingTheme\":@bind=data.lightingTheme;}"
285
- },
286
- {
287
- "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/type",
288
- "message": "{\"type\":@bind=data.type;}"
289
- }
290
- ]
291
- },
292
- {
293
- "name": "pump",
294
- "description": "Populate the pumps topic",
295
- "topics": [
296
- {
297
- "topic": "state/pumps/@bind=data.id;/@bind=data.name;",
298
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.flow > 0 || data.rpm > 0?'\"on\"':'\"off\"';}",
299
- "description": "Bind 'on'/'off' as a message to the state topic."
300
- },
301
- {
302
- "topic": "state/pumps/@bind=data.id;/@bind=data.name;/rpm",
303
- "message": "{\"rpm\":@bind=data.rpm;}"
304
- },
305
- {
306
- "topic": "state/pumps/@bind=data.id;/@bind=data.name;/flow",
307
- "message": "{\"flow\":@bind=data.flow;}"
308
- },
309
- {
310
- "topic": "state/pumps/@bind=data.id;/@bind=data.name;/watts",
311
- "message": "{\"watts\":@bind=data.watts;}"
312
- },
313
- {
314
- "topic": "state/pumps/@bind=data.id;/@bind=data.name;/status",
315
- "message": "{\"status\":@bind=data.status;}"
316
- }
317
- ]
318
- },
319
- {
320
- "name": "chemController",
321
- "description": "Populate the chemControllers topic",
322
- "vars": {
323
- "cfg": "@bind=sys.chemControllers.getItemById(data.id).get();"
324
- },
325
- "topics": [
326
- {
327
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/tankLevel",
328
- "message": "@bind=data.ph.tank.level;",
329
- "enabled": true
330
- },
331
- {
332
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/setpoint",
333
- "message": "@bind=data.ph.setpoint;",
334
- "enabled": true
335
- },
336
- {
337
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/level",
338
- "message": "@bind=data.ph.level;",
339
- "enabled": true
340
- },
341
- {
342
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/doseTime",
343
- "message": "@bind=data.ph.doseTime;",
344
- "enabled": true
345
- },
346
- {
347
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/ph/doseVolume",
348
- "message": "@bind=data.ph.doseVolume;",
349
- "enabled": true
350
- },
351
- {
352
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/tankLevel",
353
- "message": "@bind=data.orp.tank.level;",
354
- "enabled": true
355
- },
356
- {
357
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/setpoint",
358
- "message": "@bind=data.orp.setpoint;",
359
- "enabled": true
360
- },
361
- {
362
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/level",
363
- "message": "@bind=data.orp.level;",
364
- "enabled": true
365
- },
366
- {
367
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/demand",
368
- "message": "@bind=data.orp.demand;",
369
- "enabled": true
370
- },
371
- {
372
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/doseTime",
373
- "message": "@bind=data.orp.doseTime;",
374
- "enabled": true
375
- },
376
- {
377
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/doseVolume",
378
- "message": "@bind=data.orp.doseVolume;",
379
- "enabled": true
380
- },
381
- {
382
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/saltLevel",
383
- "message": "@bind=data.orp.saltLevel;",
384
- "enabled": true
385
- },
386
- {
387
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/acidTankLevel",
388
- "message": "{\"acidTankLevel\":@bind=data.ph.tank.level;}"
389
- },
390
- {
391
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpTankLevel",
392
- "message": "{\"orpTankLevel\":@bind=data.orp.tank.level;}"
393
- },
394
- {
395
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDosingTime",
396
- "message": "{\"orpDosingTime\":@bind=data.orp.doseTime;}"
397
- },
398
- {
399
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHDosingTime",
400
- "message": "{\"pHDosingTime\":@bind=data.ph.doseTime;}"
401
- },
402
- {
403
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHDosingVolume",
404
- "message": "{\"pHDosingVolume\":@bind=data.ph.doseVolume;}"
405
- },
406
- {
407
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDosingVolume",
408
- "message": "{\"orpDosingVolume\":@bind=data.orp.doseVolume;}"
409
- },
410
- {
411
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpSetpoint",
412
- "message": "{\"orpSetpoint\":@bind=data.orp.setpoint;}"
413
- },
414
- {
415
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHSetpoint",
416
- "message": "{\"pHSetpoint\":@bind=data.ph.setpoint;}"
417
- },
418
- {
419
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpLevel",
420
- "message": "{\"orpLevel\":@bind=data.orp.level;}"
421
- },
422
- {
423
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/pHLevel",
424
- "message": "{\"pHLevel\":@bind=data.ph.level;}"
425
- },
426
- {
427
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/saltLevel",
428
- "message": "{\"saltLevel\":@bind=data.orp.probe.saltLevel;}"
429
- },
430
- {
431
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/saturationIndex",
432
- "message": "{\"saturationIndex\":@bind=data.saturationIndex;}"
433
- },
434
- {
435
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/status",
436
- "message": "@bind=data.status;"
437
- },
438
- {
439
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/type",
440
- "message": "@bind=data.type;"
441
- },
442
- {
443
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alkalinity",
444
- "message": "@bind=vars.cfg.alkalinity;"
445
- },
446
- {
447
- "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/alkalinity",
448
- "message": "{\"alkalinity\":@bind=vars.cfg.alkalinity;}"
449
- },
450
- {
451
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/calciumHardness",
452
- "message": "@bind=vars.cfg.calciumHardness;"
453
- },
454
- {
455
- "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/calciumHardness",
456
- "message": "@bind=vars.cfg.calciumHardness;"
457
- },
458
- {
459
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/cyanuricAcid",
460
- "message": "@bind=vars.cfg.cyanuricAcid;"
461
- },
462
- {
463
- "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/cyanuricAcid",
464
- "message": "@bind=vars.cfg.cyanuricAcid;"
465
- },
466
- {
467
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/borates",
468
- "message": "@bind=vars.cfg.borates;"
469
- },
470
- {
471
- "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/borates",
472
- "message": "@bind=vars.cfg.borates;"
473
- },
474
- {
475
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/acidDemand",
476
- "message": "@bind=data.ph.demand;"
477
- },
478
- {
479
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDemand",
480
- "message": "@bind=data.orp.demand;"
481
- },
482
- {
483
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/flow",
484
- "message": "@bind=data.alarms.flow;"
485
- },
486
- {
487
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/ph",
488
- "message": "@bind=data.alarms.pH;"
489
- },
490
- {
491
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/orp",
492
- "message": "@bind=data.alarms.orp;"
493
- },
494
- {
495
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/phTank",
496
- "message": "@bind=data.alarms.pHTank;"
497
- },
498
- {
499
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/orpTank",
500
- "message": "@bind=data.alarms.orpTank;"
501
- },
502
- {
503
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/orpProbeFault",
504
- "message": "@bind=data.alarms.orpProbeFault;"
505
- },
506
- {
507
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/pHProbeFault",
508
- "message": "@bind=data.alarms.pHProbeFault;"
509
- },
510
-
511
- {
512
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/waterChemistry",
513
- "message": "@bind=data.warnings.waterChemistry;"
514
- },
515
- {
516
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/pHLockout",
517
- "message": "@bind=data.warnings.pHLockout;"
518
- },
519
- {
520
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/pHDailyLimitReached",
521
- "message": "@bind=data.warnings.pHDailyLimitReached;"
522
- },
523
- {
524
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/orpDailyLimitReached",
525
- "message": "@bind=data.warnings.orpDailyLimitReached;"
526
- },
527
- {
528
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/invalidSetup",
529
- "message": "@bind=data.warnings.invalidSetup;"
530
- },
531
- {
532
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/warnings/chlorinatorCommError",
533
- "message": "@bind=data.warnings.chlorinatorCommError;"
534
- }
535
- ]
536
- },
537
- {
538
- "name": "*",
539
- "description": "DEFAULT: Sends the entire emitted response.",
540
- "body": "@bind=data;",
541
- "enabled": false
542
- }
543
- ]
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
+ ]
544
655
  }