nodejs-poolcontroller 7.6.1 → 7.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/.eslintrc.json +44 -44
  2. package/.github/ISSUE_TEMPLATE/1-bug-report.yml +84 -0
  3. package/.github/ISSUE_TEMPLATE/2-docs.md +12 -0
  4. package/.github/ISSUE_TEMPLATE/3-proposal.md +28 -0
  5. package/.github/ISSUE_TEMPLATE/config.yml +8 -0
  6. package/CONTRIBUTING.md +74 -74
  7. package/Changelog +220 -215
  8. package/Dockerfile +17 -17
  9. package/Gruntfile.js +40 -40
  10. package/LICENSE +661 -661
  11. package/README.md +191 -191
  12. package/app.ts +1 -1
  13. package/config/Config.ts +14 -0
  14. package/config/VersionCheck.ts +2 -2
  15. package/controller/Constants.ts +2 -1
  16. package/controller/Equipment.ts +2484 -2459
  17. package/controller/Errors.ts +180 -180
  18. package/controller/Lockouts.ts +502 -436
  19. package/controller/State.ts +106 -30
  20. package/controller/boards/AquaLinkBoard.ts +1000 -0
  21. package/controller/boards/BoardFactory.ts +49 -45
  22. package/controller/boards/EasyTouchBoard.ts +2859 -2653
  23. package/controller/boards/IntelliCenterBoard.ts +4198 -4230
  24. package/controller/boards/IntelliComBoard.ts +63 -63
  25. package/controller/boards/IntelliTouchBoard.ts +273 -241
  26. package/controller/boards/NixieBoard.ts +1728 -1675
  27. package/controller/boards/SystemBoard.ts +4925 -4697
  28. package/controller/comms/Comms.ts +442 -479
  29. package/controller/comms/messages/Messages.ts +171 -25
  30. package/controller/comms/messages/config/ChlorinatorMessage.ts +5 -2
  31. package/controller/comms/messages/config/CircuitGroupMessage.ts +0 -0
  32. package/controller/comms/messages/config/CircuitMessage.ts +1 -0
  33. package/controller/comms/messages/config/ConfigMessage.ts +0 -0
  34. package/controller/comms/messages/config/CoverMessage.ts +0 -0
  35. package/controller/comms/messages/config/CustomNameMessage.ts +30 -30
  36. package/controller/comms/messages/config/EquipmentMessage.ts +0 -0
  37. package/controller/comms/messages/config/ExternalMessage.ts +0 -0
  38. package/controller/comms/messages/config/FeatureMessage.ts +0 -0
  39. package/controller/comms/messages/config/GeneralMessage.ts +0 -0
  40. package/controller/comms/messages/config/HeaterMessage.ts +142 -10
  41. package/controller/comms/messages/config/IntellichemMessage.ts +0 -0
  42. package/controller/comms/messages/config/OptionsMessage.ts +4 -21
  43. package/controller/comms/messages/config/PumpMessage.ts +53 -35
  44. package/controller/comms/messages/config/RemoteMessage.ts +0 -0
  45. package/controller/comms/messages/config/ScheduleMessage.ts +350 -347
  46. package/controller/comms/messages/config/SecurityMessage.ts +0 -0
  47. package/controller/comms/messages/config/ValveMessage.ts +1 -1
  48. package/controller/comms/messages/status/ChlorinatorStateMessage.ts +38 -86
  49. package/controller/comms/messages/status/EquipmentStateMessage.ts +58 -22
  50. package/controller/comms/messages/status/HeaterStateMessage.ts +116 -86
  51. package/controller/comms/messages/status/IntelliChemStateMessage.ts +445 -445
  52. package/controller/comms/messages/status/IntelliValveStateMessage.ts +35 -35
  53. package/controller/comms/messages/status/PumpStateMessage.ts +23 -1
  54. package/controller/comms/messages/status/VersionMessage.ts +0 -0
  55. package/controller/nixie/Nixie.ts +162 -162
  56. package/controller/nixie/NixieEquipment.ts +103 -103
  57. package/controller/nixie/bodies/Body.ts +120 -120
  58. package/controller/nixie/bodies/Filter.ts +135 -135
  59. package/controller/nixie/chemistry/ChemController.ts +2511 -2498
  60. package/controller/nixie/chemistry/Chlorinator.ts +363 -314
  61. package/controller/nixie/circuits/Circuit.ts +261 -248
  62. package/controller/nixie/heaters/Heater.ts +650 -648
  63. package/controller/nixie/pumps/Pump.ts +906 -661
  64. package/controller/nixie/schedules/Schedule.ts +313 -257
  65. package/controller/nixie/valves/Valve.ts +170 -170
  66. package/defaultConfig.json +306 -286
  67. package/logger/DataLogger.ts +448 -448
  68. package/logger/Logger.ts +0 -0
  69. package/package.json +56 -56
  70. package/tsconfig.json +25 -25
  71. package/web/Server.ts +92 -47
  72. package/web/bindings/aqualinkD.json +505 -0
  73. package/web/bindings/influxDB.json +1051 -1021
  74. package/web/bindings/mqtt.json +702 -654
  75. package/web/bindings/mqttAlt.json +731 -684
  76. package/web/bindings/rulesManager.json +54 -54
  77. package/web/bindings/smartThings-Hubitat.json +31 -31
  78. package/web/bindings/valveRelays.json +20 -20
  79. package/web/bindings/vera.json +25 -25
  80. package/web/interfaces/baseInterface.ts +137 -136
  81. package/web/interfaces/httpInterface.ts +145 -124
  82. package/web/interfaces/influxInterface.ts +276 -245
  83. package/web/interfaces/mqttInterface.ts +535 -475
  84. package/web/services/config/Config.ts +39 -18
  85. package/web/services/config/ConfigSocket.ts +0 -0
  86. package/web/services/state/State.ts +10 -0
  87. package/web/services/state/StateSocket.ts +4 -4
  88. package/web/services/utilities/Utilities.ts +44 -42
  89. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -52
  90. package/config copy.json +0 -300
  91. package/issue_template.md +0 -52
@@ -0,0 +1,505 @@
1
+ {
2
+ "context": {
3
+ "name": "AqualinkD",
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='aqualinkd_njsPC_'+ Math.random().toString(16).substr(2, 8);"
38
+ }
39
+ },
40
+ "subscriptions": [
41
+ {
42
+ "topic": "Aux_1",
43
+ "description": "State of the Aux_1 circuit on AqualinkD",
44
+ "processor": [ "sys.board.circuits.setCircuitStateAsync(2, parseInt(value, 10) === 1);" ]
45
+ },
46
+ {
47
+ "topic": "Aux_2",
48
+ "description": "State of the Aux_2 circuit on AqualinkD",
49
+ "processor": [ "sys.board.circuits.setCircuitStateAsync(3, parseInt(value, 10) === 1);" ]
50
+ },
51
+ {
52
+ "topic": "Aux_3",
53
+ "description": "State of the Aux_3 circuit on AqualinkD",
54
+ "processor": [ "sys.board.circuits.setCircuitStateAsync(4, parseInt(value, 10) === 1);" ]
55
+ },
56
+ {
57
+ "topic": "Aux_4",
58
+ "description": "State of the Aux_4 circuit on AqualinkD",
59
+ "processor": [ "sys.board.circuits.setCircuitStateAsync(5, parseInt(value, 10) === 1);" ]
60
+ },
61
+ {
62
+ "topic": "Aux_5",
63
+ "description": "State of the Aux_5 circuit on AqualinkD",
64
+ "processor": [ "sys.board.circuits.setCircuitStateAsync(7, parseInt(value, 10) === 1);" ]
65
+ },
66
+ {
67
+ "topic": "Aux_6",
68
+ "description": "State of the Aux_1 circuit on AqualinkD",
69
+ "processor": [ "sys.board.circuits.setCircuitStateAsync(8, parseInt(value, 10) === 1);" ]
70
+ },
71
+ {
72
+ "topic": "Aux_7",
73
+ "description": "State of the Aux_7 circuit on AqualinkD",
74
+ "processor": [ "sys.board.circuits.setCircuitStateAsync(9, parseInt(value, 10) === 1);" ]
75
+ },
76
+ {
77
+ "topic": "Aux_8",
78
+ "description": "State of the Aux_8 circuit on AqualinkD",
79
+ "processor": [ "sys.board.circuits.setCircuitStateAsync(10, parseInt(value, 10) === 1);" ]
80
+ },
81
+ {
82
+ "topic": "Aux_B1",
83
+ "description": "State of the Aux_B1 feature on AqualinkD",
84
+ "processor": [ "sys.board.features.setFeatureStateAsync(129, parseInt(value, 10) === 1);" ]
85
+ },
86
+ {
87
+ "topic": "Aux_B2",
88
+ "description": "State of the Aux_B2 feature on AqualinkD",
89
+ "processor": [ "sys.board.features.setFeatureStateAsync(130, parseInt(value, 10) === 1);" ]
90
+ },
91
+ {
92
+ "topic": "Aux_B3",
93
+ "description": "State of the Aux_B3 feature on AqualinkD",
94
+ "processor": [ "sys.board.features.setFeatureStateAsync(131, parseInt(value, 10) === 1);" ]
95
+ },
96
+ {
97
+ "topic": "Aux_B4",
98
+ "description": "State of the Aux_B4 feature on AqualinkD",
99
+ "processor": [ "sys.board.features.setFeatureStateAsync(132, parseInt(value, 10) === 1);" ]
100
+ },
101
+ {
102
+ "topic": "Aux_B5",
103
+ "description": "State of the Aux_B5 feature on AqualinkD",
104
+ "processor": [ "sys.board.features.setFeatureStateAsync(133, parseInt(value, 10) === 1);" ]
105
+ },
106
+ {
107
+ "topic": "Aux_B6",
108
+ "description": "State of the Aux_B6 feature on AqualinkD",
109
+ "processor": [ "sys.board.features.setFeatureStateAsync(134, parseInt(value, 10) === 1);" ]
110
+ },
111
+ {
112
+ "topic": "Aux_B7",
113
+ "description": "State of the Aux_B7 feature on AqualinkD",
114
+ "processor": [ "sys.board.features.setFeatureStateAsync(135, parseInt(value, 10) === 1);" ]
115
+ },
116
+ {
117
+ "topic": "Aux_B8",
118
+ "description": "State of the Aux_B8 feature on AqualinkD",
119
+ "processor": [ "sys.board.features.setFeatureStateAsync(136, parseInt(value, 10) === 1);" ]
120
+ },
121
+ {
122
+ "topic": "Filter_Pump",
123
+ "description": "State of the Filter_Pump on AqualinkD",
124
+ "processor": [
125
+ "if(state.circuits.getItemById(1).isOn === false) ",
126
+ " sys.board.circuits.setCircuitStateAsync(6, parseInt(value, 10) === 1);",
127
+ "else sys.board.circuits.setCircuitStateAsync(1, parseInt(value, 10) === 1);"
128
+ ]
129
+ },
130
+ {
131
+ "topic": "Spa_Mode",
132
+ "description": "The body mode for the controller. If 1 then we are in spa mode otherwise we are in pool mode.",
133
+ "processor": [ "sys.board.circuits.setCircuitStateAsync(1, parseInt(value, 10) === 1);" ]
134
+ },
135
+ {
136
+ "topic": "Temperature/Pool",
137
+ "description": "The current temperature emitted by the controller for the pool. However, we only want to set this when the pool circuit is on.",
138
+ "processor": [
139
+ "let temp = ctx.util.convert.temperature.convertUnits(parseFloat(value), 'F', sys.board.valueMaps.tempUnits.getName(state.temps.units));",
140
+ "state.temps.bodies.getItemById(1).temp = temp;",
141
+ "if(state.circuits.getItemById(6).isOn) sys.board.system.setTempsAsync({ waterSensor1: temp });"
142
+ ]
143
+ },
144
+ {
145
+ "topic": "Temperature/Spa",
146
+ "description": "The current temperature emitted by the controller for the spa. However, we only want to set this when the spa circuit is on.",
147
+ "processor": [
148
+ "let temp = ctx.util.convert.temperature.convertUnits(parseFloat(value), 'F', sys.board.valueMaps.tempUnits.getName(state.temps.units));",
149
+ "state.temps.bodies.getItemById(2).temp = temp;",
150
+ "if(state.circuits.getItemById(1).isOn) sys.board.system.setTempsAsync({ waterSensor1: temp });"
151
+ ]
152
+ },
153
+ {
154
+ "topic": "Temperature/Air",
155
+ "description": "The current temperature emitted by the controller for air temperature.",
156
+ "processor": [
157
+ "let temp = ctx.util.convert.temperature.convertUnits(parseFloat(value), 'F', sys.board.valueMaps.tempUnits.getName(state.temps.units));",
158
+ "sys.board.system.setTempsAsync({ air: temp });"
159
+ ]
160
+ },
161
+ {
162
+ "topic": "Temperature/Solar",
163
+ "description": "The current temperature emitted by the controller for solar.",
164
+ "processor": [
165
+ "let temp = ctx.util.convert.temperature.convertUnits(parseFloat(value), 'F', sys.board.valueMaps.tempUnits.getName(state.temps.units));",
166
+ "sys.board.system.setTempsAsync({ solarSensor1: temp });"
167
+ ]
168
+ },
169
+ {
170
+ "topic": "Filter_Pump/RPM",
171
+ "description": "The RPM for the first pump",
172
+ "processor": [ "state.pumps.getPumpByAddress(96).rpm = parseInt(value, 10);" ]
173
+ },
174
+ {
175
+ "topic": "Filter_Pump/Watts",
176
+ "description": "The Watts for the first pump",
177
+ "processor": [ "state.pumps.getPumpByAddress(96).watts = parseInt(value, 10);" ]
178
+ },
179
+ {
180
+ "topic": "Filter_Pump/GPM",
181
+ "description": "The flow for the first pump",
182
+ "processor": [ "state.pumps.getPumpByAddress(96).flow = parseInt(value, 10);" ]
183
+ },
184
+ {
185
+ "topic": "Pump_1/RPM",
186
+ "description": "The RPM for aux the pump",
187
+ "processor": [ "state.pumps.getPumpByAddress(97).rpm = parseInt(value, 10);" ]
188
+ },
189
+ {
190
+ "topic": "Pump_1/Watts",
191
+ "description": "The Watts for aux the pump",
192
+ "processor": [ "state.pumps.getPumpByAddress(97).watts = parseInt(value, 10);" ]
193
+ },
194
+ {
195
+ "topic": "Pump_1/GPM",
196
+ "description": "The flow for the aux pump",
197
+ "processor": [ "state.pumps.getPumpByAddress(97).flow = parseInt(value, 10);" ]
198
+ },
199
+ {
200
+ "topic": "Pump_2/RPM",
201
+ "description": "The RPM for aux the pump",
202
+ "processor": [ "state.pumps.getPumpByAddress(98).rpm = parseInt(value, 10);" ]
203
+ },
204
+ {
205
+ "topic": "Pump_2/Watts",
206
+ "description": "The Watts for aux the pump",
207
+ "processor": [ "state.pumps.getPumpByAddress(98).watts = parseInt(value, 10);" ]
208
+ },
209
+ {
210
+ "topic": "Pump_2/GPM",
211
+ "description": "The flow for the aux pump",
212
+ "processor": [ "state.pumps.getPumpByAddress(98).flow = parseInt(value, 10);" ]
213
+ },
214
+ {
215
+ "topic": "Pump_3/RPM",
216
+ "description": "The RPM for aux the pump",
217
+ "processor": [ "state.pumps.getPumpByAddress(99).rpm = parseInt(value, 10);" ]
218
+ },
219
+ {
220
+ "topic": "Pump_3/Watts",
221
+ "description": "The Watts for aux the pump",
222
+ "processor": [ "state.pumps.getPumpByAddress(99).watts = parseInt(value, 10);" ]
223
+ },
224
+ {
225
+ "topic": "Pump_3/GPM",
226
+ "description": "The flow for the aux pump",
227
+ "processor": [ "state.pumps.getPumpByAddress(99).flow = parseInt(value, 10);" ]
228
+ },
229
+ {
230
+ "topic": "Pump_4/RPM",
231
+ "description": "The RPM for aux the pump",
232
+ "processor": [ "state.pumps.getPumpByAddress(100).rpm = parseInt(value, 10);" ]
233
+ },
234
+ {
235
+ "topic": "Pump_4/Watts",
236
+ "description": "The Watts for aux the pump",
237
+ "processor": [ "state.pumps.getPumpByAddress(100).watts = parseInt(value, 10);" ]
238
+ },
239
+ {
240
+ "topic": "Pump_4/GPM",
241
+ "description": "The flow for the aux pump",
242
+ "processor": [ "state.pumps.getPumpByAddress(100).flow = parseInt(value, 10);" ]
243
+ },
244
+ {
245
+ "topic": "Pump_5/RPM",
246
+ "description": "The RPM for aux the pump",
247
+ "processor": [ "state.pumps.getPumpByAddress(101).rpm = parseInt(value, 10);" ]
248
+ },
249
+ {
250
+ "topic": "Pump_5/Watts",
251
+ "description": "The Watts for aux the pump",
252
+ "processor": [ "state.pumps.getPumpByAddress(101).watts = parseInt(value, 10);" ]
253
+ },
254
+ {
255
+ "topic": "Pump_5/GPM",
256
+ "description": "The flow for the aux pump",
257
+ "processor": [ "state.pumps.getPumpByAddress(101).flow = parseInt(value, 10);" ]
258
+ },
259
+ {
260
+ "topic": "Pump_6/RPM",
261
+ "description": "The RPM for aux the pump",
262
+ "processor": [ "state.pumps.getPumpByAddress(102).rpm = parseInt(value, 10);" ]
263
+ },
264
+ {
265
+ "topic": "Pump_6/Watts",
266
+ "description": "The Watts for aux the pump",
267
+ "processor": [ "state.pumps.getPumpByAddress(102).watts = parseInt(value, 10);" ]
268
+ },
269
+ {
270
+ "topic": "Pump_6/GPM",
271
+ "description": "The flow for the aux pump",
272
+ "processor": [ "state.pumps.getPumpByAddress(102).flow = parseInt(value, 10);" ]
273
+ },
274
+ {
275
+ "topic": "Pump_7/RPM",
276
+ "description": "The RPM for aux the pump",
277
+ "processor": [ "state.pumps.getPumpByAddress(103).rpm = parseInt(value, 10);" ]
278
+ },
279
+ {
280
+ "topic": "Pump_7/Watts",
281
+ "description": "The Watts for aux the pump",
282
+ "processor": [ "state.pumps.getPumpByAddress(103).watts = parseInt(value, 10);" ]
283
+ },
284
+ {
285
+ "topic": "Pump_7/GPM",
286
+ "description": "The flow for the aux pump",
287
+ "processor": [ "state.pumps.getPumpByAddress(103).flow = parseInt(value, 10);" ]
288
+ },
289
+ {
290
+ "topic": "SWG/PPM",
291
+ "description": "The salt level for the chlorinator",
292
+ "processor": [ "state.chlorinators.getItemById(1).saltLevel = parseInt(value, 10);" ]
293
+ },
294
+ {
295
+ "topic": "SWG/fullstatus",
296
+ "description": "The current status for the chlorinator",
297
+ "processor": [
298
+ "switch(parseInt(value, 10)) {",
299
+ "case 8: state.chlorinators.getItemById(1).status = 5;",
300
+ "case 9: state.chlorinators.getItemById(1).status = 0;",
301
+ "case 16: state.chlorinators.getItemById(1).status = 4;",
302
+ "case 32: state.chlorinators.getItemById(1).status = 6;",
303
+ "case 64: state.chlorinators.getItemById(1).status = 7;",
304
+ "case 128: state.chlorinators.getItemById(1).status = 8;",
305
+ "case 255: state.chlorinators.getItemById(1).status = 128;",
306
+ "default: state.chlorinators.getItemById(1).status = parseInt(value, 10); }"
307
+ ]
308
+ },
309
+ {
310
+ "topic": "Pool_Heater/enabled",
311
+ "description": "The current heat mode for the pool heater",
312
+ "processor": [ "sys.bodies.getItemById(1).heatMode = state.temps.bodies.getItemById(1).heatMode = parseInt(value, 10) === 1 ? 2 : 1;" ]
313
+ },
314
+ {
315
+ "topic": "Spa_Heater/enabled",
316
+ "description": "The current heat mode for the spa heater",
317
+ "processor": [ "sys.bodies.getItemById(2).heatMode = state.temps.bodies.getItemById(2).heatMode = parseInt(value, 10) === 1 ? 2 : 1;" ]
318
+ },
319
+ {
320
+ "topic": "Pool_Heater/setpoint",
321
+ "description": "The setpoint for the pool body",
322
+ "processor": [
323
+ "let temp = ctx.util.convert.temperature.convertUnits(parseFloat(value), 'F', sys.board.valueMaps.tempUnits.getName(state.temps.units));",
324
+ "let body = sys.bodies.getItemById(1); sys.board.bodies.setHeatSetpointAsync(body, parseInt(temp, 10));"
325
+ ]
326
+ },
327
+ {
328
+ "topic": "Spa_Heater/setpoint",
329
+ "description": "The setpoint for the spa body",
330
+ "processor": [
331
+ "let temp = ctx.util.convert.temperature.convertUnits(parseFloat(value), 'F', sys.board.valueMaps.tempUnits.getName(state.temps.units));",
332
+ "let body = sys.bodies.getItemById(2); sys.board.bodies.setHeatSetpointAsync(body, parseInt(temp, 10));"
333
+ ]
334
+ },
335
+ {
336
+ "topic": "Pool_Heater",
337
+ "description": "The heat status for the pool heater",
338
+ "processor": [ "let body = state.temps.bodies.getItemById(1); body.heatStatus = parseInt(value, 10);" ]
339
+ },
340
+ {
341
+ "topic": "Spa_Heater",
342
+ "description": "The heat status for the spa heater",
343
+ "processor": [ "let body = state.temps.bodies.getItemById(2); body.heatStatus = parseInt(value, 10);" ]
344
+ },
345
+
346
+ {
347
+ "topic": "SWG/Percent",
348
+ "description": "The current status for the chlorinator",
349
+ "processor": [ "sys.chlorinators.getItemById(1).poolSetpoint = state.chlorinators.getItemById(1).poolSetpoint = parseInt(value, 10);" ]
350
+ },
351
+ {
352
+ "topic": "Freeze_Protect/setpoint",
353
+ "description": "The current freeze protection setpoint",
354
+ "processor": [
355
+ "let temp = ctx.util.temperature.convertUnits(parseFloat(value), 'F', sys.board.valueMaps.tempUnits.getName(state.temps.units));",
356
+ "sys.general.options.freezeThreshold = parseInt(temp, 10);"
357
+ ]
358
+ },
359
+ {
360
+ "topic": "Freeze_Protect",
361
+ "description": "The current freeze protection setpoint",
362
+ "processor": [ "state.freeze = parseInt(value, 10) === 1;" ]
363
+ }
364
+ ],
365
+ "events": [
366
+ {
367
+ "name": "config",
368
+ "description": "Don't flood the MQTT bus.",
369
+ "enabled": false
370
+ },
371
+ {
372
+ "name": "circuit",
373
+ "description": "Populate the circuits topics",
374
+ "topics": [
375
+ {
376
+ "topic": "Filter_Pump/set",
377
+ "message": "@bind=data.isOn ? 1 : 0;",
378
+ "description": "Bind the state",
379
+ "filter": "@bind=data.id; === 6;"
380
+ },
381
+ {
382
+ "topic": "Spa_Mode/set",
383
+ "message": "@bind=data.isOn ? 1 : 0;",
384
+ "description": "Bind the state",
385
+ "filter": "@bind=data.id; === 1;"
386
+ },
387
+ {
388
+ "topic": "Aux_1/set",
389
+ "message": "@bind=data.isOn ? 1 : 0;",
390
+ "description": "Bind the state",
391
+ "filter": "@bind=data.id; === 2;"
392
+ },
393
+ {
394
+ "topic": "Aux_2/set",
395
+ "message": "@bind=data.isOn ? 1 : 0;",
396
+ "description": "Bind the state",
397
+ "filter": "@bind=data.id; === 3;"
398
+ },
399
+ {
400
+ "topic": "Aux_3/set",
401
+ "message": "@bind=data.isOn ? 1 : 0;",
402
+ "description": "Bind the state",
403
+ "filter": "@bind=data.id; === 4;"
404
+ },
405
+ {
406
+ "topic": "Aux_4/set",
407
+ "message": "@bind=data.isOn ? 1 : 0;",
408
+ "description": "Bind the state",
409
+ "filter": "@bind=data.id; === 5;"
410
+ },
411
+ {
412
+ "topic": "Aux_5/set",
413
+ "message": "@bind=data.isOn ? 1 : 0;",
414
+ "description": "Bind the state",
415
+ "filter": "@bind=data.id; === 7;"
416
+ },
417
+ {
418
+ "topic": "Aux_6/set",
419
+ "message": "@bind=data.isOn ? 1 : 0;",
420
+ "description": "Bind the state",
421
+ "filter": "@bind=data.id; === 8;"
422
+ },
423
+ {
424
+ "topic": "Aux_7/set",
425
+ "message": "@bind=data.isOn ? 1 : 0;",
426
+ "description": "Bind the state",
427
+ "filter": "@bind=data.id; === 9;"
428
+ },
429
+ {
430
+ "topic": "Aux_8/set",
431
+ "message": "@bind=data.isOn; ? 1 : 0;",
432
+ "description": "Bind the state",
433
+ "filter": "@bind=data.id === 10;"
434
+ }
435
+ ]
436
+ },
437
+ {
438
+ "name": "feature",
439
+ "description": "Populate the features topics",
440
+ "topics": [
441
+ {
442
+ "topic": "Aux_B@bind=data.id - 128;/set",
443
+ "message": "@bind=data.isOn ? 1 : 0;",
444
+ "description": "Bind the state"
445
+ }
446
+ ]
447
+ },
448
+ {
449
+ "name": "body",
450
+ "description": "Populate the body topic",
451
+ "filter": "@bind=data.isActive;",
452
+ "topics": [
453
+ {
454
+ "topic": "Pool_Heater/setpoint/set",
455
+ "message": "@bind=data.setPoint;",
456
+ "description": "Set the heat setpoint for the pool",
457
+ "filter": "@bind=data.id; === 1;",
458
+ "processor": [
459
+ "let units = sys.board.valueMaps.tempUnits.getName(state.temps.units);",
460
+ "return ctx.util.convert.temperature.convertUnits(data.setPoint, units, 'F');"
461
+ ]
462
+ },
463
+ {
464
+ "topic": "Spa_Heater/setpoint/set",
465
+ "message": "@bind=data.setPoint;",
466
+ "description": "Set the heat setpoint for the spa",
467
+ "filter": "@bind=data.id; === 2;",
468
+ "processor": [
469
+ "let units = sys.board.valueMaps.tempUnits.getName(state.temps.units);",
470
+ "return ctx.util.convert.temperature.convertUnits(data.setPoint, units, 'F');"
471
+ ]
472
+ },
473
+ {
474
+ "topic": "Pool_Heater/set",
475
+ "message": "@bind=data.heatMode.val === 2 ? 1 : 0;",
476
+ "description": "Bind the state",
477
+ "filter": "@bind=data.id === 1;"
478
+ },
479
+ {
480
+ "topic": "Spa_Heater/set",
481
+ "message": "@bind=data.heatMode.val === 2 ? 1 : 0;",
482
+ "description": "Bind the state",
483
+ "filter": "@bind=data.id === 2;"
484
+ }
485
+
486
+ ]
487
+ },
488
+ {
489
+ "name": "chlorinator",
490
+ "description": "Populate the chlorinator topic",
491
+ "topics": [
492
+ {
493
+ "topic": "SWG/Percent/set",
494
+ "message": "@bind=data.superChlor ? 100 : data.disabled ? 0 : data.poolSetpoint;",
495
+ "description": "Bind the setpoint topic. Unfortunately aqualink only supports one setpoint."
496
+ }
497
+ ]
498
+ },
499
+ {
500
+ "name": "pump",
501
+ "description": "Populate the pumps topic. We will need to figure this one out. Perhaps if the RS485 comm port is disabled we don't try to send anything.",
502
+ "topics": []
503
+ }
504
+ ]
505
+ }