Closed DaniilMir closed 1 week ago
hey. it seems this is a much simpler method to get the required parameters without debugging via adb. Can it be added to README?
python gree_test.py -b 192.168.1.255 -command search
Thank You!
Hey, it looks like this solution doesn't work anymore, or I'm having some other issue. I have tried many possible solutions, but unfortunately without any luck,
When I use above python script it looks like this:
python gree.py -b 192.168.1.255 -command search
Searching for devices using broadcast address: 192.168.1.255
Search finished, found 3 device(s)
Binding device: 192.168.1.32 (, ID: 9424b8b18c47)
Traceback (most recent call last):
File "C:\xxxxxx\gree.py", line 191, in <module>
search_devices()
File "C:\xxxxxx\gree.py", line 105, in search_devices
bind_device(r)
File "C:\xxxxxx\gree.py", line 115, in bind_device
result = send_data(search_result.ip, 7000, bytes(request, encoding='utf-8'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\xxxxxx\gree.py", line 31, in send_data
return s.recv(1024)
^^^^^^^^^^^^
TimeoutError: timed out
It's strange cause as you can see devices have been detected but without their names and then there is some problem with the script.
I'm using Sinclair AC. Gree+/EWPE apps works fine.
In HA logs we can see some weird issues:
2024-05-24 16:31:13.661 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform
2024-05-24 16:31:13.661 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass
2024-05-24 16:31:13.661 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device
2024-05-24 16:31:13.661 INFO (MainThread) [custom_components.gree.climate] Retrieving HVAC encryption key
2024-05-24 16:31:13.664 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.1.31, 7000, 10, {"cid": "app","i": 1,"pack": "jvuNXfvi2CkYc/Ti5BoaoQ1f3homwy/9eNHe9XgYZvyj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"9424b8b4417c","uid": 0})
2024-05-24 16:31:23.675 ERROR (MainThread) [homeassistant.components.climate] Setup of platform gree is taking longer than 60 seconds. Startup will proceed without waiting any longer.
2024-05-24 16:31:45.396 ERROR (MainThread) [custom_components.hacs] Timeout of 20 reached while waiting for https://api.github.com/rate_limit
Traceback (most recent call last):
File "/config/custom_components/hacs/base.py", line 471, in async_can_update
response = await self.async_github_api_method(self.githubapi.rate_limit)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hacs/base.py", line 529, in async_github_api_method
raise HacsException(_exception)
custom_components.hacs.exceptions.HacsException: Timeout of 20 reached while waiting for https://api.github.com/rate_limit
Does anyone have a similar problem?
Are you sure your connection is alright? You are getting a timeout to both the HVAC as to GitHub.
There is another version of encryption https://github.com/RobHofmann/HomeAssistant-GreeClimateComponent/pull/165
Thank you guys, I can confirm that this solution is working for me.
solved, can be closed
I have 2 Inventor ACs with CS532AE modules. Both modules were synced with the Gree+ app. In fact it is the same app as Ewpe app.
Tried to obtain keys using the adb backup, but faced issues with an empty backup. Then tried to access SQLite db on a rooted device and couldn't connect to it.
After that i tried a logcat method from Post
It worked just fine with latest app version available at this moment (1.8.3.10).
But after getting the key, component was still failing with this error:
I was really disappointed and started trying everything until I get any response from module. As an alternative way I decided to test it outside of home assistant. For that I used the python script from referenced repository
https://github.com/tomikaa87/gree-remote It requires https://pypi.org/project/cryptography/ to be installed (it was a bit tricky for me) after that I just navigated to the folder contained this script and executed it with the following parameters :
python gree_test.py -b 192.168.1.255 -command search -k %key_from_logcat %
and got the following result:
As you can see - it provided 2 different keys for 2 ACs First AC I connected to app had the same key in script output as the key I got from the logcat Second AC had a different key. My Issue was that I started configuring using the second AC and it's key in fact was different.
More interesting below ))) If I run this script even without providing the key, it still gives me the same output as above.
python gree_test.py -b 192.168.1.255 -command search
I don't know, maybe it is related to my modules or to firmware version, but it looks like it is possible to get keys without hacking Android app. Needs to be tested on other devices.Small Update. I was able to reproduce this error again just by changing one character in a key. It looks like it is related to wrong key value and has nothing common with mac address formatting.
For one AC I have mac address in the following format : 'FF:FF:FF:FF:FF:FF' (uppercase in single quotes ) for the second it have ff:ff:ff:ff:ff:ff (lowercase no quotes) both are working without issues.