Custom Gree climate component written in Python3 for Home Assistant. Controls ACs supporting the Gree protocol.
For a comprehensive list of tested devices, see Supported Devices.
Tested on Home Assistant 2025.6.3
If you are experiencing issues please be sure to provide details about your device, Home Assistant version and what exactly went wrong.
This integration connects directly to your HVAC devices via their IP address on the local network, unlike the official mobile app, which establish a direct connection only during initial setup and subsequently operate through Gree’s servers. The integration attempts to obtain the encryption key by the initial setup protocol, which has been reverse-engineered.
Official mobile applications: - Gree+ Android App - Gree+ iOS App - EWPE Smart Android App - EWPE Smart iOS App
If your HVAC device was previously set up for remote access using a mobile app, the integration may fail to retrieve the encryption key automatically.
To extract encryption keys from an account on Gree’s cloud server: https://github.com/luc10/gree-api-client
To configure HVAC wifi (without the mobile app): https://github.com/arthurkrupa/gree-hvac-mqtt-bridge#configuring-hvac-wifi
This component is added to HACS default repository list.
The integration can be added from the Home Assistant UI.
1. Navigate to Settings > Devices & Services and click Add Integration.
2. Search for Gree Climate and fill in the desired name, host, port and MAC address.
3. After setup you can open the integration options to configure additional parameters.
4. Saving any changes in the options dialog automatically reloads the
integration, so new settings take effect immediately without
restarting Home Assistant.
Standard discovery relies on UDP broadcast, which routers do not forward between VLANs. If your AC is in a different subnet than Home Assistant, pick Discover devices on other VLANs/subnets on the first setup screen and enter one or both of the following:
192.168.30.0/24 or 10.10.20.0/24, 10.10.30.0/24.192.168.30.50, 192.168.30.51.Each address is probed directly with a UDP unicast packet on port 7000, so inter-VLAN routing and any firewall between Home Assistant and the target subnet must allow UDP/7000.
Limits and notes:
- A single network (and the combined total across networks + hosts) may contain at most 65,536 addresses — i.e. a /16 like 192.168.0.0/16. Anything larger (e.g. 10.0.0.0/8, 172.16.0.0/12) must be split into multiple CIDRs or covered by the hosts field. Scanning a whole /16 fires tens of thousands of UDP packets and can stress consumer routers — prefer the narrowest CIDR you can identify.
- Values entered during one setup are remembered for the duration of the Home Assistant session, so adding several devices in a row does not require retyping.
- Broadcast discovery on the local VLAN still runs alongside the unicast scan, so units on the same subnet as Home Assistant are also found.
(Skip if using HACS) Copy the custom_components folder to your own hassio /config folder.
YAML Configuration: See manual-configuration.yaml for a complete configuration example with all available options and detailed comments.
Basic example:
yaml
gree:
- name: "First AC"
host: "192.168.1.101"
mac: "20-FA-BB-12-34-56"
encryption_version: 2
yaml
climate: !include your_configuration.yaml
yaml
logger:
default: error
logs:
custom_components.gree: debug
custom_components.gree.climate: debug
One way is to pull the sqlite db from android device like described here:
https://stackoverflow.com/questions/9997976/android-pulling-sqlite-database-android-device
bash
adb backup -f ~/backup.ab -noapk com.gree.ewpesmart
dd if=data.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf -
sqlite3 data.ab 'select privateKey from db_device_20170503;' # but table name can differ a little bit.
Write it down in climate.yaml: encryption_key: <key>.
If you are getting an UTF-8 error (like: "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xda in position 1: invalid continuation byte"), see https://github.com/RobHofmann/HomeAssistant-GreeClimateComponent/issues/318.
(Optional) Provide the uid parameter (can be sniffed). This is not needed for all devices.
(Optional) You can set custom icons by modifying the icon translation file icons.json. Refer to this documentation: https://developers.home-assistant.io/docs/core/integration-quality-scale/rules/icon-translations/
The integration supports additional sensors if your Gree device has them:
If your AC unit has an outside temperature sensor, it will be automatically detected and exposed as:
- Climate entity attribute: outside_temperature (accessible via {{ state_attr('climate.your_ac', 'outside_temperature') }})
- Separate sensor entity: sensor.your_ac_outside_temperature
If your AC unit has a built-in room humidity sensor, it will be automatically detected and exposed as:
- Climate entity attribute: room_humidity (accessible via {{ state_attr('climate.your_ac', 'room_humidity') }})
- Separate sensor entity: sensor.your_ac_room_humidity
The integration exposes various entities to configure additional features of your Gree AC unit. All entities are created by default when the integration is set up, but their availability depends on the current HVAC mode and status. Entity availability may also vary depending on your specific Gree AC model and firmware version. These controls allow you to toggle special modes and adjust settings:
This project is based on the work of several contributors and projects:
Due to the many issues being created revolving "TimeOut"/"Cannot connect" errors, I will be closing these. Feel free to make a PR fixing your TimeOut/Cannot connect error. More information on the "why" can be found here: https://github.com/RobHofmann/HomeAssistant-GreeClimateComponent/issues/405#issuecomment-4300110823
$ claude mcp add HomeAssistant-GreeClimateComponent \
-- python -m otcore.mcp_server <graph>