nodejs-poolcontroller 7.6.0 → 7.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/.eslintrc.json +44 -44
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +52 -52
  3. package/CONTRIBUTING.md +74 -74
  4. package/Changelog +215 -215
  5. package/Dockerfile +17 -17
  6. package/Gruntfile.js +40 -40
  7. package/LICENSE +661 -661
  8. package/README.md +191 -186
  9. package/app.ts +0 -0
  10. package/config/Config.ts +24 -2
  11. package/config/VersionCheck.ts +27 -12
  12. package/config copy.json +299 -299
  13. package/controller/Constants.ts +0 -0
  14. package/controller/Equipment.ts +2459 -2405
  15. package/controller/Errors.ts +180 -180
  16. package/controller/Lockouts.ts +436 -422
  17. package/controller/State.ts +51 -26
  18. package/controller/boards/BoardFactory.ts +45 -45
  19. package/controller/boards/EasyTouchBoard.ts +2653 -2537
  20. package/controller/boards/IntelliCenterBoard.ts +4230 -4034
  21. package/controller/boards/IntelliComBoard.ts +63 -63
  22. package/controller/boards/IntelliTouchBoard.ts +241 -241
  23. package/controller/boards/NixieBoard.ts +1675 -1660
  24. package/controller/boards/SystemBoard.ts +4697 -4463
  25. package/controller/comms/Comms.ts +138 -1
  26. package/controller/comms/messages/Messages.ts +3 -5
  27. package/controller/comms/messages/config/ChlorinatorMessage.ts +1 -1
  28. package/controller/comms/messages/config/CircuitGroupMessage.ts +0 -0
  29. package/controller/comms/messages/config/CircuitMessage.ts +0 -0
  30. package/controller/comms/messages/config/ConfigMessage.ts +0 -0
  31. package/controller/comms/messages/config/CoverMessage.ts +0 -0
  32. package/controller/comms/messages/config/CustomNameMessage.ts +30 -30
  33. package/controller/comms/messages/config/EquipmentMessage.ts +0 -0
  34. package/controller/comms/messages/config/ExternalMessage.ts +9 -7
  35. package/controller/comms/messages/config/FeatureMessage.ts +0 -0
  36. package/controller/comms/messages/config/GeneralMessage.ts +0 -0
  37. package/controller/comms/messages/config/HeaterMessage.ts +0 -20
  38. package/controller/comms/messages/config/IntellichemMessage.ts +0 -0
  39. package/controller/comms/messages/config/OptionsMessage.ts +25 -1
  40. package/controller/comms/messages/config/PumpMessage.ts +0 -0
  41. package/controller/comms/messages/config/RemoteMessage.ts +0 -0
  42. package/controller/comms/messages/config/ScheduleMessage.ts +347 -342
  43. package/controller/comms/messages/config/SecurityMessage.ts +0 -0
  44. package/controller/comms/messages/config/ValveMessage.ts +0 -0
  45. package/controller/comms/messages/status/ChlorinatorStateMessage.ts +0 -0
  46. package/controller/comms/messages/status/EquipmentStateMessage.ts +1 -1
  47. package/controller/comms/messages/status/HeaterStateMessage.ts +86 -86
  48. package/controller/comms/messages/status/IntelliChemStateMessage.ts +445 -397
  49. package/controller/comms/messages/status/IntelliValveStateMessage.ts +35 -35
  50. package/controller/comms/messages/status/PumpStateMessage.ts +0 -0
  51. package/controller/comms/messages/status/VersionMessage.ts +0 -0
  52. package/controller/nixie/Nixie.ts +162 -162
  53. package/controller/nixie/NixieEquipment.ts +103 -103
  54. package/controller/nixie/bodies/Body.ts +120 -120
  55. package/controller/nixie/bodies/Filter.ts +135 -135
  56. package/controller/nixie/chemistry/ChemController.ts +2498 -2398
  57. package/controller/nixie/chemistry/Chlorinator.ts +314 -314
  58. package/controller/nixie/circuits/Circuit.ts +248 -245
  59. package/controller/nixie/heaters/Heater.ts +648 -600
  60. package/controller/nixie/pumps/Pump.ts +661 -661
  61. package/controller/nixie/schedules/Schedule.ts +257 -257
  62. package/controller/nixie/valves/Valve.ts +170 -170
  63. package/defaultConfig.json +286 -286
  64. package/issue_template.md +51 -51
  65. package/logger/DataLogger.ts +448 -448
  66. package/logger/Logger.ts +0 -0
  67. package/package.json +56 -56
  68. package/tsconfig.json +25 -25
  69. package/web/Server.ts +2 -2
  70. package/web/bindings/influxDB.json +1021 -981
  71. package/web/bindings/mqtt.json +654 -654
  72. package/web/bindings/mqttAlt.json +684 -684
  73. package/web/bindings/rulesManager.json +54 -54
  74. package/web/bindings/smartThings-Hubitat.json +31 -31
  75. package/web/bindings/valveRelays.json +20 -20
  76. package/web/bindings/vera.json +25 -25
  77. package/web/interfaces/baseInterface.ts +136 -136
  78. package/web/interfaces/httpInterface.ts +124 -124
  79. package/web/interfaces/influxInterface.ts +245 -241
  80. package/web/interfaces/mqttInterface.ts +475 -475
  81. package/web/services/config/Config.ts +10 -108
  82. package/web/services/config/ConfigSocket.ts +0 -0
  83. package/web/services/state/State.ts +71 -4
  84. package/web/services/state/StateSocket.ts +0 -0
  85. package/web/services/utilities/Utilities.ts +42 -42
File without changes
@@ -689,7 +689,7 @@ export class EquipmentStateMessage {
689
689
  case 144: // swim
690
690
  sys.board.circuits.sequenceLightGroupAsync(grp.id, 'swim');
691
691
  break;
692
- case 160: // swim
692
+ case 160: // set
693
693
  sys.board.circuits.sequenceLightGroupAsync(grp.id, 'set');
694
694
  break;
695
695
  case 190: // save
@@ -1,87 +1,87 @@
1
- /* nodejs-poolController. An application to control pool equipment.
2
- Copyright (C) 2016, 2017, 2018, 2019, 2020. Russell Goldin, tagyoureit. russ.goldin@gmail.com
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
- import { Inbound, Protocol } from "../Messages";
18
- import { state, BodyTempState, HeaterState } from "../../../State";
19
- import { sys, ControllerType, Heater } from "../../../Equipment";
20
-
21
- export class HeaterStateMessage {
22
- public static process(msg: Inbound) {
23
- if (msg.protocol === Protocol.Heater) {
24
- switch (msg.action) {
25
- case 112: // This is a message from a master controlling MasterTemp
26
- case 114: // This is a message from a master controlling UltraTemp
27
- msg.isProcessed = true;
28
- break;
29
- case 116:
30
- HeaterStateMessage.processMasterTempStatus(msg);
31
- break;
32
- case 115:
33
- HeaterStateMessage.processUltraTempStatus(msg);
34
- break;
35
- }
36
- }
37
- }
38
- public static processUltraTempStatus(msg: Inbound) {
39
- // RKS: 07-03-21 - We only know byte 2 at this point for Ultratemp for the 115 message we are processing here. The
40
- // byte description
41
- // ------------------------------------------------
42
- // 0 Unknown (always seems to be 160 for response)
43
- // 1 Unknown (always 1)
44
- // 2 Current heater status 0=off, 1=heat, 2=cool
45
- // 3-9 Unknown
46
-
47
- // 114 message - outbound response
48
- //[165, 0, 112, 16, 114, 10][144, 0, 0, 0, 0, 0, 0, 0, 0, 0][2, 49] // OCP to Heater
49
- // byte description
50
- // ------------------------------------------------
51
- // 0 Unknown (always seems to be 144 for request)
52
- // 1 Current heater status 0=off, 1=heat, 2=cool
53
- // 3 Believed to be ofset temp
54
- // 4-9 Unknown
55
-
56
- // byto 0: always seems to be 144 for outbound
57
- // byte 1: Sets heater mode to 0 = Off 1 = Heat 2 = Cool
58
- //[165, 0, 16, 112, 115, 10][160, 1, 0, 3, 0, 0, 0, 0, 0, 0][2, 70] // Heater Reply
59
- let heater: Heater = sys.heaters.getItemByAddress(msg.source);
60
- let sheater = state.heaters.getItemById(heater.id);
61
- let byte = msg.extractPayloadByte(2);
62
- sheater.isOn = byte >= 1;
63
- sheater.isCooling = byte === 2;
64
- sheater.commStatus = 0;
65
- state.equipment.messages.removeItemByCode(`heater:${heater.id}:comms`);
66
- msg.isProcessed = true;
67
- }
68
- public static processMasterTempStatus(msg: Inbound) {
69
- //[255, 0, 255][165, 0, 16, 112, 116, 23][67, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 10, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0][2, 66]
70
- // Byte 1 is the indicator to which setpoint it is heating to.
71
- // Byte 8 increments over time when the heater is on.
72
- // Byte 13 looks like the mode the heater is in for instance it is in cooldown mode.
73
- // 0 = Normal
74
- // 2 = ??????
75
- // 6 = Cooldown
76
- // Byte 14 looks like the cooldown delay in minutes.
77
- let heater: Heater = sys.heaters.getItemByAddress(msg.source);
78
- let sheater = state.heaters.getItemById(heater.id);
79
- let byte = msg.extractPayloadByte(1);
80
- sheater.isOn = byte >= 1;
81
- sheater.isCooling = false;
82
- sheater.commStatus = 0;
83
- state.equipment.messages.removeItemByCode(`heater:${heater.id}:comms`);
84
- msg.isProcessed = true;
85
- }
86
-
1
+ /* nodejs-poolController. An application to control pool equipment.
2
+ Copyright (C) 2016, 2017, 2018, 2019, 2020. Russell Goldin, tagyoureit. russ.goldin@gmail.com
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ import { Inbound, Protocol } from "../Messages";
18
+ import { state, BodyTempState, HeaterState } from "../../../State";
19
+ import { sys, ControllerType, Heater } from "../../../Equipment";
20
+
21
+ export class HeaterStateMessage {
22
+ public static process(msg: Inbound) {
23
+ if (msg.protocol === Protocol.Heater) {
24
+ switch (msg.action) {
25
+ case 112: // This is a message from a master controlling MasterTemp
26
+ case 114: // This is a message from a master controlling UltraTemp
27
+ msg.isProcessed = true;
28
+ break;
29
+ case 116:
30
+ HeaterStateMessage.processMasterTempStatus(msg);
31
+ break;
32
+ case 115:
33
+ HeaterStateMessage.processUltraTempStatus(msg);
34
+ break;
35
+ }
36
+ }
37
+ }
38
+ public static processUltraTempStatus(msg: Inbound) {
39
+ // RKS: 07-03-21 - We only know byte 2 at this point for Ultratemp for the 115 message we are processing here. The
40
+ // byte description
41
+ // ------------------------------------------------
42
+ // 0 Unknown (always seems to be 160 for response)
43
+ // 1 Unknown (always 1)
44
+ // 2 Current heater status 0=off, 1=heat, 2=cool
45
+ // 3-9 Unknown
46
+
47
+ // 114 message - outbound response
48
+ //[165, 0, 112, 16, 114, 10][144, 0, 0, 0, 0, 0, 0, 0, 0, 0][2, 49] // OCP to Heater
49
+ // byte description
50
+ // ------------------------------------------------
51
+ // 0 Unknown (always seems to be 144 for request)
52
+ // 1 Current heater status 0=off, 1=heat, 2=cool
53
+ // 3 Believed to be ofset temp
54
+ // 4-9 Unknown
55
+
56
+ // byto 0: always seems to be 144 for outbound
57
+ // byte 1: Sets heater mode to 0 = Off 1 = Heat 2 = Cool
58
+ //[165, 0, 16, 112, 115, 10][160, 1, 0, 3, 0, 0, 0, 0, 0, 0][2, 70] // Heater Reply
59
+ let heater: Heater = sys.heaters.getItemByAddress(msg.source);
60
+ let sheater = state.heaters.getItemById(heater.id);
61
+ let byte = msg.extractPayloadByte(2);
62
+ sheater.isOn = byte >= 1;
63
+ sheater.isCooling = byte === 2;
64
+ sheater.commStatus = 0;
65
+ state.equipment.messages.removeItemByCode(`heater:${heater.id}:comms`);
66
+ msg.isProcessed = true;
67
+ }
68
+ public static processMasterTempStatus(msg: Inbound) {
69
+ //[255, 0, 255][165, 0, 16, 112, 116, 23][67, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 10, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0][2, 66]
70
+ // Byte 1 is the indicator to which setpoint it is heating to.
71
+ // Byte 8 increments over time when the heater is on.
72
+ // Byte 13 looks like the mode the heater is in for instance it is in cooldown mode.
73
+ // 0 = Normal
74
+ // 2 = ??????
75
+ // 6 = Cooldown
76
+ // Byte 14 looks like the cooldown delay in minutes.
77
+ let heater: Heater = sys.heaters.getItemByAddress(msg.source);
78
+ let sheater = state.heaters.getItemById(heater.id);
79
+ let byte = msg.extractPayloadByte(1);
80
+ sheater.isOn = byte >= 1;
81
+ sheater.isCooling = false;
82
+ sheater.commStatus = 0;
83
+ state.equipment.messages.removeItemByCode(`heater:${heater.id}:comms`);
84
+ msg.isProcessed = true;
85
+ }
86
+
87
87
  }