No description
Find a file
2026-10-18 21:25:48 +02:00
docs Add Modbus protocol spec V1.7 PDF (Huizhou Dahua 0760 controller) 2026-09-25 07:28:35 +02:00
.gitignore Add Modbus protocol spec V1.7 PDF (Huizhou Dahua 0760 controller) 2026-09-25 07:28:35 +02:00
AGENTS.md Fix code-review findings on ff7a6fb 2026-10-18 21:23:40 +02:00
README.md Fix code-review findings on ff7a6fb 2026-10-18 21:23:40 +02:00
secrets.yaml.example Fix code-review findings on ff7a6fb 2026-10-18 21:23:40 +02:00
zealux-heatpump.yaml Fix code-review findings on ff7a6fb 2026-10-18 21:23:40 +02:00

Zealux Heat Pump → Home Assistant

An ESPHome integration for the Zealux Inverboost Classic Plus R290 heat pump (model XAH07Csi9). An Olimex ESP32-POE-ISO (Ethernet + PoE) polls and drives the heat pump's mainboard over Modbus RTU / RS485 and exposes all entities to Home Assistant via the native ESPHome API — no cloud, no WiFi module required.

The register map comes from the Huizhou Dahua 0760 MODBUS Protocol Specification V1.7, stored in this repo under docs/.

Hardware

Part Notes
Olimex ESP32-POE-ISO Ethernet (LAN8720 PHY) + PoE power
TTL-RS485 module (auto-flow-control) No DE/RE pin needed
PoE injector or PoE switch port Powers the ESP32 over the ethernet run

Wiring

Heat pump mainboard RS485 port: 4-pin JST connector, pinout A | B | G | +12V

  • A / B → RS485 data lines of the converter (swap A/B if you get no response)
  • G → GND
  • +12V → unused; the ESP32 is powered via PoE

GPIO notes

  • UART: GPIO32 (TX) / GPIO33 (RX) — free on the ESP32-POE-ISO EXT2 header
  • Ethernet (WROOM) uses GPIO12 (PHY power), 17 (clock), 18 (MDIO), 23 (MDC) plus the fixed RMII pins GPIO19/21/22/25/26/27 — do not use any of these
  • GPIO0 is a boot strapping pin — avoid it
  • This config assumes the WROOM module. On WROVER variants the PSRAM claims GPIO16/17, so the PHY clock moves to GPIO0: change clk.pin to GPIO0. Olimex also wires GPIO33 to the UEXT connector on WROVER; RX on GPIO33 still works as long as nothing is plugged into UEXT
  • If your board revision differs, adjust the pins in zealux-heatpump.yaml

Protocol

  • RS485, Modbus RTU, 9600 baud, 8 data bits, EVEN parity, 1 stop bit
  • Slave address 0x01 (default; settable via the line controller)
  • Function codes: 03 (read holding), 06 (write single), 10 (write multiple)
  • Max 38 registers per read/write block, addresses must be contiguous
  • Temperature / current registers are x10 scaled (multiply by 0.1)
  • Settings block: 0x0000–0x0027 (RW)
  • Measurement block: 0x0030–0x006A (R)
  • Each poll is two reads: settings 0x0000–0x0006 (7 registers) and measurements 0x0030–0x004E (31 registers). The unused rows in between are bridged with reuse_previous_range: true
  • 0x0045 status flags and 0x0046/0x0047 fault bitfields map to the panel E-codes (bit meanings are documented in the zealux-heatpump.yaml comments)

Entities

Polling runs every 10 s. Provided entities:

  • Switch — Power (0x0000)
  • Select — Operating mode (0x0001): Hot water + auto heating, Room heating, Hot water, Room cooling, Hot water + auto cooling
  • Numbers — Hot water setpoint (0x0002, 20–55 °C), Heating setpoint (0x0003, 15–45 °C), Cooling setpoint (0x0004, 5–35 °C)
  • Sensors
    • Settings (read-only): Hot water hysteresis (0x0005), Heating-cooling hysteresis (0x0006)
    • Operating state: compressor frequency (0x0031), target frequency (0x0041), operating current (0x0032)
    • Temperatures (all x10): return water, hot water, supply pipe, discharge, outdoor ambient, outdoor coil, return gas, after throttling. Each reads unknown while the heat pump reports a fault on that sensor (E02–E07, E19, E20)
    • Electrical: EEV opening (0x003C), DC bus voltage (0x004A), AC input voltage (0x004B), AC input power (0x004C), compressor phase current (0x004E)
    • Misc: IPM module temperature (0x0043), water pump duty cycle (0x0049)
    • Diagnostics (raw bitfields): protect code, shutdown code, status flags, fault symbols 1/2
  • Binary sensors — Defrosting, Water pump running, Fault present (on while any bit of fault symbol 1 or 2 is set)
  • Text sensor — Operating mode (reported), decoded via lambda

Build & flash

Requires ESPHome 2026.9 or newer (reuse_previous_range, OTA encryption via the API key).

The native API is encrypted, and OTA uploads reuse the same key. Create secrets.yaml (gitignored) from the template and put a fresh key in it:

cp secrets.yaml.example secrets.yaml
openssl rand -base64 32    # paste as zealux_heatpump__encryption_key

Home Assistant asks for this key when it adds the device (or re-adds it after the key changes). If you use the ESPHome add-on, the key goes in the add-on's secrets.yaml. A device that already runs firmware older than 2026.9 cannot accept encrypted OTA yet: install once without the encryption: line under ota:, then add it back and install again.

# Validate config
esphome config zealux-heatpump.yaml

# Compile
esphome compile zealux-heatpump.yaml

# First flash over USB (board has no firmware yet)
esphome run zealux-heatpump.yaml

# OTA afterwards: via ESPHome dashboard / HA add-on

Logs go over the API and, at 115200 baud, over USB serial. The Modbus UART uses its own pins (GPIO32/33), so serial logging stays on for debugging a first flash where Ethernet doesn't come up.

Gotchas & to-verify

  • The built-in Tuya WiFi module is also a Modbus master on this bus (FC 5AH in the spec). Decision: disconnect it; the ESP32 becomes the sole master and the cloud app is lost.
  • AC input power (0x004C), AC voltage (0x004B), DC bus voltage (0x004A), IPM temp (0x0043), compressor phase current (0x004E) and water pump duty cycle (0x0049, assumed %) have no documented scale in the spec. Verify empirically against the panel display / a meter and adjust filters.
  • Negative temperatures: outdoor ambient, outdoor coil, return gas and after-throttling (0x0038–0x003B) are read as signed values (two's complement assumed). Check the sign handling on the first cold day.
  • The measurement read also covers the reserved rows 0x0036, 0x0044 and 0x0048. If the settings read works but the measurement read fails, exclude those first: set reuse_previous_range: false on the item right after them.
  • Bit meanings of the protect code, status flags and fault symbols (with panel E-codes) are in the zealux-heatpump.yaml comments.

Safety conventions

  • Read-only sensors stay read-only; never write defrost/hysteresis registers from automations.
  • Writes are only to: power (0x0000), mode (0x0001), setpoints (0x0002–0x0004). Hysteresis (0x0005/0x0006) is exposed read-only; change it on the panel.