HomeAssistant-GreeClimateComponent
HomeAssistant-GreeClimateComponent copied to clipboard
Readme.md update
Hello! Today I have found your custom component and it works well with my Gree GWH18UC air conditioner, thank you!
I had a lot of trouble with wifi connection and I think it would be helpful if you would add this to readme file:
If you can't provide the encryption key (because you don't have any android device), you can use the component without it in the following way:
- Reset your AC's wifi: Press "Mode" + "Wifi" buttons together for 5 sec
- Connect your PC to AC's wifi, default password is: 12345678
- Use the following command to connect your AC to your Wifi network:
echo -n "{\"psw\": \"<YOUR_WIFI_PASSWORD>\",\"ssid\": \"<YOUR_WIFI_SSID>\",\"t\": \"wlan\"}" | nc -cu 192.168.1.1 7000
- Now you can use the component without defining encryption key in config file
Also I think there is a way to obtain encryption key on iOS device, but this is UNTESTED:
You can download GREE.sqlite
database file from your phone/tablet with iExplorer application (Windows/Mac) and you can see a deviceTable
table in the database if you view the database file with DB Browser for SQLite application. This table has a publicKey
column, maybe if you put this in the configuration file as encryption key, then it will work too. SQL command: `select publicKey from deviceTable;
Also I think there is a way to obtain encryption key on iOS device, but this is UNTESTED:
You can download
GREE.sqlite
database file from your phone/tablet with iExplorer application (Windows/Mac) and you can see adeviceTable
table in the database if you view the database file with DB Browser for SQLite application. This table has apublicKey
column, maybe if you put this in the configuration file as encryption key, then it will work too. SQL command: `select publicKey from deviceTable;
Just test it on iPhone I find puplic_key but the uid is NULL
I followed these steps:
- Download and install iTunes (if you don't have already)
- Plug-in your phone
- Create a local backup with iTunes. Make sure you have enough space on your C: drive
- Download iExplorer. Demo/trial mode is fine, you don't need to pay for it https://macroplant.com/iexplorer
- Open iExplorer and browse your backup (should find it automatically)
- Navigate to: /Browse iTunes Backups/<MY IPHONE>/Backup Explorer/App/com.gree.greeplus/Documents
- Export the GREE.sqlite file
- Download SQLiteBrowser from https://sqlitebrowser.org/. Install it/download zipped version
- Open SQLiteBrowser and open the exported database file
- Browse 'deviceTable' table and copy the publicKey for each of your devices to the encryption_key parameter
In my logs I can see the following for my 4 units:
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Using configured encryption key: 9Qr2Tu5Wx8Za1Cd4
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Using configured encryption key: t4Vw7Yz0Bc3Ef6Hi
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Using configured encryption key: Mn0Pq3St6Vw9Yz2B
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Using configured encryption key: 3Uv6Xy9Ab2De5Gh8
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] name(): Bedroom1AC
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Gree climate device added to hass()
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Starting SyncState
2020-06-22 18:28:26 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.2.20, 7000, 10, {"cid":"app","i":0,"pack":"xdI3Gbg3kV4RGgCBjS5yjZL2FqmSywCBUyWrJhvMKbSlhgKvD16UMftFR9W9dVc/JWeSUy752NlV+dyuFjDXj4pFdVnQ2zA4QmV4jTdqQMZdUzfQt3HHCvyJrvwQ01RHLLPGekW3JC6G8mx7XL4vy+PqDwjFetCcXufxVetIRl3YatXKgabiQ+qfRIXigocefXMGkjnXYcpTeiZhb1qoo0VSH46EGMRTH29ivnWb6ONCo6YLIziRbKA/0JUJIlpgZQYSBdRFkR8pI0SkozK8vpOE5WW8mTVmRP5NcHf4iNo=","t":"pack","tcid":"f4911e79620b","uid":0})
2020-06-22 18:28:36 INFO (MainThread) [custom_components.gree.climate] name(): Bedroom2AC
2020-06-22 18:28:36 INFO (MainThread) [custom_components.gree.climate] Gree climate device added to hass()
2020-06-22 18:28:36 INFO (MainThread) [custom_components.gree.climate] Starting SyncState
2020-06-22 18:28:36 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.2.21, 7000, 10, {"cid":"app","i":0,"pack":"x6Gt4txuekaxftSaS993kqnSXQBruglf027JFOVyzvDeXSbwRpKTb1eSBmeAax6VGp0JZfuuE0fdxjDQ/4qBl36unxhtgHYqftHLo+sQYziwdUwAtYgin6mFDiS1IP4mSLK6fnqgA+h7GPd6KVtq3aDjM7S7aUz9C6dQRoVkcVxaBa9906avIVWc+V21P+0MRr+xsvip5JeYYwOE3fiGrIcXYNyGxkRTr+yIOPdfkGwc2muayKtCMRsPBoWphTo3wfQO31QVmj89fy0oanp10gmSE9J5O4qRxyU8n0D/29Y=","t":"pack","tcid":"f4911e793db0","uid":0})
2020-06-22 18:28:46 INFO (MainThread) [custom_components.gree.climate] name(): WorkingRoomAC
2020-06-22 18:28:46 INFO (MainThread) [custom_components.gree.climate] Gree climate device added to hass()
2020-06-22 18:28:46 INFO (MainThread) [custom_components.gree.climate] Starting SyncState
2020-06-22 18:28:46 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.2.22, 7000, 10, {"cid":"app","i":0,"pack":"v/1p9bsD60kAiYw3zPTzjsM42tYfXiCLvtKiV+SyLb6PhDbtaRkfpsJxvS3ohXI1nyplWC2HdJJSGQjIdZp8RyXgcW2Apd/ceYxhUAxjmJ9tJe6+oVZBM2XpbbfCc6o9Yr1bMC7BA+wsRGktJTSX5dX1RWo3mp6gcEvIUjrSLeiDfCVWuW1qT6ytEJPPVrcHckSHfoQn/Ymp7qGm+J4oLj6PxOM2pfx1oqsX2smUTSswnrSTPj1bxQH9EIqetbMYDivCMUKiU+2P6RYMwJ67AnfHp5j1wtw3Iq7ophJwwo8=","t":"pack","tcid":"f4911e7961d8","uid":0})
2020-06-22 18:28:56 INFO (MainThread) [custom_components.gree.climate] name(): LivingRoomAC
2020-06-22 18:28:56 INFO (MainThread) [custom_components.gree.climate] Gree climate device added to hass()
2020-06-22 18:28:56 INFO (MainThread) [custom_components.gree.climate] Starting SyncState
2020-06-22 18:28:56 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.2.23, 7000, 10, {"cid":"app","i":0,"pack":"Sy+EM9DdTCw+lS2wZyuvIqXjnNo+4UkGhPjJj2DKiYvg137WdPTiRzTWMIu9i+9fxFBhBPFzO5XzbijcZroGIwoRi6VU+aOSquuy48fiK2IWAJQ3rDqWNOP0e/sPIDonoWUvhrIiP/GO+K/swLDC7sBT2D4j8cXc3eak6KfdjHyzbSuDusxia3/O6fMDzJsXONA+VkAkR94wQ3DKYRDHskRfWlecxDwO3UEWIbJhVxrPkIodrLAabLcLbB8ucPQzqHx3P6DF6O6kHey/C4nvpFNFcTbCyNFKhVeuQ8cqo/o=","t":"pack","tcid":"f4911e7f070b","uid":0})
...The problem is that in Home Assistant I cannot see any device/entity... Any idea?
After removing the Encryption key I was able to see the devices and send commands to them but other than doing a beep for each command it was not working.
I reset all 4 units (actually what was working for me is MODE+WIFI on the remote for a few secs until a beep then unplugging the power for a few secs - I can also confirm that this was the only method what was working to reset them).
I used powercat on windows to set the wifi instead of the app: https://github.com/besimorhino/powercat/blob/master/powercat.ps1
- Copy-Paste the script to the PS windows (there is a function in it)
- Run a command to set your wifi settings:
powercat -c 192.168.1.1 -u -p 7000 -i "{`"psw`": `"WIFI_PASSWORD`",`"ssid`": `"WIFI_SSID`",`"t`": `"wlan`"}"
I can confirm that after this it is working. It might worth to include this more Windows friendly option in the readme.
Also it is not clear how it works. Is it sending requests directly to the WiFi modules or it is acting as a fake server? I was able to obtain the encryption key but when I call service from hassio or when I publish mqtt message nothing happens. It would be great to explain architecture in simple words and to add some troubleshooting instructions.
HI @Dilergore , what type of AC's dou you have? i have the same issue over here
HI @Dilergore , what type of AC's dou you have? i have the same issue over here
I have 4 indoor units connected to 1 outdoor unit. The indoor units are 1 Gree GWH09QB-K6DNB4I/I and 3 Gree GWH(07)QB-K6DND6A/I.
I can confirm that since my last comment here I've been using the units and no issues with them and their connection to the Wifi.