Skip to content

Add full CMD 0x12 gas heater status decoding (HiNRG 0x0072 / ICI 0x0074)#42

Merged
marklynch merged 1 commit into
marklynch:mainfrom
lawther:feat/heater-status
Jun 22, 2026
Merged

Add full CMD 0x12 gas heater status decoding (HiNRG 0x0072 / ICI 0x0074)#42
marklynch merged 1 commit into
marklynch:mainfrom
lawther:feat/heater-status

Conversation

@lawther

@lawther lawther commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

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

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.
@lawther lawther force-pushed the feat/heater-status branch from ee2f0ae to 7fc0132 Compare June 22, 2026 02:13

@marklynch marklynch left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Fantastic work on this, and I love the fact that it flags the service pieces.

@marklynch marklynch merged commit 78087cb into marklynch:main Jun 22, 2026
2 checks passed
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.

Gas heater status (HiNRG) not being accurately reflected in Home Assistant

2 participants