ESP Haier: Haier Air Conditioner + ESP Home + Wemos D1 mini

I’m not an HVAC expert, but according to this nicely written manual I found for some multi-split unit, I think these two sensors are:

Outdoor In Air Temperature = Compressor Suction Temperature
Outdoor Out Air Temperature = Compressor Discharge Temperature

79°C on discharge while heating seems right.

2 Likes

Hi @evlo Can you provide logs for every action? Including setting away with the remote. I need 15-20 seconds of logs before action and 15-20 after.

Hi all!

I’m very grateful for all the work you guys have put into this integration as it helped me to get my Haiers into HomeAssistant even though an official integration still lacks within the HomeAssistant ecosystem.

Unfortunately, the whole experience wasn’t without some serious hours of troubleshooting as I didn’t get to a working setup without a fight. So I thought I’d document this for anyone who might experience a similar situation.

Original Setup:

  • 2x Haier Tundra 2.5 kW Airco units (IR Remotes)
  • 2x KZW-W002 WiFi adapter (Work with SmartAir2 App, NOT with the Hon App)

New Setup

  • 2x ESP-12 D1 Mini NodeMcu Lua Wifi (ESP8266)
  • 2x old USB-A cables
  • ESPHome + HomeAssistant

Process

  • Took an old USB-A cable and cut it as described in the OP
  • Soldered the wires according to the wiring scheme
  • Installed UART drivers on my laptop to detect the serial ESP device via it’s onboard microUSB-port (COM10)
  • Created a .yaml file with the Haier SmartAir2 protocol configuration
  • Newly created dongle was recognized by ESPHome
  • Config.yaml was validated and installed on the ESP-12 D1 mini
  • The new dongle, while still powered by my laptop was able to connect to my Wifi and showed it used the smartair2 protocol and captured traffic

At this point I thought I got it all working in one go, but boy was I wrong.

Once I installed the dongle in the Haier unit it powered on and was discovered by ESPHome. However, it showed timeouts in the log and the entities were not showing any data in HomeAssistant. When I clicked a button in the HVAC card in HA, it did show the action in the ESPHome log, but showed an error sending the request to the Haier.

I started to read up on potential issues and tried to strip the configuration to its bare minimum, even re-soldered the wires to make sure everything was correct. I don’t know how many time I re-flashed the configuration to the ESP-12 D1 Mini, but it was a lot!

Long story short…
As my units only worked with the SmartAir2 app, I only focussed on this protocol for the configuration, assuming the Hon protocol would not work.
Turned out I was wrong again, as this caused the issue all along.

  • Thanks to the post of @Chris.tian, I decided to give the Hon protocol a try
  • I’ve reset my ESP-12 D1 mini to its original state and changed the configuration to suit the Hon protocol instead of the SmartAir2 protocol, and got success!

Lesson learned:

  • Even though you always used the SmartAir2 app with your Haier Unit, it doesn’t mean it can ONLY work with the SmartAir2 protocol.

I hope this helps others who struggle with getting their older Haier units to work. I know it would have saved me at least a few hours of irritation and troubleshooting.

This is my working Haier-Hon-configuration.yaml content:

esphome:
  name: aircokantoor
  friendly_name: "Airco Kantoor"
  name_add_mac_suffix: false
  min_version: 2024.6.0
  project:
    name: esphome.web
    version: dev

esp8266:
  board: esp01_1m

# Enable logging
logger:
  level: DEBUG
  baud_rate: 0

# Enable Home Assistant API
api:
  password: "thisisanicepassword"

# Allow Over-The-Air updates
ota:
- platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

captive_portal:

dashboard_import:
  package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
  import_full_config: true

# To have a "next url" for improv serial
web_server:

uart:
  baud_rate: 9600
  tx_pin: 1
  rx_pin: 3
  id: ac_port

climate:
  - platform: haier
    id: haier_kantoor
    protocol: hon
    name: Airco Kantoor
    uart_id: ac_port
    wifi_signal: true   # Optional, default true, enables WiFI signal transmission from ESP to AC
    visual:                     # Optional, you can use it to limit min and max temperatures in UI (not working for remote!)
      min_temperature: 16 °C
      max_temperature: 30 °C
      temperature_step: 
        target_temperature: 1
        current_temperature: 0.5
    supported_modes:            # Optional, can be used to disable some modes if you don't need them
      - 'OFF'                     # always available
      - HEAT_COOL                 # always available
      - COOL
      - HEAT
      - DRY
      - FAN_ONLY
    supported_swing_modes:      # Optional, can be used to disable some swing modes if your AC does not support it
      - 'OFF'
      - VERTICAL
      - HORIZONTAL
      - BOTH
    supported_presets:          # Optional, can be used to disable some presets if your AC does not support it
      - BOOST
      - SLEEP

sensor:
  - platform: haier
    haier_id: haier_kantoor
    power:
      name: Airco Kantoor Power

binary_sensor:
  - platform: haier
    haier_id: haier_kantoor
    indoor_fan_status:
      name: Airco Kantoor Indoor Fan Status
    compressor_status:
      name: Airco Kantoor Compressor Status
    defrost_status:
      name: Airco Kantoor Defrost Status
3 Likes

I have tried repeatedly to find a solution for the installation, but this problem keeps appearing.

Validate esphaier.yaml :x:
INFO ESPHome 2024.12.4
INFO Reading configuration /config/esphome/esphaier.yaml…
ERROR Error while reading config: Invalid YAML syntax:

while parsing a block collection
in “/config/esphome/esphaier.yaml”, line 31, column 3
expected , but found ‘?’
in “/config/esphome/esphaier.yaml”, line 54, column 3

Hi @Trtr1010 ,

Can you please show your yaml file (without passwords and keys) please?

Hi paneled

this is my yaml
I don’t know if what I did is correct or not, but it’s not working for me

esphome:
  name: esphaier
  friendly_name: ESPHaier

esp8266:
  board: esp01_1m


# Enable Home Assistant API
api:
  encryption:
    key: "******************"

ota:
  - platform: *********
    password: "*********"

wifi:
  ssid: "**********"
  password: "*********"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "*********"
    password: "*********"

captive_portal:

# Define UART settings
uart:
  - id: ac_port
    tx_pin: GPIO1
    rx_pin: GPIO3
    baud_rate: 9600

# Example configuration entry
climate:
  - platform: haier
    id: haier_ac
    protocol: hon
    name: Haier AC
    uart_id: ac_port
    wifi_signal: true
    display: true
    visual:
      min_temperature: 16 °C
      max_temperature: 30 °C
      temperature_step: 1 °C
    supported_modes:
      - 'OFF'
      - HEAT_COOL
      - COOL
      - HEAT
      - DRY
      - FAN_ONLY
    supported_swing_modes:
      - 'OFF'
      - VERTICAL
      - HORIZONTAL
      - BOTH
    supported_presets:
      - AWAY
      - BOOST
      - SLEEP
    on_alarm_start:
      then:
        - logger.log:
            level: WARN
            format: "Alarm activated. Code: %d. Message: \"%s\""
            args: [ code, message ]
    on_alarm_end:
      then:
        - logger.log:
            level: INFO
            format: "Alarm deactivated. Code: %d. Message: \"%s\""
            args: [ code, message ]
    on_status_message:
      then:
        - logger.log:
            level: INFO
            format: "New status message received, size=%d, subcmd=%02X%02X"
            args: [ 'data_size', 'data[0]', 'data[1]' ]

# Example configuration entry
sensor:
  - platform: haier
    haier_id: haier_ac
    outdoor_temperature:
      name: Haier outdoor temperature
    humidity:
      name: Haier Indoor Humidity
    compressor_current:
      name: Haier Compressor Current
    compressor_frequency:
      name: Haier Compressor Frequency
    expansion_valve_open_degree:
      name: Haier Expansion Valve Open Degree
    indoor_coil_temperature:
      name: Haier Indoor Coil Temperature
    outdoor_coil_temperature:
      name: Haier Outdoor Coil Temperature
    outdoor_defrost_temperature:
      name: Haier Outdoor Defrost Temperature
    outdoor_in_air_temperature:
      name: Haier Outdoor In Air Temperature
    outdoor_out_air_temperature:
      name: Haier Outdoor Out Air Temperature
    power:
      name: Haier Power

@Trtr1010
From your previous message, I got an impression that you can’t compile your config. But in this one it looks like you successfully compiled FW but it is not working. Can you provide me ESPhome logs from your device? I need 20-30 seconds of logs.

Thank you for the response
In fact, I have reached an advanced stage of preparation and then the matter worked for me, but I have a question
My AC on the smartair2 protocol, can I use the outdoor temperature sensor?
And what are the commands that can be used in this protocol?
Can I change the protocol to hOn?
Thanks

@Trtr1010
Glad it worked for you.

Unfortunately no. External sensor is not supported by SmartAir2 protocol.

Didn’t get your question. What commands do you need?

No. Internal block support only one protocol. If you use wrong protocol, internal block will not understand it.

Hello, have problem with my AC unit, worked great with custom_component from GitHub - MiguelAngelLV/esphaier: ESP8266 code to connect to Haier Air Conditioner with wifi module support

until esphome update, no longer support custom_components, any idea how to make it work again ?

Please use build-in components from esphome Haier Climate — ESPHome

I have succesfully managed to liberate myself from the Haier hOn app, replacing factory installed ESP32-for-Haier WiFi module with a D1 Mini ESP-8266EX board. ESPHome configured the device perfectly for Home Assistant, not in the least thanks to all of the useful instructions and examples on this forum … thank you, thank you, thank you, to all who have contributed!

I have one remaining question… The interface shows next to the target temperature the “Current temperature” (see screenshot). That is the inside temperature which was also visible previously in the hOn app, so my hardware supports it and somehow must be able to measure this temperature. However, I cannot find this as a separate Sensor entity in Home Assistant, it is not a disabled entity, and it does not show in the optional sensors which can be found at Haier Climate Sensors — ESPHome. I really would like to expose this, for example, to assign it as a Temperature sensor in the applicable Area in Home Assistant and run automations with it (“if room temperature drops blow certain value, turn on heat”, etc.). I’m not interested in the Outdoor temperature which can be successfully enabled with the “outdoor_temperature” statement in yaml. Can anyone help with this please?

Much appreciated!

Hi @gNeeUs,
I prefer to follow the standard way that all other climates use. Usual procedure climate component exposes current temperature to parent Climate and it passes it to Home Assistant as attribute (current_temperature). There are many ways to use this value in HA. For example, you can create automation that tracks changes of this attribute, or create template sensor in Home Assistant itself and expose current_temperature attribute of your climate (Template - Home Assistant). Alternatively, you can implement similar thing in ESPHome template sensor (Template Sensor — ESPHome).

1 Like

help

esphome:
name: kondisaner
friendly_name: kondisaner

esp8266:
board: esp01_1m

Enable logging

logger:

Enable Home Assistant API

api:
encryption:
key: “Uaz2Z783nLDk1Jcep9wDBNIm2ddQ3x9P73zFCw1Sgdo=”

ota:

  • platform: esphome
    password: “be4a9ee27c6dcf3980811bf59eab68df”

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:
ssid: “Kondisaner Fallback Hotspot”
password: “Rfewbjh5erW8”

captive_portal:
climate:

  • platform: haier
    id: ${device_id}
    protocol: smartAir2
    name: ${device_name}
    uart_id: ${uart_id}
    visual: # Optional, you can use it to limit min and max temperatures in UI (not working for remote!)
    min_temperature: 16 °C
    max_temperature: 30 °C
    temperature_step: 1 °C
    supported_modes: # Optional, can be used to disable some modes if you don’t need them
    • ‘OFF’ # always available
    • AUTO # always available
    • COOL
    • HEAT
    • DRY
    • FAN_ONLY
      supported_swing_modes: # Optional, can be used to disable some swing modes if your AC does not support it
    • ‘OFF’ # always available
    • VERTICAL # always available
    • HORIZONTAL
    • BOTH

Hi @izzatbek2315. So what is wrong? What kind of help do you need with your config?

I appreciate you designing this in a standard way @paveldn, I wouldn’t have it any other way. Thank you for the tip regarding the inside temperature, I did find the attribute! To expose that attribute as a sensor I found a little gem aptly named Attribute as Sensor which can be installed as an Integration. I now have 3 sensors in the house without any additional cost or installation effort.

My goal is to create a thermostat automation to turn the heat/cold on/off based on the reading of the current temperature and this will work much easier now that I can include those sensors in the automation.

Cheers!

1 Like

Worked perfectly using a Waveshare ESP-32-C3-Zero. The module is small enough to fit perfectly in the AC cavity.

Nothing too complicated to configure:

esp32:
  board: esp32-c3-devkitm-1
  framework:
  type: esp-idf

uart:
  baud_rate: 9600
  tx_pin: 21
  rx_pin: 20

Very impressive work by @paveldn . thanks a lot for all the time you have invested in this project.

I am looking forward to replace the modules in all my AC units. They are much more responsive than the standard hOn cloud based solution.

1 Like

Hallo ich schreibe in Deutsch da mein Englisch echt nicht gut ist. Ich wollte nur anderen Usern bescheid geben das dieses Skript unter ESPHome mit Anbindung an HomeAssistant auch für Klimaanlagen von Heiko funktioniert im hON Modus. Heiko ist ein polnisches Produkt was von Haier ?! Produziert wird ich habe den Original WLAN Dongle gegen einen ESP8266 ausgetauscht und es funktioniert hervorragend. Heizen, Kühlen, Temperatur, Licht an und ausschalten funktioniert. Und ein paar Sensor Werte kann ich auch auslesen. Meine Klimaanlage ist eine Heiko Brisa 3,5kW. Gruß, Daniel aus Deutschland

1 Like

Unfortunately no. External sensor is not supported by SmartAir2 protocol.

Is an external sensor supported by the hOn protocol? Also not right?

Hi, after many year for a trouble i open my AC Haier and i found on the board a connector with 5V GND TX RX. My old AC link 2010 yr don’t come with any usb or wifi but on the sticker in the internal unit i see that connector refer to a NET appliance so i think i can try whit a 8266 right??

So i flashed with esphome but i don’t understant the right config to upload…i see github of @paveldn but i’m lose in the many file “sorry” someone can help me?

Thank’s Mauro