Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local ekon server for device #19

Closed
hllhll opened this issue Oct 17, 2020 · 6 comments
Closed

Local ekon server for device #19

hllhll opened this issue Oct 17, 2020 · 6 comments

Comments

@hllhll
Copy link
Owner

hllhll commented Oct 17, 2020

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 hllhll changed the title Local local ekon server for device Local ekon server for device Oct 17, 2020
@hllhll
Copy link
Owner Author

hllhll commented Oct 19, 2020

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>

  • on: Same as the code EKON_VALUE_ON=0x55; EKON_VALUE_OFF=0xAA
  • hvac: Same as EKON_VALUE_MODE_X
EKON_VALUE_MODE_COOL = 17 = 0x11
EKON_VALUE_MODE_HEAT = 34 = 0x22
EKON_VALUE_MODE_AUTO = 51 = 0x33
EKON_VALUE_MODE_FAN = 68 = 0x44
EKON_VALUE_MODE_DRY = 85 = 0x55
  • fan: 01 02 03 fan speed
  • tt: target_temp*10
  • ct: current_temp*10
  • cs - Checksum(?)

@hllhll
Copy link
Owner Author

hllhll commented Oct 21, 2020

Official UDP Servers addresses and ports:

  • Airconet+ : 3.137.73.173, 6343
  • Tadiran connect 2.9: 185.28.152.215, 6343

Deprecated:

  • Airconet port: 9533
  • Tadiran connect 1.4.1: 52.26.235.240, 6343

@hllhll
Copy link
Owner Author

hllhll commented Oct 24, 2020

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
Copy link
Owner Author

hllhll commented Oct 29, 2020

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

@hllhll
Copy link
Owner Author

hllhll commented Oct 31, 2020

@hllhll hllhll closed this as completed Oct 31, 2020
@hllhll
Copy link
Owner Author

hllhll commented Dec 28, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant