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
package/README.md CHANGED
@@ -1,191 +1,191 @@
1
- # nodejs-poolController - Version 7.6
2
-
3
- ## What is nodejs-poolController
4
-
5
- nodejs-poolController is an application to communicate and control your Pentair compatible pool equipment.
6
-
7
- * Want to include a low cost controller for your pool?
8
- * Want a web interface for your system?
9
- * Want to turn your pumps on remotely?
10
- * Want to have your home automation system talk to your pool?
11
- * Want to control your pumps or chlorinator without a pool controller?
12
-
13
- Equipment supported
14
- 1. Controllers: IntelliCenter, Intellitouch, EasyTouch, No controller (standalone equimpent)
15
- 1. Pumps: Intelliflow VS/VSF/VF, older models
16
- 1. Chlorinators: Intellichlor, Aqua-Rite and OEM brands
17
- 1. Heaters: Gas, solar, heatpump
18
- 1. Intellichem and Relay Equipment Manager (REM) chemical controllers
19
- 1. Intellivalve (coming soon)
20
- 1. Home Automation: SmartThings, Hubitat, ISY, Vera, Siri, Echo
21
- 1. Chemical probes (pH, ORP, flow sensors, EC, etc.)
22
-
23
- ## Latest Changes
24
- See [Changelog](https://github.com/tagyoureit/nodejs-poolController/blob/master/Changelog)
25
-
26
- ## What's new in 7.0?
27
-
28
- The current version includes very tight intergation with [relayEquipmentManager](https://github.com/rstrouse/relayEquipmentManager) which allows for hardware control over your ancillary pool equipment (chemical probes, pumps, tanks, heaters, pumps, etc).
29
-
30
- Starting with this version, all code will immediately be pushed to `master` branch. The version of a `next` branch for feature development will disappear.
31
-
32
-
33
- <a name="module_nodejs-poolController--install"></a>
34
-
35
- Dashpanel Client Screenshot
36
-
37
- <img src="https://tagyoureit.github.io/nodejs-poolController/images/v6/clients/dashPanel.png?raw=true" height="300">
38
-
39
- ## Installation Instructions
40
-
41
- This code requires a physical [RS485](https://github.com/tagyoureit/nodejs-poolController/wiki/RS-485-Adapter-Details) adapter to work.
42
-
43
- This is only the server code. See [clients](#module_nodejs-poolController--clients) below for web or other ways to read/control the pool equipment.
44
-
45
- ### Prerequisites
46
- If you don't know anything about NodeJS, these directions might be helpful.
47
-
48
- 1. Install Nodejs (v12 recommended). (https://nodejs.org/en/download/)
49
- 1. Update NPM (https://docs.npmjs.com/getting-started/installing-node).
50
- 1. It is recommended to clone the source code as updates are frequently pushed while releases are infrequent
51
- clone with `git clone https://github.com/tagyoureit/nodejs-poolController.git`
52
- (Alternate - not recommended - Download the latest [code release](https://github.com/tagyoureit/nodejs-poolController/releases)
53
- 1. Change directory into nodejs-poolController.
54
- 1. Run `npm install` in the new folder (where package.json exists). This will automatically install all the dependencies (serial-port, express, sockets.io, etc).
55
- 1. Run the app with `npm start`.
56
- * `npm start` will compile the Typescript code. You should use this every time you download/clone/pull the latest code.
57
- * `npm run start:cached` will run the app without compiling the code which can be much faster.
58
- 1. Running `npm start` will also create a `config.json` file for your installation. If you need to modify any properties (e.g. the path to your serialport adapter, enabling socat, etc) then stop the app, edit the `config.json` per the [instructions](module_nodejs-poolController--config.json) below, and start the app again.
59
- 1. Verify your pool equipment is correctly identified by inspecting the `/data/*.json` files.
60
- 1. Install a [webclient](module_nodejs-poolController--clients) for a browser experience and/or a [binding](module_nodejs-poolController--bindings) to have two way control with Home Automation systems.
61
-
62
- For a very thorough walk-through, see [this](https://www.troublefreepool.com/threads/pentair-intellicenter-pool-control-dashboard-instructional-guide.218514/) great thread on Trouble Free Pool. Thanks @MyAZPool.
63
-
64
- #### Upgrade Instructions
65
- Assuming you cloned the repo, the following are easy steps to get the latest version:
66
- 1. Change directory to the njsPC app
67
- 2. `git pull`
68
- 3. `npm i` (not always necessary, but if dependencies are upgraded this will bring them up to date)
69
- 4. Start application as normal, or if using `npm run start:cached` then run `npm run build` to compile the code.
70
-
71
- ### Docker instructions
72
-
73
- See the [wiki](https://github.com/tagyoureit/nodejs-poolController/wiki/Docker). Thanks @wurmr @andylippitt @emes.
74
-
75
- ### Automate startup of app
76
- See the [wiki](https://github.com/tagyoureit/nodejs-poolController/wiki/Automatically-start-at-boot---PM2-&-Systemd).
77
-
78
- # Clients & Bindings
79
- To do anything with this app, you need a client to connect to it. A client can be a web application or Home Automation system.
80
-
81
- <a name="module_nodejs-poolController--clients"></a>
82
-
83
- ## REM (Relay Equipment Manager)
84
- [Relay Equipment Manager](https://github.com/rstrouse/relayEquipmentManager) is a companion app developed by @rstrouse that integrates standalone hardware control. Controls GPIO, i2c, and SPI devices including:
85
- * Atlas Scientific pH, orp, ec, hum, prs, pmp, rtd
86
- * ADS1x15 a/d converters
87
- * Pressure Tranducers
88
- * Flow sensors
89
- * Temperature sensors (10k, NTC)
90
-
91
- ## Web Clients
92
- 1. [nodejs-poolController-dashPanel](https://github.com/rstrouse/nodejs-poolController-dashPanel). Full compatibility with IntelliCenter, *Touch, REM (RelayEquipmentManager).
93
- 1. Deprecated - ~~[nodejs-poolController-webClient](http://github.com/tagyoureit/nodejs-poolController-webClient). Built primarily around EasyTouch/IntelliTouch but will work with other systems.~~
94
-
95
- * This app has the default to only listen to clients from localhost (127.0.0.1). If you need to have clients connect from other machines you will need to change the [ip](#module_nodejs-poolController--config.json) in `config.json`.
96
-
97
- <a name="module_nodejs-poolController--bindings"></a>
98
-
99
- ## Home Automation Bindings (previously Integrations)
100
- **NOTE: Existing integrations built of 5.3 or earlier WILL NOT WORK. They need to be upgraded to leverage 6.0. **
101
-
102
- Available for 6.x:
103
- * [Vera Home Automation Hub](https://github.com/rstrouse/nodejs-poolController-veraPlugin) - A plugin that integrates with nodejs-poolController. [Bindings Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Bindings-Integrations-in-2.0#vera)
104
- * [Hubitat](https://github.com/bsileo/hubitat_poolcontroller) by @bsileo (prev help from @johnny2678, @donkarnag, @arrmo). [Bindings Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Bindings-Integrations-in-2.0#smartthingshubitat)
105
- * [Homebridge/Siri/EVE](https://github.com/gadget-monk/homebridge-poolcontroller) by @gadget-monk, adopted from @leftyflip
106
- * InfluxDB - [Bindings Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Bindings-Integrations-in-2.0#influx)
107
- * [MQTT](https://github.com/crsherman/nodejs-poolController-mqtt) original release by @crsherman, re-write by @kkzonie, testing by @baudfather and others. [Bindings Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Bindings-Integrations-in-2.0#mqtt)
108
- * [Homeseer](https://github.com/tagyoureit/nodejs-poolController/wiki/Homeseer-Setup-Instructions) - Integration directions by @miamijerry to integrate Homeseer through MQTT
109
-
110
- Need to be updated:
111
- * [Another SmartThings Controller](https://github.com/dhop90/pentair-pool-controller/blob/master/README.md) by @dhop90
112
- * [ISY](src/integrations/socketISY.js). Original credit to @blueman2, enhancements by @mayermd
113
- * [ISY Polyglot NodeServer](https://github.com/brianmtreese/nodejs-pool-controller-polyglotv2) created by @brianmtreese
114
-
115
- # Support
116
- 1. For discussions, recommendations, designs, and clarifications, we recommend you join our [Gitter Chat room](https://gitter.im/pentair_pool/Lobby).
117
- 1. Check the [wiki](https://github.com/tagyoureit/nodejs-poolController/wiki) for tips, tricks and additional documentation.
118
- 1. For bug reports you can open a [github issue](https://github.com/tagyoureit/nodejs-poolController/issues/new),
119
-
120
- ### Virtual Controller
121
- v6 adds all new configuration and support for virtual pumps, chlorinators (and soon, Intellichem)
122
-
123
- * [Virtual Pump Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Virtual-Pump-Controller---v6)
124
- * [Virtual Chlorinator Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Virtual-Chlorinator-Controller-v6)
125
- * Virtual Chem Controller
126
-
127
- # Changes
128
- See [Changelog](https://github.com/tagyoureit/nodejs-poolController/blob/master/Changelog)
129
-
130
-
131
- <a name="module_nodejs-poolController--config.json"></a>
132
- # Config.json changes
133
-
134
- ## Controller section - changes to the communications for the app
135
- * `rs485Port` - set to the name of you rs485 controller. See [wiki](https://github.com/tagyoureit/nodejs-poolController/wiki/RS-485-Adapter-Details) for details and testing.
136
- * `portSettings` - should not need to be changed for RS485
137
- * `mockPort` - opens a "fake" port for this app to communicate on. Can be used with [packet captures/replays](https://github.com/tagyoureit/nodejs-poolController/wiki/How-to-capture-all-packets-for-issue-resolution).
138
- * `netConnect` - used to connect via [Socat](https://github.com/tagyoureit/nodejs-poolController/wiki/Socat)
139
- * `netHost` and `netPort` - host and port for Socat connection.
140
- * `inactivityRetry` - # of seconds the app should wait before trying to reopen the port after no communications. If your equipment isn't on all the time or you are running a virtual controller you may want to dramatically increase the timeout so you don't get console warnings.
141
-
142
- ## Web section - controls various aspects of external communications
143
- * `servers` - setting for different servers/services
144
- * `http2` - not used currently
145
- * `http` - primary server used for api connections without secure communications
146
- * `enabled` - self-explanatory
147
- * `ip` - The ip of the network address to listen on. Default of `127.0.0.1` will only listen on the local loopback (localhost) adapter. `0.0.0.0` will listen on all network interfaces. Any other address will listen exclusively on that interface.
148
- * `port` - Port to listen on. Default is `4200`.
149
- * `httpsRedirect` - Redirect http traffic to https
150
- * `authentication` - Enable basic username/password authentication. (Not implemented yet.)
151
- * `authFile` - Location of the encrypted password file. By default, `/users.htpasswd`. If you have `authentication=1` then create the file users.htpasswd in the root of the application. Use a tool such as http://www.htaccesstools.com/htpasswd-generator/ and paste your user(s) into this file. You will now be prompted for authentication.
152
- * `https` - See http options above.
153
- * `sslKeyFile` - Location of key file
154
- * `sslCertFile` - Location of certificate file
155
- * `mdns` - Not currently used.
156
- * `ssdp` - Enable for automatic configuration by the webClient and other platforms.
157
-
158
-
159
- ## Log - Different aspects of logging to the application
160
- * `app` - Application wide settings
161
- * `enabled` - Enable/disable logging for the entire application
162
- * `level` - Different levels of logging from least to most: 'error', 'warn', 'info', 'verbose', 'debug', 'silly'
163
- * `packet` - Configuration for the
164
-
165
-
166
- # Credit
167
-
168
- 1. @Rstrouse for helping make the 6.0 rewrite and Intellicenter possible, continuing to make monumental changes, and driving this project forward in numerous ways. My knowledge of coding in general has benefitted greatly from working with him.
169
- 1. [Jason Young](http://www.sdyoung.com/home/decoding-the-pentair-easytouch-rs-485-protocol) (Read both posts, they are a great baseline for knowledge)
170
- 1. Michael Russe [ceesco](https://github.com/ceesco53/pentair_examples) [CocoonTech](http://cocoontech.com/forums/topic/13548-intelliflow-pump-rs485-protocol/?p=159671) - Registration required for CocoonTech. Jason Young used this material for his understanding in the protocol as well. There is a very detailed .txt file with great information ~~that I won't post unless I get permission~~. Looks like it was publicly posted to [Pastebin](http://pastebin.com/uiAmvNjG).
171
- 1. [Michael Usner](https://github.com/michaelusner/Home-Device-Controller) for taking the work of both of the above and turning it into Javascript code.
172
- 1. [rflemming](https://github.com/rflemming) for being the first to contribute some changes to the code.
173
- 1. Awesome help from @arrmo and @blueman2 on Gitter
174
-
175
- # License
176
-
177
- nodejs-poolController. An application to control pool equipment.
178
- Copyright (C) 2016, 2017. Russell Goldin, tagyoureit. russ.goldin@gmail.com
179
-
180
- This program is free software: you can redistribute it and/or modify
181
- it under the terms of the GNU Affero General Public License as
182
- published by the Free Software Foundation, either version 3 of the
183
- License, or (at your option) any later version.
184
-
185
- This program is distributed in the hope that it will be useful,
186
- but WITHOUT ANY WARRANTY; without even the implied warranty of
187
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
188
- GNU Affero General Public License for more details.
189
-
190
- You should have received a copy of the GNU Affero General Public License
191
- along with this program. If not, see <http://www.gnu.org/licenses/>
1
+ # nodejs-poolController - Version 7.6
2
+
3
+ ## What is nodejs-poolController
4
+
5
+ nodejs-poolController is an application to communicate and control your Pentair compatible pool equipment.
6
+
7
+ * Want to include a low cost controller for your pool?
8
+ * Want a web interface for your system?
9
+ * Want to turn your pumps on remotely?
10
+ * Want to have your home automation system talk to your pool?
11
+ * Want to control your pumps or chlorinator without a pool controller?
12
+
13
+ Equipment supported
14
+ 1. Controllers: IntelliCenter, Intellitouch, EasyTouch, No controller (standalone equimpent)
15
+ 1. Pumps: Intelliflow VS/VSF/VF, older models
16
+ 1. Chlorinators: Intellichlor, Aqua-Rite and OEM brands
17
+ 1. Heaters: Gas, solar, heatpump
18
+ 1. Intellichem and Relay Equipment Manager (REM) chemical controllers
19
+ 1. Intellivalve (coming soon)
20
+ 1. Home Automation: SmartThings, Hubitat, ISY, Vera, Siri, Echo
21
+ 1. Chemical probes (pH, ORP, flow sensors, EC, etc.)
22
+
23
+ ## Latest Changes
24
+ See [Changelog](https://github.com/tagyoureit/nodejs-poolController/blob/master/Changelog)
25
+
26
+ ## What's new in 7.0?
27
+
28
+ The current version includes very tight intergation with [relayEquipmentManager](https://github.com/rstrouse/relayEquipmentManager) which allows for hardware control over your ancillary pool equipment (chemical probes, pumps, tanks, heaters, pumps, etc).
29
+
30
+ Starting with this version, all code will immediately be pushed to `master` branch. The version of a `next` branch for feature development will disappear.
31
+
32
+
33
+ <a name="module_nodejs-poolController--install"></a>
34
+
35
+ Dashpanel Client Screenshot
36
+
37
+ <img src="https://tagyoureit.github.io/nodejs-poolController/images/v6/clients/dashPanel.png?raw=true" height="300">
38
+
39
+ ## Installation Instructions
40
+
41
+ This code requires a physical [RS485](https://github.com/tagyoureit/nodejs-poolController/wiki/RS-485-Adapter-Details) adapter to work.
42
+
43
+ This is only the server code. See [clients](#module_nodejs-poolController--clients) below for web or other ways to read/control the pool equipment.
44
+
45
+ ### Prerequisites
46
+ If you don't know anything about NodeJS, these directions might be helpful.
47
+
48
+ 1. Install Nodejs (v12 recommended). (https://nodejs.org/en/download/)
49
+ 1. Update NPM (https://docs.npmjs.com/getting-started/installing-node).
50
+ 1. It is recommended to clone the source code as updates are frequently pushed while releases are infrequent
51
+ clone with `git clone https://github.com/tagyoureit/nodejs-poolController.git`
52
+ (Alternate - not recommended - Download the latest [code release](https://github.com/tagyoureit/nodejs-poolController/releases)
53
+ 1. Change directory into nodejs-poolController.
54
+ 1. Run `npm install` in the new folder (where package.json exists). This will automatically install all the dependencies (serial-port, express, sockets.io, etc).
55
+ 1. Run the app with `npm start`.
56
+ * `npm start` will compile the Typescript code. You should use this every time you download/clone/pull the latest code.
57
+ * `npm run start:cached` will run the app without compiling the code which can be much faster.
58
+ 1. Running `npm start` will also create a `config.json` file for your installation. If you need to modify any properties (e.g. the path to your serialport adapter, enabling socat, etc) then stop the app, edit the `config.json` per the [instructions](module_nodejs-poolController--config.json) below, and start the app again.
59
+ 1. Verify your pool equipment is correctly identified by inspecting the `/data/*.json` files.
60
+ 1. Install a [webclient](module_nodejs-poolController--clients) for a browser experience and/or a [binding](module_nodejs-poolController--bindings) to have two way control with Home Automation systems.
61
+
62
+ For a very thorough walk-through, see [this](https://www.troublefreepool.com/threads/pentair-intellicenter-pool-control-dashboard-instructional-guide.218514/) great thread on Trouble Free Pool. Thanks @MyAZPool.
63
+
64
+ #### Upgrade Instructions
65
+ Assuming you cloned the repo, the following are easy steps to get the latest version:
66
+ 1. Change directory to the njsPC app
67
+ 2. `git pull`
68
+ 3. `npm i` (not always necessary, but if dependencies are upgraded this will bring them up to date)
69
+ 4. Start application as normal, or if using `npm run start:cached` then run `npm run build` to compile the code.
70
+
71
+ ### Docker instructions
72
+
73
+ See the [wiki](https://github.com/tagyoureit/nodejs-poolController/wiki/Docker). Thanks @wurmr @andylippitt @emes.
74
+
75
+ ### Automate startup of app
76
+ See the [wiki](https://github.com/tagyoureit/nodejs-poolController/wiki/Automatically-start-at-boot---PM2-&-Systemd).
77
+
78
+ # Clients & Bindings
79
+ To do anything with this app, you need a client to connect to it. A client can be a web application or Home Automation system.
80
+
81
+ <a name="module_nodejs-poolController--clients"></a>
82
+
83
+ ## REM (Relay Equipment Manager)
84
+ [Relay Equipment Manager](https://github.com/rstrouse/relayEquipmentManager) is a companion app developed by @rstrouse that integrates standalone hardware control. Controls GPIO, i2c, and SPI devices including:
85
+ * Atlas Scientific pH, orp, ec, hum, prs, pmp, rtd
86
+ * ADS1x15 a/d converters
87
+ * Pressure Tranducers
88
+ * Flow sensors
89
+ * Temperature sensors (10k, NTC)
90
+
91
+ ## Web Clients
92
+ 1. [nodejs-poolController-dashPanel](https://github.com/rstrouse/nodejs-poolController-dashPanel). Full compatibility with IntelliCenter, *Touch, REM (RelayEquipmentManager).
93
+ 1. Deprecated - ~~[nodejs-poolController-webClient](http://github.com/tagyoureit/nodejs-poolController-webClient). Built primarily around EasyTouch/IntelliTouch but will work with other systems.~~
94
+
95
+ * This app has the default to only listen to clients from localhost (127.0.0.1). If you need to have clients connect from other machines you will need to change the [ip](#module_nodejs-poolController--config.json) in `config.json`.
96
+
97
+ <a name="module_nodejs-poolController--bindings"></a>
98
+
99
+ ## Home Automation Bindings (previously Integrations)
100
+ **NOTE: Existing integrations built of 5.3 or earlier WILL NOT WORK. They need to be upgraded to leverage 6.0. **
101
+
102
+ Available for 6.x:
103
+ * [Vera Home Automation Hub](https://github.com/rstrouse/nodejs-poolController-veraPlugin) - A plugin that integrates with nodejs-poolController. [Bindings Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Bindings-Integrations-in-2.0#vera)
104
+ * [Hubitat](https://github.com/bsileo/hubitat_poolcontroller) by @bsileo (prev help from @johnny2678, @donkarnag, @arrmo). [Bindings Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Bindings-Integrations-in-2.0#smartthingshubitat)
105
+ * [Homebridge/Siri/EVE](https://github.com/gadget-monk/homebridge-poolcontroller) by @gadget-monk, adopted from @leftyflip
106
+ * InfluxDB - [Bindings Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Bindings-Integrations-in-2.0#influx)
107
+ * [MQTT](https://github.com/crsherman/nodejs-poolController-mqtt) original release by @crsherman, re-write by @kkzonie, testing by @baudfather and others. [Bindings Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Bindings-Integrations-in-2.0#mqtt)
108
+ * [Homeseer](https://github.com/tagyoureit/nodejs-poolController/wiki/Homeseer-Setup-Instructions) - Integration directions by @miamijerry to integrate Homeseer through MQTT
109
+
110
+ Need to be updated:
111
+ * [Another SmartThings Controller](https://github.com/dhop90/pentair-pool-controller/blob/master/README.md) by @dhop90
112
+ * [ISY](src/integrations/socketISY.js). Original credit to @blueman2, enhancements by @mayermd
113
+ * [ISY Polyglot NodeServer](https://github.com/brianmtreese/nodejs-pool-controller-polyglotv2) created by @brianmtreese
114
+
115
+ # Support
116
+ 1. For discussions, recommendations, designs, and clarifications, we recommend you join the [Github discussions](https://github.com/tagyoureit/nodejs-poolController/discussions or [Gitter Chat room](https://gitter.im/pentair_pool/Lobby).
117
+ 1. Check the [wiki](https://github.com/tagyoureit/nodejs-poolController/wiki) for tips, tricks and additional documentation.
118
+ 1. For bug reports you can open a [github issue](https://github.com/tagyoureit/nodejs-poolController/issues/new),
119
+
120
+ ### Virtual Controller
121
+ v6 adds all new configuration and support for virtual pumps, chlorinators (and soon, Intellichem)
122
+
123
+ * [Virtual Pump Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Virtual-Pump-Controller---v6)
124
+ * [Virtual Chlorinator Directions](https://github.com/tagyoureit/nodejs-poolController/wiki/Virtual-Chlorinator-Controller-v6)
125
+ * Virtual Chem Controller
126
+
127
+ # Changes
128
+ See [Changelog](https://github.com/tagyoureit/nodejs-poolController/blob/master/Changelog)
129
+
130
+
131
+ <a name="module_nodejs-poolController--config.json"></a>
132
+ # Config.json changes
133
+
134
+ ## Controller section - changes to the communications for the app
135
+ * `rs485Port` - set to the name of you rs485 controller. See [wiki](https://github.com/tagyoureit/nodejs-poolController/wiki/RS-485-Adapter-Details) for details and testing.
136
+ * `portSettings` - should not need to be changed for RS485
137
+ * `mockPort` - opens a "fake" port for this app to communicate on. Can be used with [packet captures/replays](https://github.com/tagyoureit/nodejs-poolController/wiki/How-to-capture-all-packets-for-issue-resolution).
138
+ * `netConnect` - used to connect via [Socat](https://github.com/tagyoureit/nodejs-poolController/wiki/Socat)
139
+ * `netHost` and `netPort` - host and port for Socat connection.
140
+ * `inactivityRetry` - # of seconds the app should wait before trying to reopen the port after no communications. If your equipment isn't on all the time or you are running a virtual controller you may want to dramatically increase the timeout so you don't get console warnings.
141
+
142
+ ## Web section - controls various aspects of external communications
143
+ * `servers` - setting for different servers/services
144
+ * `http2` - not used currently
145
+ * `http` - primary server used for api connections without secure communications
146
+ * `enabled` - self-explanatory
147
+ * `ip` - The ip of the network address to listen on. Default of `127.0.0.1` will only listen on the local loopback (localhost) adapter. `0.0.0.0` will listen on all network interfaces. Any other address will listen exclusively on that interface.
148
+ * `port` - Port to listen on. Default is `4200`.
149
+ * `httpsRedirect` - Redirect http traffic to https
150
+ * `authentication` - Enable basic username/password authentication. (Not implemented yet.)
151
+ * `authFile` - Location of the encrypted password file. By default, `/users.htpasswd`. If you have `authentication=1` then create the file users.htpasswd in the root of the application. Use a tool such as http://www.htaccesstools.com/htpasswd-generator/ and paste your user(s) into this file. You will now be prompted for authentication.
152
+ * `https` - See http options above.
153
+ * `sslKeyFile` - Location of key file
154
+ * `sslCertFile` - Location of certificate file
155
+ * `mdns` - Not currently used.
156
+ * `ssdp` - Enable for automatic configuration by the webClient and other platforms.
157
+
158
+
159
+ ## Log - Different aspects of logging to the application
160
+ * `app` - Application wide settings
161
+ * `enabled` - Enable/disable logging for the entire application
162
+ * `level` - Different levels of logging from least to most: 'error', 'warn', 'info', 'verbose', 'debug', 'silly'
163
+ * `packet` - Configuration for the
164
+
165
+
166
+ # Credit
167
+
168
+ 1. @Rstrouse for helping make the 6.0 rewrite and Intellicenter possible, continuing to make monumental changes, and driving this project forward in numerous ways. My knowledge of coding in general has benefitted greatly from working with him.
169
+ 1. [Jason Young](http://www.sdyoung.com/home/decoding-the-pentair-easytouch-rs-485-protocol) (Read both posts, they are a great baseline for knowledge)
170
+ 1. Michael Russe [ceesco](https://github.com/ceesco53/pentair_examples) [CocoonTech](http://cocoontech.com/forums/topic/13548-intelliflow-pump-rs485-protocol/?p=159671) - Registration required for CocoonTech. Jason Young used this material for his understanding in the protocol as well. There is a very detailed .txt file with great information ~~that I won't post unless I get permission~~. Looks like it was publicly posted to [Pastebin](http://pastebin.com/uiAmvNjG).
171
+ 1. [Michael Usner](https://github.com/michaelusner/Home-Device-Controller) for taking the work of both of the above and turning it into Javascript code.
172
+ 1. [rflemming](https://github.com/rflemming) for being the first to contribute some changes to the code.
173
+ 1. Awesome help from @arrmo and @blueman2 on Gitter
174
+
175
+ # License
176
+
177
+ nodejs-poolController. An application to control pool equipment.
178
+ Copyright (C) 2016, 2017. Russell Goldin, tagyoureit. russ.goldin@gmail.com
179
+
180
+ This program is free software: you can redistribute it and/or modify
181
+ it under the terms of the GNU Affero General Public License as
182
+ published by the Free Software Foundation, either version 3 of the
183
+ License, or (at your option) any later version.
184
+
185
+ This program is distributed in the hope that it will be useful,
186
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
187
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
188
+ GNU Affero General Public License for more details.
189
+
190
+ You should have received a copy of the GNU Affero General Public License
191
+ along with this program. If not, see <http://www.gnu.org/licenses/>
package/app.ts CHANGED
@@ -30,7 +30,7 @@ export async function initAsync() {
30
30
  try {
31
31
  await config.init();
32
32
  await logger.init();
33
- await conn.init();
33
+ await conn.initAsync();
34
34
  await sys.init();
35
35
  await state.init();
36
36
  await webApp.init();
package/config/Config.ts CHANGED
@@ -86,6 +86,20 @@ class Config {
86
86
 
87
87
  }
88
88
  }
89
+ public removeSection(section: string) {
90
+ let c = this._cfg;
91
+ if (section.indexOf('.') !== -1) {
92
+ let arr = section.split('.');
93
+ for (let i = 0; i < arr.length - 1; i++) {
94
+ if (typeof c[arr[i]] === 'undefined')
95
+ c[arr[i]] = {};
96
+ c = c[arr[i]];
97
+ }
98
+ section = arr[arr.length - 1];
99
+ }
100
+ if(typeof c[section] !== 'undefined') delete c[section];
101
+ this.update();
102
+ }
89
103
  public setSection(section: string, val) {
90
104
  let c = this._cfg;
91
105
  if (section.indexOf('.') !== -1) {
@@ -45,7 +45,7 @@ class VersionCheck {
45
45
  let out: string;
46
46
  if (typeof env.SOURCE_BRANCH !== 'undefined')
47
47
  {
48
- out = `${env.SOURCE_BRANCH} - From environment variable`; // check for docker variable
48
+ out = env.SOURCE_BRANCH // check for docker variable
49
49
  }
50
50
  else {
51
51
  let res = execSync('git rev-parse --abbrev-ref HEAD', { stdio: 'pipe' });
@@ -69,7 +69,7 @@ class VersionCheck {
69
69
  let out: string;
70
70
  if (typeof env.SOURCE_COMMIT !== 'undefined')
71
71
  {
72
- out = `${env.SOURCE_COMMIT} - From environment variable`; // check for docker variable
72
+ out = env.SOURCE_COMMIT; // check for docker variable
73
73
  }
74
74
  else {
75
75
  let res = execSync('git rev-parse HEAD', { stdio: 'pipe' });
@@ -301,7 +301,8 @@ export enum ControllerType {
301
301
  EasyTouch = 'easytouch',
302
302
  Unknown = 'unknown',
303
303
  Virtual = 'virtual',
304
- Nixie = 'nixie'
304
+ Nixie = 'nixie',
305
+ AquaLink = 'aqualink'
305
306
  }
306
307
  // export enum VirtualDeviceType {
307
308
  // Pump = 'pump',