Skip to main content

PyHaier

Very simple (for now) library to manipulate the basic parameters of the Haier heat pump.

Donation

If you like My work and want to support me, you can:

Or if you from Poland:

Support

For support, join our Discord channel https://discord.gg/7aF38puD

Contributors

  • Daniel Mentel he found all information from functions added in 0.2.1 and 0.2.2 version

Version

0.4.4

  • Fix in SetDHWCompensation function

0.4.3

  • THIS VERSION IS NOT COMPATIBLE WITH OLDER VERSION.
  • few fixes
  • add SetPump and SetHeater
  • DEFROST and ANTIFREEZE status are removed from Get3way. Now are in saparete functions GetDefrost and GetAntifreeze.

0.4.2

  • add GetLastError for displaying last error
  • fix GetError, now displaying active error (IMPORTANT!!! now the function takes registers 141-157 as arguments)

0.4.1

  • Fix in GetPump function

0.4.0

  • Fix in GetHeater function

0.3.9

  • add new 'ANTIFREEZE' status in Get3way function

0.3.8

  • new function GetHeater to display Heater status

0.3.7

  • new function GetFirmware to display the current firmware version

0.3.6

  • Tdef (thanks to Daniel Mentel)
  • Defrost status

0.3.5

  • small fixes

0.3.4

  • new function GetTSatPd, GetTsatPs, GetEEVLevel by Daniel Mentel

0.3.1

  • new function GetThiTho by Daniel Mentel
  • fixed functions GetTao, GetTdTs, SetCHTemp

0.3.0

  • few fixed for GetTdTs and GetPump functions
  • add error handling when frame passed to function has bad length

0.2.9

  • one more fix

0.2.8

  • few more fix

0.2.7

  • one more fix

0.2.6

  • fix function name

0.2.5

  • add GetPump function to show if buildin pump is on or off
  • add Get3way function to show what position the 3-way valve is in

0.2.4

  • some fixes

0.2.3

  • use divmod

0.2.2

  • add GetTdTs function showing Td and Ts parameters as array
  • add GetPdPs function showing current and set Pd parameter (for now only Pd) as array
  • add GetFanRpm function showing Fan1 and Fan2 rpm, as array
  • add GetTao function showwing ambient temperatura
  • rename GetCompFreq function to GetCompInfo and add to this function other information like temperature, voltage and current about compressor, display as array

0.2.1

  • add GetCompFreq function showing current and set compressor frequency
  • add GetArchError function showing three archive errors as array
  • add GetEEVLevel function showing current EEV opening level

0.2.0

  • rename 'silent' to 'quiet' in GetMode and SetMode function to be consistent with haier nomenclature

0.1.9

  • fix for SetState. Now turning on/off emulate "leaf" button on YR-e27

0.1.8

  • fix for previous fix :D

0.1.7

  • fix turning on pump in SetState function

0.1.6

  • Just for pip upload

0.1.5

  • More error handling

0.1.4

  • Update in error handling

0.1.3

New function

  • Add function to read Compressor frequency

0.1.2

New function:

  • Get value of Twi and Two parameters (not 100% sure if this is OK.)

0.1.1

New function:

  • Get current DHW tank temperature

0.1.0

Basic function:

  • Get current state
  • Get current mode
  • Get current Heating temperature
  • Get current DHW temperature
  • Set state
  • Set mode
  • Set Heating temperature
  • Set DHW temperature

Tested with

  1. AU082FYCRA(HW)
  2. AU162FYCRA(HW)

However, it should work with all pumps that feature the YR-e27 remote control

Instalation

Install from pip

$ pip install PyHaier

Install from source

$ git clone https://github.com/ktostam/PyHaier.git
$ cd PyHaier
$ python setup.py install

Usage

PyHaier.GetState(payload)

Display current state (Cool/Heat/Tank/Cool+Tank/Heat+Tank/Off).

You need provide payload for GetState function. payload is the contents of holding registers 101-106


PyHaier.GetMode(payload)

Display current Mode (ECO/Silent/Turbo).

You need provide payload for GetMode function. payload is the contents of holding register 201


PyHaier.GetCHTemp(payload)

Display current water temperature with precision 0.5°C

You need provide payload for GetMode function. payload is the contents of holding registers 101-106


PyHaier.GetDHWTemp(payload)

Display current DHW temperature with precision 1°C

You need provide payload for GetMode function. payload is the contents of holding registers 101-106


PyHaier.GetDHWCurTemp(payload)

Display current DHW temperature in Tank with precision 0.1°C

You need provide payload for GetDHWCurTemp function. payload is the contents of holding registers 141-156


PyHaier.GetTwiTwo(payload)

Display Twi and Two parameters with precision 0.1°C, output is an array

You need provide payload for GetTwiTwo function. payload is the contents of holding registers 141-156


PyHaier.SetState(current,new)

Create Modbus frame to set new pump state

You need provide payload for SetState function. payload is the contents of holding registers 101-106

new can be:

  • off
  • on
  • C for Cool
  • H for Heat
  • T for Tank
  • CT for Cool+Tank
  • HT for Heat+Tank

PyHaier.SetMode(new)

Set mode (eco/silent/turbo).

You need provide new for SetMode function. new can be:

  • eco
  • silent
  • turbo

PyHaier.SetCHTemp(current, new)

Set water temperature with precision 0.5°C

You need provide current for SetCHTemp function. current is the contents of holding registers 101-106

new is new temperature with precision 0.5°C


PyHaier.SetDHWTemp(current, new)

Set DHW temperature with precision 1°C

You need provide current for SetDHWTemp function. current is the contents of holding registers 101-106

new is new temperature with precision 1°C


PyHaier.GetCompFreq(payload)

Display set and actual compressor frequency, output is an array

You need provide payload for GetCompFreq function. payload is the contents of holding registers 241-261


PyHaier.GetArchError(payload)

Display archve error codes, output is an array

You need provide payload for GetArchError function. payload is the contents of holding registers 241-261


PyHaier.GetEEVLevel(payload)

Display actual EEV opening level

You need provide payload for GetEEVLevel function. payload is the contents of holding registers 241-261

Example script 1

from pymodbus.client.sync import ModbusSerialClient
import PyHaier

# Serial setting
client = ModbusSerialClient(method = "rtu", port="/dev/ttyAMA0", stopbits=1, bytesize=8, parity='E', baudrate=9600)

# connect to serial
client.connect()

#read holding registers from 101 to 106
payload=client.read_holding_registers(101, 6, unit=17)
state=PyHaier.GetState(payload.registers)
htemp=PyHaier.GetCHTemp(payload.registers)
dhwtemp=PyHaier.GetDHWTemp(payload.registers)
payload=client.read_holding_registers(201, 1, unit=17)
mode=PyHaier.GetMode(payload.registers)
client.close()
print("Pump status:\t"+state+"\nPump mode:\t"+mode+"\nWater temp:\t"+str(htemp)+"\nDHW temp:\t"+str(dhwtemp))

Output

$ python script.py
Pump status:	Heat+Tank ON
Pump mode:	silent
Water temp:	25.0
DHW temp:	43.0

Example script 2

from pymodbus.client.sync import ModbusSerialClient
import PyHaier

# Serial setting
client = ModbusSerialClient(method = "rtu", port="/dev/ttyAMA0", stopbits=1, bytesize=8, parity='E', baudrate=9600)

# connect to serial
client.connect()

#read holding registers from 101 to 106
payload=client.read_holding_registers(101, 6, unit=17)
state=PyHaier.GetState(payload.registers)
print("Current state:\t"+state)
new=PyHaier.SetState(payload.registers,"CT")
client.write_registers(101, new , unit=17)
payload=client.read_holding_registers(101, 6, unit=17)
state=PyHaier.GetState(payload.registers)
print("New state:\t"+state)
client.close()

Output

$ python script.py
Current stete:	Heat+Tank ON
New state:	Cool+Tank ON

License

GNU GPL ©Jacek Brzozowski

Metadata

Release files for PyHaier 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyHaier 0.4.4
File Size Uploaded Provenance
pyhaier-0.4.4.tar.gz 11.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for PyHaier 0.4.4
File Interpreter ABI Platform
pyhaier-0.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 28.8 kB

Release files / pyhaier-0.4.4.tar.gz

Download URL pyhaier-0.4.4.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b84de0edc49f83bf48cc6058d8826dabe714dd954dfad8789dd1a7d904609c35
BLAKE2b-256 checksum
How to use checksums
4abd49e681cd4cf865d2c1f8e7daa340bf0a0ea4ee629a376bc5ee079cd8cefc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / pyhaier-0.4.4-py3-none-any.whl

Download URL pyhaier-0.4.4-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4e1df8b97688467bae3d8e5a66fce4b3c3a1939de8a26854abdae5a38eb986f
BLAKE2b-256 checksum
How to use checksums
0b281d278c9be50ed0f573eea5ea6dee059642a407faa88971947ef7a97ec10a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for PyHaier 0.4.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page