nodejs-poolcontroller 7.2.0 → 7.5.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 (64) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
  2. package/Changelog +13 -0
  3. package/Dockerfile +1 -0
  4. package/README.md +5 -5
  5. package/app.ts +11 -0
  6. package/config/Config.ts +3 -0
  7. package/config/VersionCheck.ts +8 -4
  8. package/controller/Constants.ts +165 -9
  9. package/controller/Equipment.ts +186 -65
  10. package/controller/Errors.ts +22 -1
  11. package/controller/State.ts +273 -57
  12. package/controller/boards/EasyTouchBoard.ts +194 -95
  13. package/controller/boards/IntelliCenterBoard.ts +115 -42
  14. package/controller/boards/IntelliTouchBoard.ts +104 -30
  15. package/controller/boards/NixieBoard.ts +155 -53
  16. package/controller/boards/SystemBoard.ts +1529 -514
  17. package/controller/comms/Comms.ts +219 -42
  18. package/controller/comms/messages/Messages.ts +16 -4
  19. package/controller/comms/messages/config/ChlorinatorMessage.ts +13 -3
  20. package/controller/comms/messages/config/CircuitGroupMessage.ts +6 -0
  21. package/controller/comms/messages/config/CircuitMessage.ts +1 -1
  22. package/controller/comms/messages/config/CoverMessage.ts +1 -0
  23. package/controller/comms/messages/config/EquipmentMessage.ts +4 -0
  24. package/controller/comms/messages/config/ExternalMessage.ts +43 -25
  25. package/controller/comms/messages/config/FeatureMessage.ts +8 -1
  26. package/controller/comms/messages/config/GeneralMessage.ts +8 -0
  27. package/controller/comms/messages/config/HeaterMessage.ts +15 -9
  28. package/controller/comms/messages/config/IntellichemMessage.ts +4 -1
  29. package/controller/comms/messages/config/OptionsMessage.ts +13 -1
  30. package/controller/comms/messages/config/PumpMessage.ts +4 -20
  31. package/controller/comms/messages/config/RemoteMessage.ts +4 -0
  32. package/controller/comms/messages/config/ScheduleMessage.ts +11 -0
  33. package/controller/comms/messages/config/SecurityMessage.ts +1 -0
  34. package/controller/comms/messages/config/ValveMessage.ts +12 -2
  35. package/controller/comms/messages/status/ChlorinatorStateMessage.ts +14 -6
  36. package/controller/comms/messages/status/EquipmentStateMessage.ts +78 -24
  37. package/controller/comms/messages/status/HeaterStateMessage.ts +25 -5
  38. package/controller/comms/messages/status/IntelliChemStateMessage.ts +55 -26
  39. package/controller/nixie/Nixie.ts +18 -16
  40. package/controller/nixie/NixieEquipment.ts +6 -6
  41. package/controller/nixie/bodies/Body.ts +7 -4
  42. package/controller/nixie/bodies/Filter.ts +7 -4
  43. package/controller/nixie/chemistry/ChemController.ts +800 -283
  44. package/controller/nixie/chemistry/Chlorinator.ts +22 -14
  45. package/controller/nixie/circuits/Circuit.ts +42 -7
  46. package/controller/nixie/heaters/Heater.ts +303 -30
  47. package/controller/nixie/pumps/Pump.ts +57 -30
  48. package/controller/nixie/schedules/Schedule.ts +10 -7
  49. package/controller/nixie/valves/Valve.ts +7 -5
  50. package/defaultConfig.json +32 -1
  51. package/issue_template.md +1 -1
  52. package/logger/DataLogger.ts +37 -22
  53. package/package.json +20 -18
  54. package/web/Server.ts +529 -31
  55. package/web/bindings/influxDB.json +157 -5
  56. package/web/bindings/mqtt.json +112 -13
  57. package/web/bindings/mqttAlt.json +109 -11
  58. package/web/interfaces/baseInterface.ts +2 -1
  59. package/web/interfaces/httpInterface.ts +2 -0
  60. package/web/interfaces/influxInterface.ts +103 -54
  61. package/web/interfaces/mqttInterface.ts +16 -5
  62. package/web/services/config/Config.ts +179 -43
  63. package/web/services/state/State.ts +51 -5
  64. package/web/services/state/StateSocket.ts +19 -2
@@ -77,6 +77,66 @@
77
77
  }
78
78
  ]
79
79
  },
80
+ {
81
+ "name": "chemicalDose",
82
+ "points": [
83
+ {
84
+ "measurement": "chemicalDose",
85
+ "description": "Active doses recorded by chemical dosed",
86
+ "series": {
87
+ "value": "@bind=data.start;"
88
+ },
89
+ "tags": [
90
+ {
91
+ "name": "chemical",
92
+ "value": "@bind=data.chem;"
93
+ }
94
+ ],
95
+ "fields": [
96
+ {
97
+ "name": "volumeDosed",
98
+ "value": "@bind=data.volumeDosed;",
99
+ "type": "float"
100
+ },
101
+ {
102
+ "name": "timeDosed",
103
+ "value": "@bind=data.timeDosed;",
104
+ "type": "float"
105
+ },
106
+ {
107
+ "name": "id",
108
+ "value": "@bind=data.id;",
109
+ "type": "int"
110
+ },
111
+ {
112
+ "name": "demand",
113
+ "value": "@bind=data.demand;",
114
+ "type": "float"
115
+ },
116
+ {
117
+ "name": "setpoint",
118
+ "value": "@bind=data.setpoint;",
119
+ "type": "float"
120
+ },
121
+ {
122
+ "name": "method",
123
+ "value": "@bind=data.method;",
124
+ "type": "string"
125
+ },
126
+ {
127
+ "name": "status",
128
+ "value": "@bind=data.status;",
129
+ "type": "string"
130
+ },
131
+ {
132
+ "name": "end",
133
+ "value": "@bind=data.end;",
134
+ "type": "date"
135
+ }
136
+ ]
137
+ }
138
+ ]
139
+ },
80
140
  {
81
141
  "name": "chemController",
82
142
  "vars": {
@@ -127,7 +187,7 @@
127
187
  },
128
188
  {
129
189
  "name": "pump is dosing",
130
- "value": "@bind=data.ph.pump.isDosing?1:0;",
190
+ "value": "@bind=typeof data.ph.pump.isDosing !== 'undefined'?data.ph.pump.isDosing?1:0:0;",
131
191
  "type": "int"
132
192
  },
133
193
  {
@@ -291,7 +351,7 @@
291
351
  },
292
352
  {
293
353
  "name": "pump is dosing",
294
- "value": "@bind=data.orp.pump.isDosing?1:0;",
354
+ "value": "@bind=typeof data.orp.pump.isDosing !== 'undefined'?data.orp.pump.isDosing?1:0:0;",
295
355
  "type": "int"
296
356
  },
297
357
  {
@@ -408,6 +468,11 @@
408
468
  "name": "volume dosed",
409
469
  "value": "@bind=data.ph.volumeDosed;",
410
470
  "type": "int"
471
+ },
472
+ {
473
+ "name": "orp demand",
474
+ "value": "@bind=data.orp.demand;",
475
+ "type": "int"
411
476
  }
412
477
  ]
413
478
  },
@@ -542,8 +607,6 @@
542
607
  }
543
608
  ]
544
609
  },
545
-
546
-
547
610
  {
548
611
  "name": "circuit",
549
612
  "description": "Bind circuit emit",
@@ -816,6 +879,11 @@
816
879
  "name": "spaSetpoint",
817
880
  "value": "@bind=data.spaSetpoint;",
818
881
  "type": "int"
882
+ },
883
+ {
884
+ "name": "target output",
885
+ "value": "@bind=data.targetOutput;",
886
+ "type": "int"
819
887
  }
820
888
  ]
821
889
  }
@@ -825,6 +893,90 @@
825
893
  "name": "config",
826
894
  "description": "Not used for updates",
827
895
  "enabled": false
896
+ },
897
+ {
898
+ "name": "filter",
899
+ "description": "Bind filter to measurements",
900
+ "points": [
901
+ {
902
+ "measurement": "filter",
903
+ "tags": [
904
+ {
905
+ "name": "units",
906
+ "value": "@bind=data.pressureUnits.desc;"
907
+ },
908
+ {
909
+ "name": "filterType",
910
+ "value": "@bind=data.filterType.desc;"
911
+ },
912
+ {
913
+ "name": "body",
914
+ "value": "@bind=data.body.desc;"
915
+ },
916
+ {
917
+ "name": "name",
918
+ "value": "@bind=data.name;"
919
+ },
920
+ {
921
+ "name": "id",
922
+ "value": "@bind=data.id;"
923
+ }
924
+ ],
925
+ "fields": [
926
+ {
927
+ "name": "isOn",
928
+ "value": "@bind=data.isOn;",
929
+ "type": "boolean"
930
+ },
931
+ {
932
+ "name": "isOnVal",
933
+ "value": "@bind=data.isOn?1:0;",
934
+ "type": "integer"
935
+ },
936
+ {
937
+ "name": "pressure",
938
+ "value": "@bind=data.pressure;",
939
+ "type": "float"
940
+ },
941
+ {
942
+ "name": "referencePressure",
943
+ "value": "@bind=data.refPressure;",
944
+ "type": "float"
945
+ },
946
+ {
947
+ "name": "cleanPercentage",
948
+ "value": "@bind=data.cleanPercentage;",
949
+ "type": "float"
950
+ }
951
+ ]
952
+ }
953
+ ]
954
+ },
955
+ {
956
+ "name": "cover",
957
+ "description": "Bind cover to measurements",
958
+ "points": [
959
+ {
960
+ "measurement": "cover",
961
+ "tags": [
962
+ {
963
+ "name": "name",
964
+ "value": "@bind=data.name;"
965
+ },
966
+ {
967
+ "name": "id",
968
+ "value": "@bind=data.id;"
969
+ }
970
+ ],
971
+ "fields": [
972
+ {
973
+ "name": "isClosed",
974
+ "value": "@bind=data.isClosed;",
975
+ "type": "boolean"
976
+ }
977
+ ]
978
+ }
979
+ ]
828
980
  }
829
981
  ]
830
- }
982
+ }
@@ -64,6 +64,10 @@
64
64
  {
65
65
  "topic": "state/mode",
66
66
  "message": "@bind=data.mode;"
67
+ },
68
+ {
69
+ "topic": "state/startTime",
70
+ "message": "@bind=data.startTime;"
67
71
  }
68
72
  ]
69
73
  },
@@ -73,7 +77,7 @@
73
77
  "topics": [
74
78
  {
75
79
  "topic": "state/circuits/@bind=data.id;/@bind=data.name;",
76
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
80
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';,\"endTime\":\"@bind=data.endTime;\"}",
77
81
  "description": "Bind 'on'/'off' as a message to the state topic."
78
82
  },
79
83
  {
@@ -116,6 +120,11 @@
116
120
  "options": { "qos": 2 },
117
121
  "enabled": false
118
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
+ },
119
128
  {
120
129
  "topic": "state/circuits/@bind=data.id;/@bind=data.name;/object",
121
130
  "message": "@bind=data;",
@@ -146,15 +155,19 @@
146
155
  }
147
156
  ]
148
157
  },
149
-
150
158
  {
151
159
  "name": "feature",
152
160
  "description": "Populate the features topics",
153
161
  "topics": [
154
162
  {
155
163
  "topic": "state/features/@bind=data.id;/@bind=data.name;",
156
- "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
164
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';,\"endTime\":\"@bind=data.endTime;\"}",
157
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."
158
171
  }
159
172
  ]
160
173
  },
@@ -179,6 +192,32 @@
179
192
  }
180
193
  ]
181
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
+ },
182
221
  {
183
222
  "name": "body",
184
223
  "description": "Populate the body topic",
@@ -203,6 +242,11 @@
203
242
  "message": "{\"setPoint\":@bind=data.setPoint;}",
204
243
  "description": "Send set point."
205
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
+ },
206
250
  {
207
251
  "topic": "state/temps/bodies/@bind=data.id;/@bind=data.name;/temp",
208
252
  "message": "{\"temp\":@bind=data.temp;}",
@@ -263,11 +307,6 @@
263
307
  "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/targetOutput",
264
308
  "message": "{\"targetOutput\":@bind=data.targetOutput;}",
265
309
  "description": "Send targetOutput."
266
- },
267
- {
268
- "topic": "state/chlorinators/@bind=data.id;/@bind=data.name;/virtualControllerStatus",
269
- "message": "{\"virtualControllerStatus\":@bind=data.virtualControllerStatus;}",
270
- "description": "Send virtualControllerStatus."
271
310
  }
272
311
  ]
273
312
  },
@@ -291,6 +330,10 @@
291
330
  {
292
331
  "topic": "state/lightgroups/@bind=data.id;/@bind=data.name;/type",
293
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;}"
294
337
  }
295
338
  ]
296
339
  },
@@ -368,6 +411,11 @@
368
411
  "message": "@bind=data.orp.level;",
369
412
  "enabled": true
370
413
  },
414
+ {
415
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/demand",
416
+ "message": "@bind=data.orp.demand;",
417
+ "enabled": true
418
+ },
371
419
  {
372
420
  "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orp/doseTime",
373
421
  "message": "@bind=data.orp.doseTime;",
@@ -471,15 +519,14 @@
471
519
  "topic": "config/chemControllers/@bind=data.id;/@bind=data.name;/borates",
472
520
  "message": "@bind=vars.cfg.borates;"
473
521
  },
474
- {
475
- "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/virtualControllerStatus",
476
- "message": "@bind=data.virtualControllerStatus;"
477
- },
478
522
  {
479
523
  "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/acidDemand",
480
524
  "message": "@bind=data.ph.demand;"
481
525
  },
482
-
526
+ {
527
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDemand",
528
+ "message": "@bind=data.orp.demand;"
529
+ },
483
530
  {
484
531
  "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/alarms/flow",
485
532
  "message": "@bind=data.alarms.flow;"
@@ -535,6 +582,58 @@
535
582
  }
536
583
  ]
537
584
  },
585
+ {
586
+ "name": "filter",
587
+ "description": "Populate the filter topic",
588
+ "topics": [
589
+ {
590
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;",
591
+ "message": "{\"id\":@bind=data.id;,\"isOn\":@bind=data.isOn?'\"on\"':'\"off\"';}",
592
+ "description": "Bind 'on'/'off' as a message to the state topic."
593
+ },
594
+ {
595
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/pressure",
596
+ "message": "{\"pressure\":@bind=data.pressure;}",
597
+ "description": "Send current pressure."
598
+ },
599
+ {
600
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/refPressure",
601
+ "message": "{\"refPressure\":@bind=data.refPressure;}",
602
+ "description": "Send reference pressure (when circuits are on)."
603
+ },
604
+ {
605
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/body",
606
+ "message": "{\"body\":@bind=data.body.desc;}",
607
+ "description": "Send associated body."
608
+ },
609
+ {
610
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/filterType",
611
+ "message": "{\"filterType\":@bind=data.filterType.desc;}",
612
+ "description": "Send filter type."
613
+ },
614
+ {
615
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/pressureUnits",
616
+ "message": "{\"pressureUnits\":@bind=data.pressureUnits.desc;}",
617
+ "description": "Send pressureUnits."
618
+ },
619
+ {
620
+ "topic": "state/filters/@bind=data.id;/@bind=data.name;/cleanPercentage",
621
+ "message": "{\"cleanPercentage\":@bind=data.cleanPercentage;}",
622
+ "description": "Send cleanPercentage."
623
+ }
624
+ ]
625
+ },
626
+ {
627
+ "name": "cover",
628
+ "description": "Populate the cover topic",
629
+ "topics": [
630
+ {
631
+ "topic": "state/covers/@bind=data.id;/@bind=data.name;",
632
+ "message": "{\"id\":@bind=data.id;,\"isClosed\":@bind=data.isClosed?'\"true\"':'\"false\"';}",
633
+ "description": "Bind isClosed as a message to the state topic."
634
+ }
635
+ ]
636
+ },
538
637
  {
539
638
  "name": "*",
540
639
  "description": "DEFAULT: Sends the entire emitted response.",
@@ -63,8 +63,11 @@
63
63
  {
64
64
  "topic": "state/mode",
65
65
  "message": "@bind=data.mode;"
66
+ },
67
+ {
68
+ "topic": "state/startTime",
69
+ "message": "@bind=data.startTime;"
66
70
  }
67
-
68
71
  ]
69
72
  },
70
73
  {
@@ -86,6 +89,11 @@
86
89
  "message": "@bind=data.type;",
87
90
  "description": "The type of circuit we are dealing with."
88
91
  },
92
+ {
93
+ "topic": "state/circuits/@bind=data.id;/endTime",
94
+ "message": "@bind=data.endTime;",
95
+ "description": "The end time for the circuit."
96
+ },
89
97
  {
90
98
  "topic": "state/circuits/@bind=data.id;/lightingTheme",
91
99
  "message": "@bind=data.lightingTheme;",
@@ -95,7 +103,12 @@
95
103
  {
96
104
  "topic": "state/circuits/@bind=data.id;/showInFeatures",
97
105
  "message": "@bind=data.showInFeatures;",
98
- "description": "Indicates wether the item should show in features."
106
+ "description": "Indicates whether the item should show in features."
107
+ },
108
+ {
109
+ "topic": "state/circuits/@bind=data.id;/endTime",
110
+ "message": "@bind=data.endTime;",
111
+ "description": "Indicates end time for a circuit (when it will turn off)."
99
112
  }
100
113
  ]
101
114
  },
@@ -113,6 +126,11 @@
113
126
  "message": "@bind=data.isOn;",
114
127
  "description": "Bind the on/off status to the topic."
115
128
  },
129
+ {
130
+ "topic": "state/features/@bind=data.id;/endTime",
131
+ "message": "@bind=data.endTime;",
132
+ "description": "The end time for the feature."
133
+ },
116
134
  {
117
135
  "topic": "state/features/@bind=data.id;/type",
118
136
  "message": "@bind=data.type;",
@@ -121,7 +139,12 @@
121
139
  {
122
140
  "topic": "state/features/@bind=data.id;/showInFeatures",
123
141
  "message": "@bind=data.showInFeatures;",
124
- "description": "Indicates wether the item should show in features."
142
+ "description": "Indicates whether the item should show in features."
143
+ },
144
+ {
145
+ "topic": "state/features/@bind=data.id;/endTime",
146
+ "message": "@bind=data.endTime;",
147
+ "description": "Indicates end time for a features (when it will turn off)."
125
148
  }
126
149
  ]
127
150
  },
@@ -150,6 +173,10 @@
150
173
  {
151
174
  "topic": "state/lightGroups/@bind=data.id;/type",
152
175
  "message": "@bind=data.type;"
176
+ },
177
+ {
178
+ "topic": "state/lightGroups/@bind=data.id;/endTime",
179
+ "message": "@bind=data.endTime;"
153
180
  }
154
181
  ]
155
182
  },
@@ -174,7 +201,12 @@
174
201
  {
175
202
  "topic": "state/circuitGroups/@bind=data.id;/showInFeatures",
176
203
  "message": "@bind=data.showInFeatures;",
177
- "description": "Indicates wether the item should show in features."
204
+ "description": "Indicates whether the item should show in features."
205
+ },
206
+ {
207
+ "topic": "state/circuitGroups/@bind=data.id;/endTime",
208
+ "message": "@bind=data.showInFeatures;",
209
+ "description": "Indicates end time for the circuitGroup (when it will turn off)."
178
210
  }
179
211
 
180
212
  ]
@@ -309,6 +341,11 @@
309
341
  "message": "@bind=data.setPoint;",
310
342
  "description": "Setpoint."
311
343
  },
344
+ {
345
+ "topic": "state/temps/bodies/@bind=data.id;/coolSetpoint",
346
+ "message": "@bind=data.coolSetpoint;",
347
+ "description": "Cool setpoint."
348
+ },
312
349
  {
313
350
  "topic": "state/temps/bodies/@bind=data.id;/temp",
314
351
  "message": "@bind=data.temp;",
@@ -374,11 +411,6 @@
374
411
  "topic": "state/chlorinators/@bind=data.id;/targetOutput",
375
412
  "message": "@bind=data.targetOutput;",
376
413
  "description": "Send targetOutput."
377
- },
378
- {
379
- "topic": "state/chlorinators/@bind=data.id;/virtualControllerStatus",
380
- "message": "@bind=data.virtualControllerStatus;",
381
- "description": "Send virtualControllerStatus."
382
414
  }
383
415
  ]
384
416
  },
@@ -509,8 +541,12 @@
509
541
  "message": "@bind=vars.cfg.borates;"
510
542
  },
511
543
  {
512
- "topic": "state/chemControllers/@bind=data.id;/virtualControllerStatus",
513
- "message": "@bind=data.virtualControllerStatus;"
544
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/acidDemand",
545
+ "message": "@bind=data.ph.demand;"
546
+ },
547
+ {
548
+ "topic": "state/chemControllers/@bind=data.id;/@bind=data.name;/orpDemand",
549
+ "message": "@bind=data.orp.demand;"
514
550
  },
515
551
  {
516
552
  "topic": "state/chemControllers/@bind=data.id;/alarms/flow",
@@ -566,6 +602,68 @@
566
602
  }
567
603
  ]
568
604
  },
605
+ {
606
+ "name": "filter",
607
+ "description": "Populate the filter topic",
608
+ "topics": [
609
+ {
610
+ "topic": "state/filters/@bind=data.id;/name",
611
+ "message": "@bind=data.name;",
612
+ "description": "Bind the name topic."
613
+ },
614
+ {
615
+ "topic": "state/filters/@bind=data.id;/isOn",
616
+ "message": "@bind=data.currentOutput > 0;",
617
+ "description": "Bind 'on'/'off' as a message to the state topic."
618
+ },
619
+ {
620
+ "topic": "state/filters/@bind=data.id;/body",
621
+ "message": "@bind=data.body.desc;",
622
+ "description": "Send body description."
623
+ },
624
+ {
625
+ "topic": "state/filters/@bind=data.id;/cleanPercentage",
626
+ "message": "@bind=data.cleanPercentage;",
627
+ "description": "Send clean percentage."
628
+ },
629
+ {
630
+ "topic": "state/filters/@bind=data.id;/filterType",
631
+ "message": "@bind=data.filterType.desc;",
632
+ "description": "Send filter type."
633
+ },
634
+ {
635
+ "topic": "state/filters/@bind=data.id;/pressure",
636
+ "message": "@bind=data.pressure;",
637
+ "description": "Send pressure."
638
+ },
639
+ {
640
+ "topic": "state/filters/@bind=data.id;/pressureUnits",
641
+ "message": "@bind=data.pressureUnits.desc;",
642
+ "description": "Send pressure units."
643
+ },
644
+ {
645
+ "topic": "state/filters/@bind=data.id;/refPressure",
646
+ "message": "@bind=data.refPressure;",
647
+ "description": "Send reference pressure."
648
+ }
649
+ ]
650
+ },
651
+ {
652
+ "name": "cover",
653
+ "description": "Populate the cover topic",
654
+ "topics": [
655
+ {
656
+ "topic": "state/covers/@bind=data.id;/name",
657
+ "message": "@bind=data.name;",
658
+ "description": "Bind the name topic."
659
+ },
660
+ {
661
+ "topic": "state/covers/@bind=data.id;/isClosed",
662
+ "message": "@bind=data.isClosed;",
663
+ "description": "Bind isClosed as a message to the state topic."
664
+ }
665
+ ]
666
+ },
569
667
  {
570
668
  "name": "*",
571
669
  "description": "DEFAULT: Sends the entire emitted response.",
@@ -2,7 +2,8 @@ import extend = require("extend");
2
2
  import { logger } from "../../logger/Logger";
3
3
  import { sys as sysAlias } from "../../controller/Equipment";
4
4
  import { state as stateAlias} from "../../controller/State";
5
- import { webApp as webAppAlias} from '../Server';
5
+ import { webApp as webAppAlias } from '../Server';
6
+ import { utils, Timestamp } from "../../controller/Constants";
6
7
 
7
8
  export class BaseInterfaceBindings {
8
9
  constructor(cfg) {
@@ -100,11 +100,13 @@ export class HttpInterfaceBindings extends BaseInterfaceBindings {
100
100
  opts.headers["CONTENT-LENGTH"] = Buffer.byteLength(sbody || '');
101
101
  }
102
102
  if (opts.port === 443 || (opts.protocol || '').startsWith('https')) {
103
+ opts.protocol = 'https:';
103
104
  req = https.request(opts, (response: http.IncomingMessage) => {
104
105
  //console.log(response);
105
106
  });
106
107
  }
107
108
  else {
109
+ opts.protocol = 'http:';
108
110
  req = http.request(opts, (response: http.IncomingMessage) => {
109
111
  //console.log(response.statusCode);
110
112
  });