HomeAssistant-GreeClimateComponent icon indicating copy to clipboard operation
HomeAssistant-GreeClimateComponent copied to clipboard

WiFi registration helper & fake heartbeat server

Open rowra44 opened this issue 3 years ago • 16 comments

Is your feature request related to a problem? Please describe. For me, a 2022 series Syen AC owner, it is a problem. Without a heartbeat server the HVAC unit will eventually 'reset' itself and lose the app / HA.

Describe the solution you'd like Based on existing solutions, repositories and some WireSharking I've hacked together my own solution that does not require letting the HVAC unit connect to the actual WAN internet at all, ever.

Additional context Do you think it'd be feasible to try and merge a fake heartbeat server into this integration? I don't believe it should be too difficult and it could be useful not having to run it separately. Please take a look at it ( https://github.com/markv9401/Fake-Gree-server ) and if you think it could be useful, I'd happily try to merge it into the server in a PR. Thanks!

rowra44 avatar Sep 21 '22 05:09 rowra44

While that would be in fact useful, your solution doesn't work for my 3 Cooper & Hunter units (basically another Gree brand). Emtek's does.

I don't know what the code actually does, but I noticed that you're exposing port 1812, when most known Gree variants connect to port 5000. Changing the port in your implementation doesn't do anything in my case though.

This might need more investigation.

As to WiFi registration, I wouldn't bother. You can spin up the fake heartbeat server, block all outgoing WAN traffic from the unit, reset it and try to register with the app again. The app will tell you that it failed (because it can't talk to China at this point, obviously), but the AC unit will keep the WiFi credentials that you entered.

maciejtarmas avatar Oct 20 '22 16:10 maciejtarmas

Sure thing, I don't mind, just thought it could be useful. Port 1812 explanation: During the initial registration process (when you reset WiFi and first log in to Gree servers) it uses an apparently burnt-in domain and port, 1812. The response to this requests contains the servers used in further requests, including the port. That usually (exclusively?) ends up being port 5000. But it works just fine, the HVAC unit will work with whatever port it receives in the response. So by trying to include registration and changing the port to 1812, you essentially need a single port not 2 of them.

rowra44 avatar Oct 21 '22 05:10 rowra44

just to let you know how I solved, my Gree AC it is already initialized and connected to my wifi using android Gree app and I did not wanted to repeat the steps as I don't have the app installed on phone.

  • sniffed dns request used from Gree AC => eu.dis.gree.com
  • in dns server I override sniffed domain with local IP LAN computer that run python script.
  • made python script to run forever when computer boot - I do not use docker.
  • restarted HA and Gree AC.

Now HA integration it work without reinitialize Gree AC wifi using fake server

rapi3 avatar Mar 10 '24 15:03 rapi3

I've tried this but it does not work with, Vaillant WiFi Adapter VAI8/5-i. Note that this device is supported since encryption v2 is supported.

I've set up https://github.com/markv9401/Fake-Gree-server Also tried https://github.com/emtek-at/GreeAC-DummyServer

A few minutes after traffic is blocked from the AC to outside the connection between the AC and HA is lost. It'd be nice to find a way to block all home calling.

Obscurax avatar Jul 01 '24 09:07 Obscurax

e that this device is supported since encryption v2 is suppo

I have about the same (bulex vivair, but basically the same) no need for fake gree server. just add the v2 encryption method in the config.yaml

jodewee avatar Jul 01 '24 10:07 jodewee

e that this device is supported since encryption v2 is suppo

I have about the same (bulex vivair, but basically the same) no need for fake gree server. just add the v2 encryption method in the config.yaml

Sorry but this is not about the component not working. Which it does. It's about blocking home calling from the AC to the Gree servers.

Obscurax avatar Jul 01 '24 11:07 Obscurax