Skip to content

Fix acid dosing units for Halo firmware 2.7 - #5

Open
trevvv123 wants to merge 3 commits into
robmarkoski:mainfrom
trevvv123:fix-acid-dosing-fw27
Open

trevvv123 wants to merge 3 commits into
robmarkoski:mainfrom
trevvv123:fix-acid-dosing-fw27

Conversation

@trevvv123

Copy link
Copy Markdown

Summary

This PR implements a fix for acid dosing calculations for Halo controllers running firmware 2.7.

The current implementation interprets the 0x0259 DosingPumpSecs value as seconds and converts it to millilitres using the configured acid pump rate.

This has been tested against a live Halo controller running firmware 2.7, which shows that the raw 0x0259 value is already reported in millilitres.

The change therefore makes the interpretation firmware-specific:

  • Firmware 2.7: 0x0259 is treated as millilitres directly.
  • Other/unknown firmware: the existing seconds-based calculation is retained.

This avoids changing the interpretation for firmware versions that have not yet been independently validated.

Evidence

The Halo physical panel reports the same value as the raw 0x0259 field:

  • Raw 0x0259 value: 756
  • Halo panel: Dosing Pump: 756 ml today

A later observation produced:

  • Raw 0x0259 value: 263
  • Halo panel: Dosing Pump: 263 ml today

The raw WebSocket packet was independently decoded and the relevant little-endian value matches the parser result.

Using the previously observed pump rate of 55 mL/min as a seconds-based calculation would not produce these values. For example:

756 seconds × 55 mL/min ÷ 60 = 693 mL

and:

263 seconds × 55 mL/min ÷ 60 = 240.9 mL

This supports treating the raw value as millilitres on firmware 2.7.

Implementation

The acid reservoir tracker and "Acid Used Today" sensor now use the firmware version when interpreting the dosing counter.

For firmware 2.7, the raw value is used directly as mL and the pump rate is not required. A new variable has been created to define supported Firmware versions with the updated use of the raw value. If other Firmware versions are know to operate the same, additional value can be added.

For any other firmware versions, the existing seconds × pump-rate calculation remains unchanged.

Existing persisted last_seconds_today data is also migrated to the new last_dosing_today key.

Notes

The Halo protocol is reverse-engineered and there is no official AstralPool raw protocol documentation available for this field.

The firmware-specific behaviour is therefore deliberately limited to firmware 2.7, which has been verified against a live controller.
Additional firmware versions should only be added after independent validation.

Testing / Validation

Tested against a live AstralPool Halo controller running firmware 2.7.

Hardware

  • AstralPool Halo Chlor 25 controller
  • Firmware: 2.7
  • Home Assistant custom integration running from this branch

Raw protocol validation

The controller's 0x0259 dosing packet was captured from the WebSocket connection and independently decoded.

Observed values:

Raw 0x0259 value Halo physical panel
756 Dosing Pump: 756 ml today
263 Dosing Pump: 263 ml today

The raw packet containing 263 was also independently decoded by the parser, confirming that the value reaching the acid tracker was the same value present in the controller packet.

If the raw value were seconds, the existing 55 mL/min pump-rate conversion would produce:

  • 756 seconds → 693 mL
  • 263 seconds → 240.9 mL

Neither matches the controller's displayed value.

Home Assistant validation

The modified files were copied into a running Home Assistant installation and Home Assistant was restarted.

The integration started successfully and continued to receive live controller data.

The acid reservoir tracking was then exercised with the firmware-2.7 dosing values. The firmware-specific calculation uses the controller value directly as millilitres and does not require the pump-rate value.

The daily counter rollover from 756 to 263 was also handled as a new daily value rather than a negative usage delta.

Scope of validation

This has been validated on one live Halo controller running firmware 2.7.

The raw protocol is reverse-engineered and there is no official AstralPool protocol documentation for this field. For that reason,
firmware 2.7 is handled explicitly rather than changing the interpretation for all firmware versions.

Other firmware versions have not been independently validated by this testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant