# Changelog

## 9.1.0
IntelliCenter security rationalization, JXi/LXi heater support, virtual IntelliChem, and various fixes.

### Security
1. IntelliCenter v3 PIN-based security: full role management with up to 9 roles, 22-section granular permissions, session timeout with activity tracking, and server-side write protection on `/config/*` routes.
2. dashPanel security integration: Guest mode auto-session on page load, "Guest" badge, config tab gating by permission bitmask, dashboard widget permission gating (bodies, circuits, lights, chemistry, pumps), PIN dialog via lock icon, and session timeout auto-revert.
3. Permission bit map empirically verified against OCP firmware (bit order differs from OCP display order).

### New Features
4. Jandy JXi/LXi heater RS485 protocol support with fault message handling (#1128).
5. Virtual IntelliChem support with alarm sync and API routes for testing without hardware.
6. Virtual chlorinator support with full emulation of chlorinator protocol responses.
7. Chlorinator comms-lost alert from Action 204 byte 34.
8. Configurable single mixing period option for chemistry controllers (#1181). Thanks to @johnny2678.
9. IntelliBrite light sequencing delay detection: OCP/ICP "gray-out" state now propagates to dashPanel via inbound A184 channel 0x94AF decode. Circuit button dims and disables clicks during theme sequencing.
10. v3 light group Swim/Set/Sync commands: dashPanel triggers via v3 A184 protocol (channel 0x58A3, target 0x8AB1) instead of v1 rapid-toggle sequencing. Group and member circuits show disabled state until OCP confirms completion.
11. Automatic lat/lon resolution from zip code: heliotrope sunrise/sunset calculations now fall back to a bundled US zip code coordinate table when latitude/longitude are not explicitly configured or provided via environment variables.
12. Alert notification management: full PUT `/config/alerts` endpoint for all 7 alert categories (circuits, pumps, ultratemp, chlorinator, intellichem, hybrid, connected gas) with Select All / Select None support. dashPanel pnlAlerts config UI with per-category accordion, checkbox list, and real-time selected/total counts.
13. ICP→dashPanel alert sync: alert notification changes made on ICP now propagate to dashPanel in real-time via A168 cat=13 piggyback handler in the v3 early-return guard (same pattern as ISSUE-073 body capacity).
14. v3 delay configuration: freeze cycle time, valve delay, and cooldown delay now decoded from A30 cat=0 sub=0 and writable via A168. dashPanel Delays panel binds `valveDelay` for ICv3 (was `pumpDelay`). Cancel delay endpoint added (`PUT /state/cancelDelay`).
15. v3 Timed Service Mode (Timeout) detection from A204 byte 9 bit 1.
16. Remote control configuration: virtualCircuits byteValueMap corrected for remote button context with missing entries added (All Lights On/Off, Pool Heat Enable). dashPanel iS10 body selection locked to Spa.
17. Cover configuration fixes: circuit IDs corrected for 0-indexed wire protocol, body flags bit 3 polarity fixed (set=Spa not Pool), dashPanel cover config excludes Pool/Spa body circuits. Homepage Covers section added with valve-style widget.
18. v3 circuit group toggle fix: API now sends on correct A184 channel (0x58A3 instead of 0x688F). ICP-initiated light group theme changes propagate sequencing state to dashPanel.
19. Freeze protection manual override detection: A204 byte[47] decoded as per-body override bitmask (bit 0=Pool, bit 1=Spa). New `manualFreezeOverride` boolean on body state distinguishes normal freeze cycling from user-initiated override. Smart body toggle forces ON during freeze (prevents accidental OFF).
20. dashPanel freeze protection UI: green indicator for freeze cycle, blue for manual override, subtitle text ("Freeze Cycle" / "Manual Override"), enhanced banner with per-body override detail.

### Bug Fixes
21. IntelliCenter v3 circuit/light group eggTimer offset regression: outbound A168 cat=6 now sends 45-byte payload with eggTimer at bytes 40-41 (was incorrectly at 38-39). Inbound ExternalMessage.processGroupSettings also reads v3 offset. Added processEggTimer protection guard against OCP overwriting valid local values with 0.
22. IntelliCenter V3 chlorinator: fixed payload format, improved superChlor handling, debounced spurious 255 values.
23. JXi burner-on status: use bitmask check instead of equality for reliable detection.
24. JXi/LXi heater: default RS485 address to 0x68/0x38.
25. EquipmentStateMessage: header byte check to disambiguate IntelliCenter from IntelliTouch i9+3 (#1179).
26. IntelliCenterBoard: process 3rd power center expansion modules correctly (#1171).
27. Chlorinator ID fallback when `useChlorinator` is true in `setORPAsync`. Thanks to @johnny2678 — [PR #1178](https://github.com/tagyoureit/nodejs-poolController/pull/1178).
28. Hayward remote control handler: fix no-op catch (#1182).
29. ChemDoser: simplify singleMixPeriod loop.
30. IntelliCenter v3 expansion panel decoding and plugin address management improvements.
31. Schedule calculation crash when heliotrope invalid: `calcAdjustedTimes` now guards against undefined `dt` and missing lat/lon; `calcSchedule` null-checks `endTime` before calling `.getTime()`.
32. Schedule `nsod` (tomorrow start-of-day) was calculated as yesterday due to copy-paste typo (`addHours(-24)` → `addHours(24)`).
33. Alert bitmask mixed endianness: 4-byte selectors (IntelliChem, Hybrid) use little-endian while 1-2 byte selectors use big-endian. Encode (`maskToBytes`), decode (`extractAlertMask`), and piggyback decode (`applyAlertNotificationFromExternal`) all branch on byte count.
34. A168 cat=11 security role write: fixed phantom duplicate creation from incorrect byte[2] and trailing bytes.
35. dashPanel Save Remote response wrapper not unwrapped — `dataBind` crash on `type.desc` fixed.
36. dashPanel freeze state race condition: body socket event fires before A204 byte[47] decode completes. Controller `state/all` handler now updates body labels and indicators atomically from the authoritative snapshot data.
37. RunOnce schedule type: skip `recalc` check that incorrectly expired one-shot schedules.

## 9.0.0
Focused release on IntelliCenter v3.008 firmware compatibility, finishing the v3 work started in 8.4.1, plus the Regal Century pump Modbus fixes.

1. IntelliCenter v3.008 chlorinator support: row-major stride-9 decoder for Action 30 cat=7 sub=0 payloads and live-edit piggyback on Action 168 cat=7.
2. v3 state polling so feature and circuit changes from the panel appear in dashPanel within seconds instead of ~30s.
3. v3 heater management: ETI250 (type 8), expanded heater type/mode coverage, and improved control-path handling.
4. v3 body handling: body capacity updates from ExternalMessage and enhanced unit handling.
5. v3 light group state management improvements (sync-back, theme/color updates, stuck-action clearing).
6. v3 firmware change detection so configuration reloads when the OCP firmware version shifts.
7. Circuit management enhancements in IntelliCenterBoard and CircuitCommands; `getCircuitFunctions` retains pool/spa options across call sites.
8. Virtual equipment management with new API endpoints.
9. Equipment item queuing refactor in `IntelliCenterConfigQueue` for v3 compatibility.
10. Regal (Century) Modbus pump now supported as equipment in Nixie: improved collision detection, header validation via `pumpTypes` (accepts messages only from configured RegalModbus pumps), and NACK/fault response handling on Go/Stop commands (0x41/0x42). Thanks to @celestinjr — [PR #1169](https://github.com/tagyoureit/nodejs-poolController/pull/1169).

## 8.4.1
Major v3.004+ IntelliCenter refinement release covering three months of work on top of 8.4.0.

1. IntelliCenter v3.004+ circuit control via indexed Action 184 frames with learned target IDs and collision prevention; Action 168 no longer used for v3 circuit on/off.
2. v3.004+ feature handling: features use the new [232,157] payload block; feature state delegated through the circuit path; config requests piggyback on confirmations instead of debouncing.
3. Big-endian payload handling across v3.004+ (pumps, schedules, options) with a unified `readInt` helper.
4. v3.004+ pump configuration: speed/flow encoding, forced refresh on WCP changes, destination addressing, and streamlined payload processing.
5. v3.004+ temperature and location handling: variable payload offsets for Action 168 temp settings, latitude/longitude calculation accuracy, and proper refresh on general configuration updates.
6. Freeze cycle and freeze override settings exposed on Equipment and IntelliCenter classes.
7. Watchdog functionality added to IntelliCenter configuration handling.
8. Alerts functionality in Equipment and related classes — OCP alert state surfaced to dashPanel / API.
9. IntelliChem standalone mode for configurations without an OCP chemistry controller.
10. Nixie: Neptune Modbus pump support added to NixieBoard.
11. Nixie: NixieChemPump syncs circuit states instead of feature states (aligns relay bindings with the hardware-bound source of truth).
12. OCP write security enforcement in ConfigRoute — blocks mutations when OCP write is disallowed.
13. New `ultratempdirect` heater type for direct RS-485 UltraTemp control.
14. `*Touch` heat source/mode handling: `ultratemp` transforms to `heatpump` when undefined; OCP ghost heaters suppressed based on NCP control (#1116, #1060).
15. WaterColors light circuit support in circuit state management.
16. `assertSinglePoolSpaType` validation across boards to prevent invalid pool/spa circuit type combinations.
17. Hayward outbound action matching restored — response-level action index mismatch fix for non-IntelliCenter protocols (#1151).
18. Scope conditionally set in IntelliCenterBoard based on equipment version.
19. docker-compose.yml + README updates for local development and image channel clarity.
20. dashPanel image reference updates.
21. TypeScript config tweak to skip library checks for faster builds.

## 8.4.0
1. IntelliCenter v3.004+ support (still being refined): registration handling, config refresh/ACK handling, and improved source-of-truth processing to keep state accurate.
2. IntelliCenter v3.004+ circuit control updates: Action 184 support with learned Target IDs for more reliable circuit on/off behavior.
3. IntelliCenter v3.004+ protocol parsing fixes: byte shift handling for Wireless messages, big-endian schedule times, and options/setpoint processing improvements.
4. More resilience and reduced noise: improved initialization/race handling, better scoped logging, and longer device announce intervals.
5. Misc fixes: default chlorinator naming and other small stability improvements.
6. Huge thanks to @jwtaylor310 for providing a ton of replay captures that helped track down and fix bugs.

## 8.3.0
1. Configurable RS‑485 transmit pacing via new `controller.txDelays` for finer collision avoidance and throughput tuning.
2. Startup & config resilience: empty or invalid `config.json` now auto‑recreated from defaults, corrupt originals backed up.
3. Latitude / longitude environment overrides to eliminate early heliotrope warnings prior to UI configuration.
4. Version check enhancements: git detection, safer redirects, throttled polling, warning suppression.
5. Docker improvements: fixed Dockerfile and added docker‑compose example with named volumes & environment variable guidance.
6. Add workflow to build and publish docker images to GitHub Container registry.
7. Runtime requirements: elevated minimum Node.js version to 20+, safe dependency and security/patch updates.
8. Documentation updates.

## 8.1.2
1. Regal Century pump support added.
2. Enhanced error handling: replaced EquipmentNotFoundError with InvalidEquipmentIdError for improved clarity.
3. Improved error handling in NixieBoard, NixieCircuitCommands, and NixieValveCommands.
4. Refactored tolerance handling in TouchChemControllerCommands to ensure data integrity.
5. Added new expansion board configuration for SunTouchBoard.

## 8.1.1
1. Enhanced REM server integration with packet capture functionality.
2. Improved error handling in REMInterfaceServer methods.
3. Refined chlorinator message processing logic in MessagesMock.
4. Adjusted mock port checks across various components for consistency.
5. Refined logic for Nixie schedules.
6. Fixed documentation links for bindings integrations.
7. Enhanced queueBodyHeatSettings to handle processing timeouts and improve error logging.
8. Fixed typo in valveModes.

## 8.1.0
1. Support for dual chlorinators with REM chem controllers.  It is now possible to have two separate chlorinators controlled in 'dynamic' mode by two separate REM chems.  Note: In order for REM chem to control each chlorinator, each needs to be on a dedicated RS-485 port (not shared with an OCP or any other chlorinator).

## 8.0.1-8.0.5
1. Bug fixes including:
   a. schedule end time errors
   b. manual priority
   c. screenlogic recurring schedules
   d. VF pump message sequences
   e. intellibrite themes
   f. schedules are evaluated by bodies first and then everything else
   g. solar stop/start delta logic
2. Jandy WaterColors support
3. Initial docker support (github docker actions)

## 8.0.0
1. Refactor comms code to Async
2. Update dependencies and Node >16
3. EasyTouch v1 support
4. Screenlogic support — can now be used as a direct connection point for users who don't want to integrate an RS-485 adapter. RS-485 is still the preferred method as it is more fully featured.
5. Anslq25 (Mock controller)

## 7.7.0
1. Aqualink-D MQTT Interface
2. Manual Priority for Schedules
3. Add multiple RS-485 ports
4. Support for Hayward Pumps
5. Display remote chlorinators
6. Updates for ETi hybrid
7. Stop temp deltas for Nixie
8. Batch write influx points
9. MQTT & Influx updates
10. Ability to hide bodies in dashPanel
11. Florida Sunseeker Pooltone lighting
12. Proper uPNP formatting


## 7.6.1
1. Many bugfixes: Intellichem, Touch body capacities, Ultratemp heaters, Nixie, more...
2. Add env variables for Docker setup: POOL_RS485_PORT, POOL_NET_CONNECT, POOL_NET_HOST, POOL_NET_PORT, SOURCE_COMMIT, SOURCE_BRANCH
3. Update dependencies
## 7.6
1. MasterTemp RS485 support for Nixie and IntelliCenter
2. Nixie Valve Rotation delay
3. Nixie Heater Cooldown delay
4. Nixie Cleaner Start delay
5. Nixie Cleaner Shutdown on Solar
6. Nixie Delay Cancel

## 7.5.1
1. Backup/restore fixes
2. Egg timer expiration
3. Bug Fixes
4. dashPanel/messageManager Filter
5. RS485 refactor

## 7.5
1. Backup/restore
2. Intellitouch add expansion modules
## 7.4
1. Filter object, emit, monitoring

## 7.3.1
1. Influx 2.0 support

## 7.3
1. Dynamic chlorinating % based on ORP demand for Nixie
2. Docker creation updates

## 7.2
1. Refactor Intellichem and Chem Controllers

## 7.1.1
1. Added end time for circuits to show eggtimer/schedule off times
2. Ultratemp updates
3. Heater logic refactored
4. Message response logic refactored
5. Intellichem updates


## 7.1.0
1. Moved virtual chlorinator code and control to Nixie
2. Moved virtual pump code and control to Nixie; Nixie supports SS, DS, SuperFlo, VS, VF, VSF
3. MQTT changes
4. Outbound processing for packets now has a scope.  Previously if an outbound packet would receive a response we would clear all of the similar packets off the queue.  EG if a user requests circuit 2 and 3 to be turned on, we would clear out the outbound message for 3.  Now the code is more selective about what "scope" is considered for a successful response.

## 7.0.0
1. Upgrades to setup/sync between njsPC and REM (Relay Equipment Manager) — tight integration providing hardware control over ancillary pool equipment (chemical probes, pumps, tanks, heaters, etc).
2. Significant steps to njsPC (Nixie) acting as a standalone pool controller (virtual controller heaters, move virtual controller code, etc.)
3. Dependency updates (Typescript 4, Socket.io 4, etc)
4. Branch policy change: starting with this version, all code is pushed immediately to `master`. The `next` branch for feature development is retired.

## 6.5.2
1. Bug Fixes
2. Schedule updates
3. MQTT Binding updates
4. LSI calcs for REM (in addition to CSI)

## 6.5.1
1. Init Touch bodies upon startup
2. *Touch chlorinator fixes
3. MQTT updates

## 6.5.0
1. Full compatibility with REM (Relay Equipment Manager) for hardware control (ph sensors, orp sensors, pumps, relays, flow sensors)
1. Upgrades to Influx binding
1. MQTT alternate bindings
1. Many, many bug fixes

## 6.1.0
1. Chem controller
1. MQTT native support
1. Server based time for *Touch and other non-internet based OCP
1. Version notifications
1. IntelliCenter updates for dual bodies, 1.045/1.047 (partial) support
1. Many bug fixes

## 6.0.1
1. Implement https (no basic auth yet)
1. API documentation @ https://tagyoureit.github.io/nodejs-poolcontroller-api/
1. Add timestamp to logs for API calls
1. #200, #202

## 6.0
What's new in 6.0?s

In short, everything!  6.0 is a complete re-write of the application.  Huge props to @rstrouse for his wisdom and guidance in refactoring the code.

1. IntelliCenter - now supported
1. Configuring and running the app - all new.  Start over with the Installation instructions.
1. Automatic detection of your pool equipment.  Previous versions of the app would detect the configuration of your pool but you still had to tell the app if you had IntelliTouch/EasyTouch/IntelliCom.  This is now done automatically.
1. Configuration and state information.  Config.json now only stores information related to the configuration of the app.  There are separate files in the /data directory that store (and persist) pool configuration and state information.
1. API's - completely changed.  See separate API documentation (*link here)
1. Outbound Sockets - Now more granular to make the web app more responsive
1. Web app - Now a separate installion for a true client/server metaphore.
1. Node v12+
1. `Integrations` are now called `Bindings`.  Any integration built on 5.3 need to be upgraded to the binding format.  See Readme for a list of currently upgraded bindings.

## 5.3.3
#134

## 5.3.1
#132

## 5.3.0
Fix for #106
Fix for "Error 60" messages
Improved caching of files on browsers. Thanks @arrmo! Now files will be loaded once in the browser and kept in cache instead of reloaded each time.
Improved handling of sessions and graceful closing of the HTTP(s) servers.

## 5.2.0
1. Node 6+ is supported.  This app no longer supports Node 4.
1. Update of modules.  Make sure to run `npm i` or `npm upgrade` to get the latest.
1. Much better support of multiple Intellibrite controllers.  We can read both controllers now.  There are still some issues with sending changes and help is needed to debug these.
1. Chlorinator API calls (and UI) will now make changes through Intellitouch when available, or directly to the Intellichlor if it is standalone (aka using the virtual controller)
1. Decoupled serial port and processing of packets.  Should help recovery upon packet errors.
1. Implementation of #89.  Expansion boards are now (better) supported by setting variables in your config.json.  See the [config.json](#module_nodejs-poolController--config) section below.
1. Fix for #95
1. Fix for #99
1. Fix for #100

## 5.1.1 -
1.  Renamed all 'valves' items to valve to be in line with singular renaming of items
1.  InfluxDB - moved some items that were in tag fields to field keys; added valves
1.  Added days of week (with editing) back to the schedules.  Not sure when they disappeared, but they are back now.  #92
1.  Added MySQL integration to log all packets to a DB
1.  Fixed PR #95 to allow sub-hour egg timers
1.  Fixed Intellibrite bugs
1.  Started to move some of the inter-communications to emitter events for better micro-services and shorter call stacks (easier debugging; loosely coupled code).
1.  Changed some Influx tags/queries.

## 5.1.0 -
1. Intellibrite support - API's, Sockets and a WebUI.  Lights should have the 'Intellbrite' an their circuit function (set this up at the controller) to show up in this section.
Will document more later, but...
/light/mode/:mode
/light/circuit/:circuit/setColor/:color
/light/circuit/:circuit/setSwimDelay/:delay
/light/circuit/:circuit/setPosition/:position

See the constants.js file and the sections:
  strIntellibriteModes (for modes)
  lightColors (for setColor)

## 5.0.1 -
1. Fixed Influx error on startup #90
1. Fixed bad characters in custom names

## 5.0.0 -
Make sure to run `npm upgrade`.  There are many package updates and changes.

 * Added add/delete/edit schedule
 * All sockets/API now singular (`circuits`->`circuit`)
 * All sockets/API data now returned with a JSON qualifier. EG `{pump:...}`, `{circuit:...}`
 * Intellichem decoding and display
 * Changes to `/config` endpoint.  It's now included with the `/all` end point since there would be quite a bit of duplication.  It still exists standalone (for now) but has much less information in it.
 * Moved `hideAux` setting from `configClient.json` (web UI settings) to `config.json` template.  In `config.json` template, moved
    ```
    {equipment: {controller: {circuitFriendlyNames:{1..20}}}}

     // to

    {equipment: {circuit: friendlyName:{1..20},
                              hideAux: boolean
                              },
    }
    ```
    to be in line with the other equipment in the pool setup and accomodate the `hideAux` setting.

 * Fixed issue #82
 * Extra info from `/config` was being added to the circuit section in `config.json`
 * This release includes a new mechanism for updating config.json files. See notes in [config.json](#module_nodejs-poolController--config) section.
 * mDNS server.  Currently included for SmartThings integration, but in the future can be used for autodiscovery by other applications/devices.
 * New `/config` endpoint (beta) to allow applications to get a high level summary of the system.
 * Support for two separate (http/https) web servers, each/both with Auth, and also the option to redirect all http to https traffic.  Thanks to @arrmo for driving this with #65 and #68.
 * A UI for standalone pumps
 * All sockets and API's renamed to be SINGULAR.  Circuits -> circuit, Schedules->schedule, etc.
 * All returned JSON data (API/socket) now has the type qualifier per [#57](https://github.com/tagyoureit/nodejs-poolController/issues/57)
 * Make sure to run `npm upgrade`.  There are many package updates and changes.
 * Intellichem initial support.
 * Inactivity timer for both internal connections and web page connections.  If a connection is broken, it should re-establish itself automatically now.
 * SSDP for auto-discovery by SmartThings or other services

## 4.0.0 -
 * Changed much in the config.json file
 * Save pump programs and chlorinator level to config.json
 * Added support for GPM with pumps
 * Check for newer versions of the app on github, and dismiss notifications until next release
 * Bootstrap configuration is automatically saved in clientConfig.json via UI actions
 * Started to introduce some promises into the workflow (mostly with read/write operations)
 * Added log-to-file option
 * Added capture for Ctrl-C/SIGINT to have a clean exit
 * Added InfluxDB database capabilities
 * Added support for reading the data from up to 16 pumps.  (You can still only control two.)
 * Support for up to 50 circuits, 8 pumps
 * Delay and Cancel Delay for circuits

## 3.1.x -
 * Added unit testing for certain areas
 * Added setDateTime API/Socket
 * Bootstrap panel states are now persistent

## 3.0.0 -
 * Upgraded pump logic

## 2.0.0 -
 * https, Authentication
 * Completely refactored code.  Integrated BottleJS (https://github.com/young-steveo/bottlejs) for dependency injection and service locator functions
 * Integrations to loosely couple add-ons

## 1.0.0 -
 * Much of the code reworked and refactored
 * Added Bootstrap UI by @arrmo
 * Better standalone pump control (@bluemantwo was super-helpful here, too!)
 * More accurate recognition of packets
 * Super fast speed improvements
 * Outgoing packets are now sent based on a timer (previously number of incoming packets)
 * Added ISY support (@bluemantwo was super-helpful here, too!)