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

Implement Ekon WebSocket support #7

Closed hllhll closed 4 years ago

hllhll commented 4 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Instead of making a callback each minute, utilize Ekon's "/ws" websocket for getting notifications from the backend

hllhll commented 4 years ago

HowTo: `GET /ws HTTP/1.1 Host: www.airconet.xyz:443 Connection: Upgrade Upgrade: websocket Sec-WebSocket-Version: 13 Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Cookie: JSESSIONID=**;Path=/;Secure;HttpOnly Accept: /

HTTP/1.1 101 Switching Protocols Server: Tengine/2.2.3 Date: Sat, 04 Jul 2020 05:42:31 GMT Connection: upgrade Sec-WebSocket-Accept: ** Upgrade: WebSocket X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 X-Frame-Options: SAMEORIGIN

{"id":1234,"mac":"123456789012","onoff":85,"light":0,"mode":17,"fan":1,"envTemp":23,"envTempShow":23,"tgtTemp":21}`

I Found dGhlIHNhbXBsZSBub25jZQ== online, in the app there's other value Every 30s client should send heartbeat "Are you there?" in order to not get disconnected

hllhll commented 4 years ago

Call to arms, I don't have much time, if someone could implement it and also fix the async thing #6 I'd (And I guess all of the users) be grateful

hllhll commented 4 years ago

Resolved in commit 478b3d95a06283a4c52c0a1bf0b0a9af9a7cdb8c

..Or ... when U want something done, do it yourself :P