ESPhome app including Haier (hOn based) AC Airconditioning

Hi All,

It has been a long time since I was last active here. In the early stages of homey I created some apps for z-wave devices. But along the way, I got other priorities.

Now I am biting into a new thing.

I have a Haier AC. There is no Haier app available yet.
The wifi module is connected through USB and therefor easily replaced. The Haier ac’s consist of 2 types:

  • Based on hOn
  • Based on SmartAir

There is a piece of software called “ESPhome” that can be installed on a Wemos D1 mini.
And can than be controlled by Home Assistent. But i don’t have that, i have a Homey ofcourse :smiley:
Someone created a piece of ESPhome software which should connect the Haier hOn AC to Home assistent: https://github.com/paveldn/haier-esphome

But I dont want to control my AC with Home assistent (for I don’t have that), I want to control my AC with my Homey.

Fortunately, someone has started developping a Homey app for ESPhome devices.
(which is than applied to the appstore by someone else without asking the developer!)
https://github.com/Inversion-NL/Homey-ESPhome

So now my plan is to add the ESPhome device for Haier AC into that app.
https://github.com/priknr1/Homey-ESPhome

But, my programming skills for homey are quite rusty. I added a new device, and the app is compiling.
I can fill in the IP and port for the ESPhome device, and it starts to communicate.
But then I get the following error 7 times before a timout occurs:

2023-04-14 18:11:38 [ManagerDrivers] [Driver:esphome-haier_ac] Error on device 192.168.1.119: TypeError: Cannot read property ‘deserializeBinary’ of undefined
at deserialize (/node_modules/esphome-native-api/lib/utils/messages.js:90:52)
at Socket. (/node_modules/esphome-native-api/lib/connection.js:26:34)
at Socket.emit (events.js:311:20)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at Socket.Readable.push (_stream_readable.js:209:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)

Is this 7 times the same error on a retry, or 7 different errors?
What could cause this error?
Does it maybe have to do with unknown capibily names?

1 Like

Baldhor has picked up the development of my app.
With my permission, this time. In contrary to the other app which was in the app store and is now replaced.

Could you post the output of the device which is logged at line 34 in the driver.js here:

Turns out the issue was in my Wemos board with the AC, not my connection from ESPhome to the wemos board.

I was able to connect and control my Haier Airco from homey now.

If anyone wants to do this, below is a summary of the steps.

  • Buy a Wemos D1 Mini (ESP PCB for a few euros)
  • Provide this with ESPhome firmware with settings for the Haier (for details see:
    GitHub - paveldn/haier-esphome at experimental)
  • Make a connection for 5V, Gnd, Rx and Tx. (Details also in previous link)
  • Remove any original WiFi module from the Haier Air Conditioner and install the Wemos module
  • Install the ESPhome app on Homey
  • Add the air conditioning to “Hardware devices” via the ESPhome app
  • Add the air conditioning to “Virtual devices” via the ESPhome app
  • Link the desired functions of the Hardware Device to the Virtual device
1 Like