Add full CMD 0x12 gas heater status decoding (HiNRG 0x0072 / ICI 0x0074)#42
Merged
Merged
Conversation
Decodes the gas heater device-side status broadcast (CMD 0x12) from both the HiNRG (0x0072) and ICI (0x0074) gas heater variants into a structured pool_state representation, with full MQTT and web API exposure. ### Status byte decoding The single status byte is split into a 5-bit functional_status field (bits 0–4) and a 3-bit diagnostics field (bits 5–7): Functional bits (decoded via named bitmasks): - Bit 0: Heater On - Bit 1: Pressure / Flow - Bit 2: Gas Valve - Bit 3: Flame - Bit 4: Locked Out Diagnostic bits (named via BLE library cross-reference; not yet observed set): - Bit 5: General Service Required - Bit 6: Ignition Service Required - Bit 7: Cooling Available (heat pump capable) Functional status combinations map to heater_status_t states: Off, No Flow, Setpoint Reached, Igniting, Heating, Cooldown, Locked Out. The gas valve and flame bits additionally derive a gas_heater_burner_state_t (Off / Igniting / Alight). ### State and MQTT New pool_state fields (gas_heater_valid gated): water_flow_detected, locked_out, burner_state, general_service_required, ignition_service_required, cooling_available, status (gas_heater_status_t) MQTT: existing gas_status topic extended with the three new diagnostic boolean fields. Three new HA binary_sensor discovery entities published (General Service Required, Ignition Service Required, Cooling Available). ### Web API /status JSON gas_status object updated to include all fields including the three new diagnostic booleans. ### Protocol documentation PROTOCOL.md updated with the full bit table, observed state transitions, prerequisite rules, and a note on the diagnostic bits.
ee2f0ae to
7fc0132
Compare
marklynch
approved these changes
Jun 22, 2026
marklynch
left a comment
Owner
There was a problem hiding this comment.
This looks great. Fantastic work on this, and I love the fact that it flags the service pieces.
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.
Decodes the status byte from gas heater CMD 0x12 messages into a structured heater_status_t (Off/No Flow/Setpoint Reached/Igniting/Heating/Cooldown/ Locked Out) and gas_heater_burner_state_t (Off/Igniting/Alight), plus water_flow_detected and locked_out booleans.
Also includes extra status bits we haven't seen yet as per https://github.com/pbutterworth/pychlorinator/blob/main/pychlorinator/halo_parsers.py#L1105
Publishes a gas_status JSON topic to HA with seven discovery entities: status enum sensor, burner enum sensor, water flow binary sensor, locked-out binary sensor, and three diagnostic binary sensors (General Service Required, Ignition Service Required, Cooling Available). Discovery options for the enum sensors are driven directly from the HEATER_STATUS_NAMES / BURNER_STATE_NAMES arrays (single source of truth). The service sensors use device_class: problem so they surface as alerts in HA when set.
Fixes #41