hllhll / HomeAssistant-EKON-iAircon

EKON iAircon / Tadiran climate component written in Python3 for Home Assistant. On the bases of Gree Climate component for easier interfacing with HASS
GNU General Public License v3.0
14 stars 7 forks source link

Local ekon server for device #19

Closed hllhll closed 3 years ago

hllhll commented 4 years ago

You should not yet try the commands below, this was only confirm to not-brick the device by me, but there's a really small bricking chance, reset with the button should solve everything in case of issues, also in case of issues I Have managed to reclaim the device using ESPTouch SmartConfig app, but if you are no expert you shouldn't be doing this)

I'll document here some info I've gathered regarding how it might be possible to redirect traffic to local LAN server and implement locally without cloud.

First, app uses ESP Smart config/ESP Touch to add the ESP device into the wifi network. This can also be done without the original app, using ESPTouch SmartConfig app. After the device is in the wifi LAN the app goes on to configure the server it will be using, this is done by POSTing to the device (ip address: Airconet+ server, activate-ac.com)

POST /config?command=client HTTP/1.1
User-Agent: LuaSocket 2.0.2
Content-Length: 157
Content-Type: application/json; charset=utf-8
Host: <your pc workstation address>

{"client_set":[{"ip":"3.137.73.173","port":9533,"protocol":"UDP","local_port":80},{"protocol":"","ip":""},{"protocol":"","ip":""},{"protocol":"","ip":""}]}

If you want to remove the device and disconnect from Wifi (I'm not sure if it restores factory settings):

POST /config?command=restore HTTP/1.1
User-Agent: LuaSocket 2.0.2
Content-Length: 2
Content-Type: application/json; charset=utf-8
Host: <your pc workstation address>

As seen above the device communicates using udp datagrams to the server. I Have tested switching the server to my pc address and I'm able to record messages sent from the device.

hllhll commented 4 years ago

UDP Communication alaysis update: Device->Cloud only (over UDP) unsigned shorts - 2 bytes; MSByteF

  1. Heartbeat packets - starts with 00 01 total len: 0x14 bytes
  2. Data packets - starts with 01 03 total len: 0x15 bytes. These are the same as the data that comes from the Websocket JSON requestBytes

Data packet format: 01 03 ?? 00 <on> 00 ?? 00 <hvac> 00 <fan> 00 00 <ct> <ct> <tt> <tt> ?? ?? <cs> <cs>

hllhll commented 3 years ago

Official UDP Servers addresses and ports:

hllhll commented 3 years ago

Server->Device

  1. Heartbeat - Size 8 01 03 <uint32?> <cs?> <cs?>
  2. Update device frame 01 10 <uint32> <f1> 00 <on> 00 ?? 00 <hvac> 00 <fs> 00 00 <ct> <ct> <tt> <tt> ?? ?? <cs> <cs>
hllhll commented 3 years ago

The development of server interface has moved to a different repo pyekonlib - Python EKON Server emulator library https://github.com/hllhll/pyekonlib

hllhll commented 3 years ago

See https://github.com/hllhll/HomeAssistant-ekon-local and https://github.com/hllhll/pyekonlib

hllhll commented 3 years ago

When HVAC Is turned in off STATE, EKON Conisdered the state As Off, Cool, fanspeed 1, target temp 25.

Server has also "turn on" "turn off" commands / or it is "change mode" Turn to on: 01 06 xx xx 00 55 cs cs Will revert to the last HVAC state (not as reported by EKON, but the actual last one) 01 06 xx xx 00 AA cs cs Will turn the AC off, keeping the last state in the controller. From now ekon will report Off, Cool, fan 1, target temp 25 altough it's not the actual HVAC state