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