Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a fix for acid dosing calculations for Halo controllers running firmware 2.7.
The current implementation interprets the
0x0259DosingPumpSecsvalue 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
0x0259value is already reported in millilitres.The change therefore makes the interpretation firmware-specific:
0x0259is treated as millilitres directly.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
0x0259field:0x0259value:756Dosing Pump: 756 ml todayA later observation produced:
0x0259value:263Dosing Pump: 263 ml todayThe 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 mLand:
263 seconds × 55 mL/min ÷ 60 = 240.9 mLThis 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_todaydata is also migrated to the newlast_dosing_todaykey.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
Raw protocol validation
The controller's
0x0259dosing packet was captured from the WebSocket connection and independently decoded.Observed values:
0x0259valueDosing Pump: 756 ml todayDosing Pump: 263 ml todayThe raw packet containing
263was 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:
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.