Add ability to manually add device to Gree Climate integration

When adding the Gree Climante integration to Home Assistant, the integration automatically scans the local subnet where the Home Assistant server is installed for compatible devices. If no devices are found in the local subnet, the installation of the integration fails.

There needs to be a way to manually add a device in case the device to be added is in a different subnet than the subnet the Home Assistant server is installed.

I have the exact same question. Did you manage to solve this??

I ended up setting up the Home Assistant Community Store (HACS) in HomeAssistant, which has a much better Gree integration.

Already have HACS. You mean the custom Gree from there?

That is correct!

Hi, did you guys manage to use the Away mode “8°C heating mode” through HACS integration? I cannot figure it out…thx

My 8° mode worked with the Gree HACS integration without needing to configure anything special for it.

Are you sure your unit supports that mode? Also maybe you need to be in heating mode first.

I am sure my AC support it, but I have no option in HA to set it…only in GREE app and then in HA will be shown lower temp then 16…


Oh I know what’s going on. The extra features like 8 degree heat, power saving mode, air scavenging, etc are not in the main AC card, they’re just extra entities that have to be added manually to the card. For example, here’s what the card I created for the dashboard looks like:


The first line is the regular card, everything else is an extra attribute. Here’s the code of that card for the dashboard:

type: entities
entities:
  - entity: climate.office_ac
  - entity: input_boolean.office_ac_lights
    name: 'Lights '
  - entity: input_boolean.office_ac_health
    name: Health
  - entity: input_boolean.office_ac_powersave
    name: Power Saving
  - entity: input_boolean.office_ac_sleep
    name: Sleep
  - entity: input_boolean.office_ac_xfan
    name: xfan
  - entity: input_boolean.office_ac_8degreeheat
    name: 8° heat
  - entity: input_boolean.office_ac_airscavenging
    name: Air Scavenging
state_color: true
header:
  type: picture
  image: https://brands.home-assistant.io/_/gree/logo.png
  tap_action:
    action: none
  hold_action:
    action: none

In this code, my Gree unit is called office_ac. You might have to scour your entities to figure out the specific naming for your unit’s options.

1 Like

Ha! I see … The problem is that I have none of these in my entities even so that I set them up in config…

Screenshot 2023-12-12 at 17.38.03

But in log is all obtaining:

So not sure where am I doing mistake…Could you share your config please?

Here’s what I have in my climate.yaml file:

- platform: gree
  name: Office AC
  host: *EDITED*
  port: 7000
  mac: *EDITED*
  encryption_key: *EDITED*
  target_temp_step: 1
  lights: input_boolean.Office_AC_lights
  xfan: input_boolean.Office_AC_xfan
  health: input_boolean.Office_AC_health
  sleep: input_boolean.Office_AC_sleep
  powersave: input_boolean.Office_AC_powersave
  eightdegheat: input_boolean.Office_AC_8degreeheat
  air: input_boolean.Office_AC_airscavenging
#  uid: 
#  temp_sensor: 

I think you might have to manually create those entities for the Gree addon to be able to populate them. In configuration.yaml, I have the following section just after the “default_config:” line:

input_boolean:
  office_ac_lights:
    name: "Lights Office AC"
  office_ac_xfan:
    name: "xfan Office AC"
  office_ac_health:
    name: "Health Office AC"
  office_ac_sleep:
    name: "Sleep Office AC"
  office_ac_powersave:
    name: "Power Save Office AC"
  office_ac_8degreeheat:
    name: "8 degree heat Office AC"
  office_ac_airscavenging:
    name: "Air scavenging Office AC"
1 Like

Maaaan, you are a lifesaver!

I never realize that it needs to create the entities to populate them…

Really thank you for time and everything around.

PS: just one question - do you deny access from internet to the AC and control it only through HA locally? When I do this I have often long time response (like 20sec) from sending command, and not sure if it is by some mishmash in network :sweat_smile: or it is normal?

THX

1 Like

Glad I could help!

…and no, I do not block internet access via the Gree app. That’s something I may try eventually but I’m fairly new to HA and prefer to have a backup method to control my devices, just in case.

Hi. I fight for Gree integration. Could you help me? My problem the Encryption key. I dont have. Plus 7002 port working in homebridge. Now i learn the homeasistant. Just the air condition left.

I used the method described at GitHub - RobHofmann/HomeAssistant-GreeClimateComponent: Custom Gree climate component written in Python3 for Home Assistant. Controls AC's supporting the Gree protocol. to find my encryption key. The encryption key is only required if you want the Gree+ mobile app to still work after configuring HomeAssistant, otherwise HomeAssistant will create its own encryption key and overwrite the one created by the Gree+ mobile app on the AC units.

Hi, I’m also having issues getting the encryption key. I need it because the general decryption with the reverse engineered api does not work for me. I already tried the steps from RobHofmann but the gree.db on my android phone seems to be encrypted/unreadable? I tried several SQLite readers and none can read the db. I also tried a SSL capture but that was also encrypted…
Any idea how i can find the encryption key.
Thanks in advance.

Can someone help i am new to home assitant and i dont know what i did wrong but the in the logs i get 2024-05-23 22:13:59.873 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration gree which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-23 22:13:59.875 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-23 22:14:02.598 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform 2024-05-23 22:14:02.598 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass 2024-05-23 22:14:02.598 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device 2024-05-23 22:14:02.599 INFO (MainThread) [custom_components.gree.climate] Retrieving HVAC encryption key 2024-05-23 22:14:02.604 INFO (MainThread) [custom_components.gree.climate] Fetching(my ip adress, 7000, 10, {"cid": "app","i": 1,"pack": "TmPMhrY5TLZwFIytbYJP2qmRExEzmD/L/OujBHrntfSj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc63fdfb7","uid": 0}) 2024-05-23 22:14:12.618 ERROR (MainThread) [homeassistant.components.climate] Setup of platform gree is taking longer than 60 seconds. Startup will proceed without waiting any longer. these are the config files i used
- platform: gree name: Office AC host: my ip adress port: 7000 mac: 50:2C:C6:3F:DF:B7 target_temp_step: 1 lights: input_boolean.office_ac_lights xfan: input_boolean.office_ac_xfan health: input_boolean.office_ac_health sleep: input_boolean.office_ac_sleep powersave: input_boolean.office_ac_powersave eightdegheat: input_boolean.office_ac_8degreeheat air: input_boolean.office_ac_airscavenging uid: 1 # Replace with the device identifier if needed temp_sensor: sensor.office_temperature # Replace with your external temperature sensor entity id and `default_config:

input_boolean:
office_ac_lights:
name: “Lights Office AC”
office_ac_xfan:
name: “xfan Office AC”
office_ac_health:
name: “Health Office AC”
office_ac_sleep:
name: “Sleep Office AC”
office_ac_powersave:
name: “Power Save Office AC”
office_ac_8degreeheat:
name: “8 degree heat Office AC”
office_ac_airscavenging:
name: “Air scavenging Office AC”

Load frontend themes from the themes folder

frontend:
themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
climate: !include climate.yaml` i hope someone can help me i am not so good with all this so sorry in advance

Hi @jappenator ,

Unfortunately the logs aren’t specific about what is going wrong so it’s difficult to really identify a cause. It seems to be timing out when trying to grab the encryption key from your AC, so I would make sure to double check the IP and MAC addresses of your AC (the one from your internal network, not your public ISP IP address).

Other than that everything seems to be configured properly. There may be a way to get more verbose logs, which may help identify exactly what isn’t working properly.

Any updates on this feature to search for devices in different vlans or specify the ip of the device?

I have the same issue with my unit. I need to be able to get to my unit on another vlan.