Package: pyekonlib
pyekonlibThis is a package that implements Ekon/Connect/Airconet+ communication protocol with the wireless HVAC Controller.How device communication worksAP association to the Wifi networkThe device, being esp8285-like-based, utilize ESPTouch/ESPSmart config method in order to find
and convey the wifi network credentials to the device.
This can be achived using the original app, or through any alternative app such asESPTouchConfiguring the deviceAfter the device has joind the wireless network it is required to tell it to what server to connect to,
this is done by an HTTP POST to the devicePOST /config?command=client HTTP/1.1
User-Agent: LuaSocket 2.0.2
Content-Length: <content-length>
Content-Type: application/json; charset=utf-8
Host: 1.1.1.1

{"client_set":[{"ip":"<server_addr>","port":<server_udp_port>,"protocol":"UDP","local_port":80},{"protocol":"","ip":""},{"protocol":"","ip":""},{"protocol":"","ip":""}]}Yup, the communication is connection-less UDP.
With theclientwe can instruct the device to communicate with are own crafted server,
implemented by this library, reside on arbitrary ip address.The entire request, should be sent in a single send() call, thus any python http library for curl request would probably won't sufficeThis can be performed by the libraryfrom pyekonlib.Migration import SetDeviceUDPServer

SetDeviceUDPServer("deviceAddr", "serverAddr", serverPort)whereserverAddris the address of the machine running this lib's server
and serverPort is the UDP port it's listening onProtocolNot all fields were identified, but enough was identified in order to
give basic meaning and parse incoming frames from the device, and forge
frames that would be understood by the device. Please tell if u have an
idea about the contents of the fields that are not fully understood :PKnown issuesIn Forward mode, using the Ekon/TC app, You may change settings of the HVAC, and it will ignore youThis is due to the script pulling the device, and updating ekon's server before ekon server's sends out
the message to the device (or theproxywhich is this lib). IncreasingSEND_HEARTBEAT_INTERVAL = 10in theServerControllermight help with thadWhile development I've stumbled situations where device stops responding, please take note if this happensTry to power-cycle the device, if not, hard-reset (button orPOST ?comand=restore)  and pair with regular app to see that it's workingHavn't encountered in a while, this is probobly no longer an issue.Should't matter to most of you: Device emulation (I.E. Simulating a device) is only slightly implemented - NOT WORKINGCode structureI've stuck to most of the code being async and roughly async-framework agnostic
(I probably did it really bad if U know something in python, please PR)Frames - Abstract raw protocol datagrams away from the callerControllers - Abstracts the interactions of the protocol away from the callerResponsible for both side of communication and
receiving/sending using the specified callbacks.Provides callback to the user when identifying new device and
the receiving of a new (or equally, old) state from the deviceServer - Abstracts mostly anything and gives out callbacks for device connection,
disconnection, and updates from the device, plus sending new state to the device.Note from the developerI'm not a developer, I'm a security researcher, as such the code quality is probably poor
nor do I like python so much but it seemed most reasonable to do this in python.
The main thought when abstracting-away the protocol and communication was to implement integration for
various Smart-home integration solutions, such as HomeAssistant.