Skip to content

Hold VRF sub-unit UI state until gateway catches up; hide unsupported switches - #508

Merged
RobHofmann merged 1 commit into
RobHofmann:masterfrom
meirlo:feat/vrf-stale-read
Sep 23, 2026
Merged

RobHofmann merged 1 commit into
RobHofmann:masterfrom
meirlo:feat/vrf-stale-read

Conversation

@meirlo

@meirlo meirlo commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On multi-split (VRF) setups the gateway caches each indoor unit's state and answers with a stale snapshot for a few seconds after a command. That surfaces as two annoyances:

  1. Commands appear to "bounce back". After changing e.g. the target temperature, the next poll (up to 60 s away) can read the gateway's old cached value and revert the UI, so the change looks like it didn't take.
  2. Non-functional switches are shown. Many VRF indoor units return an empty string for properties they don't implement (Lig, Health, StHt, …), yet the switches are still exposed and do nothing.

Changes

climate.py — hold commanded state until the device confirms

  • After a successful send, remember the commanded options and re-assert them over the read-back until either the device's own reported value confirms the change, or an 8 s TTL expires.
  • Confirmation is checked against what the device actually reported this cycle (not our optimistic overlay), so a genuinely rejected command isn't forced forever.
  • A one-shot ~2 s delayed refresh lets the UI confirm quickly instead of waiting for the next scan interval. The handle is cancelled on entity removal.

switch.py — hide unsupported switches

  • Add _prop_supported(): a supported property comes back as an integer; empty string / None / missing after a successful sync means the unit doesn't implement it. xfan/lights/health/powersave/eightdegheat/sleep/air are hidden accordingly. State is left untouched until the first sync so nothing flickers on startup.

Scope / safety

Standalone (non-VRF) units are unaffected: they report real integers, so switches stay available and the pending overlay just confirms on the next read.

Related

Part of a small VRF series (see #507 for reliable VRF discovery, and #454 for per-unit device_info). Independent of both — can merge in any order.

Testing

Tested on my own setup:

  • Gateway: Gree GR-Gcloud VRF WiFi module fronting 4 indoor units (MACs in subMAC@gatewayMAC form).
  • Encryption: v1 (ECB).
  • Home Assistant: current stable release.

Verified on the 4 indoor units: changing target temperature / mode no longer bounces back to the gateway's stale cached value on the next poll, and the change is confirmed in the UI within a couple of seconds. Switches the units don't implement (e.g. lights/health) are correctly hidden after the first sync, while the switches they do support remain available and functional.

@RobHofmann

Copy link
Copy Markdown
Owner

I need some testers with VRF devices for this one!

@RobHofmann RobHofmann added help wanted Extra attention is needed to test This issue needs testing labels Sep 20, 2026
@meirlo

meirlo commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Hi @vellad1, @Ilya-Draigor and @ItayGo — you all run VRF setups. @RobHofmann needs a VRF owner to validate this PR. Could any of you give it a quick test and report back? Thanks!

@Ilya-Draigor

Copy link
Copy Markdown

Hi @meirlo,
I'm not currenly using the homeassistand, but installed this patch and it seems to work, played few minutes with my units.
But there is still few old issuies for my setup

1. my VRF have 6 units but addon discovering only 5:

{"t": "scan"} request:
{"t":"dev","bc":"","catalog":"gree","series":"gree","model":"gree","lock":0,"vender":"1","mid":"60","name":"GR-Gcloud_60_0a_5ba3_EC","ver":"V3.2.M","mac":"9424b8fd5ba3","subCnt":6}

"subCnt":6 is number of indoor units.
Can manually add 6th unit.

2. can't assign each unit to his own Area, when changing one of them, all units assigning to that area.

Thanks,
Ilya

@vellad1

vellad1 commented Sep 22, 2026

Copy link
Copy Markdown

Hi @RobHofmann @meirlo

I upgraded to 4.0.6. Are the fixes in it? I'm not sure what exactly I need to test; happy to do so if you give me some directions.

I have 2 VRF units. Both have 3 indoor units each. The Outdoor units are different models.

@vellad1

vellad1 commented Sep 22, 2026

Copy link
Copy Markdown

i'm thinking i should remove all my gree and re-add them from scratch and automations etc. however i forgot the encryption key that i was using, where can i find it in the conf please?

@Ilya-Draigor

Copy link
Copy Markdown

@vellad1 it should be auto discovered

@vellad1

vellad1 commented Sep 22, 2026

Copy link
Copy Markdown

i went ahead and deleted one of the VRFs. yes enc key was discovered. but somehow and vrf added but no sub units added, trying to see what is happening.

@vellad1

vellad1 commented Sep 22, 2026

Copy link
Copy Markdown

some more info, i did not put in an encryption key:

Logger: custom_components.gree.gree_protocol
Source: custom_components/gree/gree_protocol.py:668
Integration: Gree A/C (documentation)
First occurred: 19:33:55 (2 occurrences)
Last logged: 19:34:47

Error fetching sub-device list for 502cc6bb65b6:

--

Logger: custom_components.gree.gree_protocol
Source: custom_components/gree/gree_protocol.py:179
Integration: Gree A/C (documentation)
First occurred: 19:33:55 (3 occurrences)
Last logged: 19:38:11

All 8 attempts failed for 10.XXXXX:7000, but the device DID answer a plain discovery probe. The port is open and the device is speaking, so this is not a network problem -- the encrypted exchange is failing. Check the device key and the encryption version. WiFi module: hid=362001067012+U-W06AV30.bin, ver=V1.1.0.0. Original error: TimeoutError

…rted switches

Two VRF (multi-split) usability issues, both caused by the gateway caching
each indoor unit's state and answering with a stale snapshot for a few
seconds after a command.

1. Commands appeared to "bounce back". After setting e.g. a new target
   temperature, the next poll (up to 60s away) could read the gateway's old
   cached value and revert the UI. climate.py now remembers the options it
   just commanded and re-asserts them over the read-back until the device's
   own reported value confirms the change or an 8s TTL expires. Confirmation
   is checked against the value the device actually reported this cycle, not
   the optimistic overlay, so a genuinely-rejected command is not forced
   forever. A one-shot delayed refresh (~2s) also lets the UI confirm the
   change quickly instead of waiting for the next scan interval. The pending
   refresh handle is cancelled on entity removal.

2. Non-functional switches were shown. Many VRF indoor units return an empty
   string for properties they do not implement (Lig, Health, StHt, ...). A
   real, supported property comes back as an integer. switch.py adds a
   _prop_supported() check so xfan/lights/health/powersave/eightdegheat/
   sleep/air are hidden when the unit reports the property as empty after a
   successful sync. State is left untouched until the first sync so nothing
   flickers on startup.

Standalone (non-VRF) units are unaffected: they report real integers, so the
switches stay available and the pending overlay simply confirms on the next
read.
@meirlo
meirlo force-pushed the feat/vrf-stale-read branch from 7b808b0 to db53f5f Compare September 22, 2026 19:10
@meirlo

meirlo commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks so much for chiming in and taking the time to test @Ilya-Draigor — really appreciate it! 🙏

Quick heads-up: the two issues you hit aren't actually covered by 4.0.6, which is why you still see them:

To test everything together, I've put all three fixes on one branch. Could you try this build?
Zip: https://github.com/meirlo/HomeAssistant-GreeClimateComponent/archive/refs/heads/test/vrf-all.zip
Unzip custom_components/gree into your HA config and restart — you should see version 4.0.6-vrf-test. With that, all 6 units should be discovered and each should be assignable to its own area. Thanks again!

@meirlo

meirlo commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks a lot for jumping in and helping test @vellad1 — much appreciated! 🙏

One important thing: 4.0.6 doesn't include these PRs yet. The error you saw —
Error fetching sub-device list ... device DID answer ... encrypted exchange is failing — comes from the old subList code. #507 rewrites exactly that path to support modules like your W06 (hid=…U-W06AV30.bin), so "gateway added but no sub-units" is the bug #507 fixes.

Could you try this combined build (4.0.6 + all VRF fixes)?
Zip: https://github.com/meirlo/HomeAssistant-GreeClimateComponent/archive/refs/heads/test/vrf-all.zip
Unzip custom_components/gree into your HA config and restart (version should read 4.0.6-vrf-test), then re-add one VRF. You don't need to reset everything or find your old key — it's auto-discovered, as you saw.

If sub-units still don't show up, a debug log would pinpoint it — add to configuration.yaml:

logger:
  logs:
    custom_components.gree.gree_protocol: debug

and share the get_subunits_list / subList lines. That tells us how your module returns the list. And for putting each unit in its own room, you'll want #454 too (included in the build above). Thanks again for the help!

@vellad1

vellad1 commented Sep 23, 2026 •

Copy link
Copy Markdown

@meirlo Installed it.

The A/Cs were not detected on a discover VLAN/subnet section. I tried both network CIDR and I also wrote the IPs directly in the VLAN/subnet section.

I then tried to adding one of the VRFs manually. I entered IP and MAC (the real mac without the @) - it added the device but couldn't turn on the climate entity - stuck to zero.

Logs for subnet discovery:

2026-09-23 05:49:49.560 DEBUG (MainThread) [custom_components.gree.gree_protocol] Found broadcast addresses from HA: ['255.255.255.255'] 2026-09-23 05:49:49.563 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'eno1': ('10.1.2.10', 49282) 2026-09-23 05:49:49.563 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-3f14b2e58493': ('172.18.0.1', 44496) 2026-09-23 05:49:49.563 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'docker0': ('172.17.0.1', 49353) 2026-09-23 05:49:49.563 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-e094742905e1': ('172.20.0.1', 48750) 2026-09-23 05:49:49.563 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-3d4d58e648e2': ('172.30.10.128', 41099) 2026-09-23 05:49:49.563 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-ddd741ab9f20': ('172.21.0.1', 53100) 2026-09-23 05:49:49.564 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-192bade39052': ('172.22.0.1', 46590) 2026-09-23 05:49:49.564 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-46c1012d2902': ('172.23.0.1', 56478) 2026-09-23 05:49:49.564 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-40dfec75c8d6': ('172.19.0.1', 45381) 2026-09-23 05:49:49.564 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 10.1.2.255 via interface 'eno1' from 10.1.2.10 2026-09-23 05:49:49.565 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'eno1' from 10.1.2.10 2026-09-23 05:49:49.565 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 10.255.255.255 via interface 'eno1' from 10.1.2.10 2026-09-23 05:49:49.565 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.18.255.255 via interface 'br-3f14b2e58493' from 172.18.0.1 2026-09-23 05:49:49.566 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-3f14b2e58493' from 172.18.0.1 2026-09-23 05:49:49.566 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-3f14b2e58493' from 172.18.0.1 2026-09-23 05:49:49.566 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.17.255.255 via interface 'docker0' from 172.17.0.1 2026-09-23 05:49:49.566 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'docker0' from 172.17.0.1 2026-09-23 05:49:49.566 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'docker0' from 172.17.0.1 2026-09-23 05:49:49.567 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.20.255.255 via interface 'br-e094742905e1' from 172.20.0.1 2026-09-23 05:49:49.567 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-e094742905e1' from 172.20.0.1 2026-09-23 05:49:49.567 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-e094742905e1' from 172.20.0.1 2026-09-23 05:49:49.567 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.30.255.255 via interface 'br-3d4d58e648e2' from 172.30.10.128 2026-09-23 05:49:49.567 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-3d4d58e648e2' from 172.30.10.128 2026-09-23 05:49:49.567 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-3d4d58e648e2' from 172.30.10.128 2026-09-23 05:49:49.568 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.21.255.255 via interface 'br-ddd741ab9f20' from 172.21.0.1 2026-09-23 05:49:49.568 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-ddd741ab9f20' from 172.21.0.1 2026-09-23 05:49:49.568 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-ddd741ab9f20' from 172.21.0.1 2026-09-23 05:49:49.568 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.22.255.255 via interface 'br-192bade39052' from 172.22.0.1 2026-09-23 05:49:49.568 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-192bade39052' from 172.22.0.1 2026-09-23 05:49:49.568 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-192bade39052' from 172.22.0.1 2026-09-23 05:49:49.568 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.23.255.255 via interface 'br-46c1012d2902' from 172.23.0.1 2026-09-23 05:49:49.569 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-46c1012d2902' from 172.23.0.1 2026-09-23 05:49:49.569 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-46c1012d2902' from 172.23.0.1 2026-09-23 05:49:49.569 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.19.255.255 via interface 'br-40dfec75c8d6' from 172.19.0.1 2026-09-23 05:49:49.569 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-40dfec75c8d6' from 172.19.0.1 2026-09-23 05:49:49.569 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-40dfec75c8d6' from 172.19.0.1 2026-09-23 05:49:49.570 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending unicast scan to 254 hosts from ('0.0.0.0', 33982) 2026-09-23 05:49:49.572 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sent discovery packets, waiting for replies... 2026-09-23 05:49:49.587 DEBUG (MainThread) [custom_components.gree.gree_protocol] Decrypted discovery response from ('10.1.4.103', 7000) on interface 'unicast' 2026-09-23 05:49:49.587 DEBUG (MainThread) [custom_components.gree.gree_protocol] Discovered gateway 502cc6bb65b6 (subCnt=3), deferring sub-device fetch 2026-09-23 05:49:49.591 DEBUG (MainThread) [custom_components.gree.gree_protocol] Decrypted discovery response from ('10.1.4.105', 7000) on interface 'unicast' 2026-09-23 05:49:49.592 DEBUG (MainThread) [custom_components.gree.gree_protocol] Discovered gateway 502cc6bb6594 (subCnt=3), deferring sub-device fetch 2026-09-23 05:49:54.573 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching sub-devices for 2 gateway(s) 2026-09-23 05:49:56.578 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 1/8 failed for 10.1.4.103:7000: TimeoutError: 2026-09-23 05:49:56.578 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 1/8 failed for 10.1.4.105:7000: TimeoutError: 2026-09-23 05:49:59.080 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 2/8 failed for 10.1.4.103:7000: TimeoutError: 2026-09-23 05:49:59.081 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 2/8 failed for 10.1.4.105:7000: TimeoutError: 2026-09-23 05:50:01.885 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 3/8 failed for 10.1.4.103:7000: TimeoutError: 2026-09-23 05:50:01.885 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 3/8 failed for 10.1.4.105:7000: TimeoutError: 2026-09-23 05:50:04.986 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 4/8 failed for 10.1.4.103:7000: TimeoutError: 2026-09-23 05:50:04.987 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 4/8 failed for 10.1.4.105:7000: TimeoutError: 2026-09-23 05:50:08.390 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 5/8 failed for 10.1.4.103:7000: TimeoutError: 2026-09-23 05:50:08.390 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 5/8 failed for 10.1.4.105:7000: TimeoutError: 2026-09-23 05:50:12.094 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 6/8 failed for 10.1.4.103:7000: TimeoutError: 2026-09-23 05:50:12.095 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 6/8 failed for 10.1.4.105:7000: TimeoutError: 2026-09-23 05:50:16.099 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 7/8 failed for 10.1.4.103:7000: TimeoutError: 2026-09-23 05:50:16.100 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 7/8 failed for 10.1.4.105:7000: TimeoutError: 2026-09-23 05:50:20.403 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 8/8 failed for 10.1.4.103:7000: TimeoutError: 2026-09-23 05:50:20.403 ERROR (MainThread) [custom_components.gree.gree_protocol] Error fetching sub-device list for 502cc6bb65b6: 2026-09-23 05:50:20.404 DEBUG (MainThread) [custom_components.gree.gree_protocol] subList attempt 8/8 failed for 10.1.4.105:7000: TimeoutError: 2026-09-23 05:50:20.404 ERROR (MainThread) [custom_components.gree.gree_protocol] Error fetching sub-device list for 502cc6bb6594: 2026-09-23 05:50:20.406 DEBUG (MainThread) [custom_components.gree.gree_protocol] Discovery completed, found 0 devices

Below logs when i added VRF1 (4.103) manually. I entered name, ip, mac (real - no @). Left else empty and enc was 1.

2026-09-23 05:55:04.791 DEBUG (MainThread) [custom_components.gree.gree_protocol] test_connection: host=10.1.4.103, port=7000, mac=502cc6bb65b6, encryption_version=1, encryption_key= 2026-09-23 05:55:04.791 DEBUG (MainThread) [custom_components.gree.gree_protocol] Retrieving HVAC encryption key 2026-09-23 05:55:04.792 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid": "app","i": 1,"pack": "dIVu3efPO1ZaxdcHTqpzzbIb7C+RvOsAGSxMG4lL4QCj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc6bb65b6","uid": 0}) 2026-09-23 05:55:04.801 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1 2026-09-23 05:55:04.801 DEBUG (MainThread) [custom_components.gree.gree_protocol] GetDeviceKey: FetchResult: {'t': 'bindOk', 'mac': '502cc6bb65b6', 'key': 'Xy1Ab4De7Gh0Jk3M', 'r': 200} 2026-09-23 05:55:04.801 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetched device encryption key: b'Xy1Ab4De7Gh0Jk3M' 2026-09-23 05:55:04.801 DEBUG (MainThread) [custom_components.gree.gree_protocol] test_connection: Got device key: b'Xy1Ab4De7Gh0Jk3M' 2026-09-23 05:55:04.801 INFO (MainThread) [homeassistant.setup] Setting up gree 2026-09-23 05:55:04.805 INFO (MainThread) [custom_components.gree.climate] VRF1: Initializing Gree climate device 2026-09-23 05:55:04.805 INFO (MainThread) [custom_components.gree.climate] VRF1: Unit of measurement: °C 2026-09-23 05:55:04.814 INFO (MainThread) [homeassistant.components.climate] Setting up gree.climate 2026-09-23 05:55:04.814 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new climate.gree entity: climate.living_room_vrf_ground_vrf_groung 2026-09-23 05:55:04.815 INFO (MainThread) [custom_components.gree.climate] Gree climate device added to hass() 2026-09-23 05:55:04.815 DEBUG (MainThread) [custom_components.gree.gree_protocol] Retrieving HVAC encryption key 2026-09-23 05:55:04.815 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid": "app","i": 1,"pack": "dIVu3efPO1ZaxdcHTqpzzbIb7C+RvOsAGSxMG4lL4QCj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc6bb65b6","uid": 0}) 2026-09-23 05:55:04.815 INFO (MainThread) [homeassistant.components.switch] Setting up gree.switch 2026-09-23 05:55:04.815 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_x_fan 2026-09-23 05:55:04.816 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_lights 2026-09-23 05:55:04.817 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_health 2026-09-23 05:55:04.817 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_power_save 2026-09-23 05:55:04.818 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_8degc_heat 2026-09-23 05:55:04.819 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_sleep 2026-09-23 05:55:04.819 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_air 2026-09-23 05:55:04.819 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_anti_direct_blow 2026-09-23 05:55:04.820 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_light_sensor 2026-09-23 05:55:04.822 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_auto_x_fan 2026-09-23 05:55:04.822 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_auto_light 2026-09-23 05:55:04.823 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new switch.gree entity: switch.living_room_1_beeper 2026-09-23 05:55:04.823 INFO (MainThread) [homeassistant.components.number] Setting up gree.number 2026-09-23 05:55:04.824 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new number.gree entity: number.living_room_1_temperature_step 2026-09-23 05:55:04.824 INFO (MainThread) [homeassistant.components.select] Setting up gree.select 2026-09-23 05:55:04.825 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new select.gree entity: select.living_room_1_external_temperature_sensor 2026-09-23 05:55:04.826 INFO (MainThread) [homeassistant.components.sensor] Setting up gree.sensor 2026-09-23 05:55:04.826 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.gree entity: sensor.living_room_1_outside_temperature 2026-09-23 05:55:04.827 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.gree entity: sensor.living_room_1_room_humidity 2026-09-23 05:55:04.827 INFO (MainThread) [custom_components.gree.sensor] Added 2 Gree sensors 2026-09-23 05:55:04.829 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1 2026-09-23 05:55:04.829 DEBUG (MainThread) [custom_components.gree.gree_protocol] GetDeviceKey: FetchResult: {'t': 'bindOk', 'mac': '502cc6bb65b6', 'key': 'Xy1Ab4De7Gh0Jk3M', 'r': 200} 2026-09-23 05:55:04.829 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetched device encryption key: b'Xy1Ab4De7Gh0Jk3M' 2026-09-23 05:55:04.829 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid":"app","i":0,"pack":"/CCL5ozgZVUikU48/YaFNWtB0QGlOxXzEHVwUcy9807PA8XVKpEKi/JqxXD5Z9x3QGio7l41Ehb/m8qv8Jr0PA==","t":"pack","tcid":"502cc6bb65b6","uid":0}) 2026-09-23 05:55:04.843 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1 2026-09-23 05:55:04.844 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid":"app","i":0,"pack":"h8iru9wsPNT2WwCCqLe9wrPMW4QeIjBg9qxhQO8k+KznxP59GeYZhM4m13uKFHSydnIMmbPGkP1/J8/UV+R6Vg==","t":"pack","tcid":"502cc6bb65b6","uid":0}) 2026-09-23 05:55:04.854 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1 2026-09-23 05:55:04.854 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid":"app","i":0,"pack":"/RWte8uLFmjPkqAzTXLnJmtB0QGlOxXzEHVwUcy9807PA8XVKpEKi/JqxXD5Z9x3QGio7l41Ehb/m8qv8Jr0PA==","t":"pack","tcid":"502cc6bb65b6","uid":0}) 2026-09-23 05:55:04.869 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1 2026-09-23 05:55:04.869 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid":"app","i":0,"pack":"V44K4WW4N1cxXn7ip+OhQdMIk81r9nBjGFPWwGy6TYDAap7E5sfOYKORe7H0IIcQfAiXwszu5Czwy9R40yxvMg==","t":"pack","tcid":"502cc6bb65b6","uid":0}) 2026-09-23 05:55:04.885 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1 2026-09-23 05:55:04.885 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid":"app","i":0,"pack":"GXHDT1aBxz1AG99bC0aFPuXrNvq3EZZtKcZUtbjlqJgi7FgxkLZY41apaFBPxOWoyGeXv86zfp0REuGl39kXwg==","t":"pack","tcid":"502cc6bb65b6","uid":0}) 2026-09-23 05:55:04.900 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1 2026-09-23 05:55:04.901 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid":"app","i":0,"pack":"F7Mn373XO5ExYpWvmFaFQSUGiidIBIRuYPIMEV1DmMgL+NlkbxCEYkn1uh9z8GTy50JTxSkkDw51egE2KcTDuBKI20yAnyg2Cd4XdJrVCEJZMP+T4sMvSuCYBu3O4AHfqzdkSHww9sfiUzy0F2gPs8JeHShbmVsgccwhPU3Xco3leArVYsSrr6ujay0O4ProRiESL21myTASL06Ig5mfqXKaO/ejXYva5Yuqzkm0IJd0Q8zX+CN6ycvYeH4GOtOIWpPd6Zfpzv7i3ExlJk29C/KE9ux4e7O9nPUL8lR0WwY=","t":"pack","tcid":"502cc6bb65b6","uid":0}) 2026-09-23 05:55:04.923 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1

@meirlo

meirlo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@vellad1 great news — I found the root cause from your logs. Your GR-Gcloud (V3.2.M / W06) only answers a subList query when it's sent as an encrypted pack bound to the gateway's key, exactly like normal status/commands. The plain unencrypted query it just ignores, which is why every attempt timed out.

I've updated #507 to send subList in that encrypted form. I confirmed it on my own module too — it returns all sub-units the same way — so this should fix your "gateway added but no sub-units".

Could you re-pull the combined build and try again? (Same link — just re-download, it's been updated.)
Zip: https://github.com/meirlo/HomeAssistant-GreeClimateComponent/archive/refs/heads/test/vrf-all.zip

After restart, re-run discovery. Your gateways should now expand into their 3 indoor units each. If you enable custom_components.gree.gree_protocol: debug again, the get_subunits_list: found N sub-units line will confirm it.

One heads-up: don't add the gateway MAC manually — that creates a dummy climate entity that stays at zero (the gateway itself isn't an indoor unit). Let discovery add the sub-units for you.

Thanks a lot for the detailed logs — they made this easy to pin down! 🙏

@Ilya-Draigor

Copy link
Copy Markdown

@meirlo thank you for you contribution!
I installed you latest 4.0.6-vrf-test and finaly i can add each unit to it's area with full entities list.
In my case discovery still see 5 units, may be the problem in my gateway device (gree android app see all 6 units)

from log: Discovered gateway 9424b8fd5ba3 (subCnt=6)

[gree_protocol] Sent discovery packets, waiting for replies...
[gree_protocol] Decrypted discovery response from ('192.168.1.20', 7000) on interface 'eno1'
[gree_protocol] Discovered gateway 9424b8fd5ba3 (subCnt=6), deferring sub-device fetch
[gree_protocol] Fetching sub-devices for 1 gateway(s)
[gree_protocol] Detecting encryption version for device 9424b8fd5ba3 at 192.168.1.20:7000
[gree_protocol] Testing encryption version 1 for device 9424b8fd5ba3
[gree_protocol] Retrieving HVAC encryption key
[gree_protocol] Fetching device at: 192.168.1.20:7000, data sent: {"cid": "app","i": 1,"pack": "gvkovhIzmmW04owVls7TQnGDrnPJqkOm4C7T3G9jbq2j9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"9424b8fd5ba3","uid": 0})
[gree_protocol] Fetching device at: 192.168.1.20:7000, data sent: {"cid":"app","i":0,"pack":"0bkyO9YrFm/nVsC8LkZTr1SThu9Dl+vU4Qr01zWTcRNNXBguRPS/ZV6D5Zsp2APGAc5YhvDlWeoUak0B14sQla7VRPmatJJdWW8Th6h5t7YOabR7mtpneMac9gEJdwNWDy1l+8pwZcxujEaxb5xrI4UFxuS1S0W+njfD2V3Mhomy7bqjM9HprZrdJV1URJRDWWxVxcjDlmA7zrjnWXxeglaZ2L9CY9+asp3jhpknfC17FZyGXpZZSAzUP0vjnrdN5eg41iw5KTExgYCCtkFib7M30YC+NnEDfGMzAa1lQZE=","t":"pack","tcid":"9424b8fd5ba3","uid":0})
[gree_protocol] Successfully received response on attempt 1
[gree_protocol] GetDeviceKey: FetchResult: {'t': 'bindOk', 'r': 200, 'mac': '9424b8fd5ba3', 'key': '774f26ca0a76e7d9'}
[gree_protocol] Fetched device encryption key: b'774f26ca0a76e7d9'
[gree_protocol] Device 9424b8fd5ba3 uses encryption version 1
[gree_protocol] Retrieving HVAC encryption key
[gree_protocol] Fetching device at: 192.168.1.20:7000, data sent: {"cid": "app","i": 1,"pack": "gvkovhIzmmW04owVls7TQnGDrnPJqkOm4C7T3G9jbq2j9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"9424b8fd5ba3","uid": 0})
[gree_protocol] Successfully received response on attempt 1
[gree_protocol] Successfully received response on attempt 1
[gree_protocol] GetDeviceKey: FetchResult: {'t': 'bindOk', 'r': 200, 'mac': '9424b8fd5ba3', 'key': '774f26ca0a76e7d9'}
[gree_protocol] Fetched device encryption key: b'774f26ca0a76e7d9'
[gree_protocol] Fetching device at: 192.168.1.20:7000, data sent: {"cid":"app","i":0,"pack":"L256Tmw5VFUOgvC8jnaNmFt5iH4j7Y8TqUyvOfXUY4MTHWoRwAS/wMXcC4RwcjdQ","t":"pack","tcid":"9424b8fd5ba3","uid":0})
[gree_protocol] Successfully received response on attempt 1
[gree_protocol] get_subunits_list: decoded response: {'t': 'subList', 'i': 0, 'c': 6, 'r': 200, 'list': [{'mac': '09c4a41d000000', 'mid': '6049'}, {'mac': '352ea01d000000', 'mid': '6092'}, {'mac': '655ea31d000000', 'mid': '6049'}, {'mac': '0741a01d000000', 'mid': '6092'}, {'mac': '21eda91c000000', 'mid': '604c'}]}
[gree_protocol] get_subunits_list: found 5 sub-units
[gree_protocol] Discovered sub-device: {'name': 'GR-Gcloud_60_0a_5ba3_EC_09c4', 'host': '192.168.1.20', 'port': 7000, 'mac': '09c4a41d000000@9424b8fd5ba3', 'brand': 'gree', 'model': '6049', 'version': 'V3.2.M'}
[gree_protocol] Discovered sub-device: {'name': 'GR-Gcloud_60_0a_5ba3_EC_352e', 'host': '192.168.1.20', 'port': 7000, 'mac': '352ea01d000000@9424b8fd5ba3', 'brand': 'gree', 'model': '6092', 'version': 'V3.2.M'}
[gree_protocol] Discovered sub-device: {'name': 'GR-Gcloud_60_0a_5ba3_EC_655e', 'host': '192.168.1.20', 'port': 7000, 'mac': '655ea31d000000@9424b8fd5ba3', 'brand': 'gree', 'model': '6049', 'version': 'V3.2.M'}
[gree_protocol] Discovered sub-device: {'name': 'GR-Gcloud_60_0a_5ba3_EC_0741', 'host': '192.168.1.20', 'port': 7000, 'mac': '0741a01d000000@9424b8fd5ba3', 'brand': 'gree', 'model': '6092', 'version': 'V3.2.M'}
[gree_protocol] Discovered sub-device: {'name': 'GR-Gcloud_60_0a_5ba3_EC_21ed', 'host': '192.168.1.20', 'port': 7000, 'mac': '21eda91c000000@9424b8fd5ba3', 'brand': 'gree', 'model': '604c', 'version': 'V3.2.M'}
[gree_protocol] Discovery completed, found 5 devices

@vellad1

vellad1 commented Sep 23, 2026 •

Copy link
Copy Markdown

Hi @meirlo

I updated but I am having the same issue; could it be that in the latest zip you included the wrong files?

2026-09-23 07:49:43.998 DEBUG (MainThread) [custom_components.gree.gree_protocol] Starting Gree device discovery...
2026-09-23 07:49:44.001 DEBUG (MainThread) [custom_components.gree.gree_protocol] Discovered IPv4 interfaces for scan: [('10.1.2.10', '10.1.2.255', 'eno1'), ('172.18.0.1', '172.18.255.255', 'br-3f14b2e58493'), ('172.17.0.1', '172.17.255.255', 'docker0'), ('172.20.0.1', '172.20.255.255', 'br-e094742905e1'), ('172.30.10.128', '172.30.255.255', 'br-3d4d58e648e2'), ('172.21.0.1', '172.21.255.255', 'br-ddd741ab9f20'), ('172.22.0.1', '172.22.255.255', 'br-192bade39052'), ('172.23.0.1', '172.23.255.255', 'br-46c1012d2902'), ('172.19.0.1', '172.19.255.255', 'br-40dfec75c8d6')]
2026-09-23 07:49:44.002 DEBUG (MainThread) [custom_components.gree.gree_protocol] Found broadcast addresses from HA: ['255.255.255.255']
2026-09-23 07:49:44.003 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'eno1': ('10.1.2.10', 35466)
2026-09-23 07:49:44.004 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-3f14b2e58493': ('172.18.0.1', 58365)
2026-09-23 07:49:44.004 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'docker0': ('172.17.0.1', 58499)
2026-09-23 07:49:44.005 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-e094742905e1': ('172.20.0.1', 45911)
2026-09-23 07:49:44.005 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-3d4d58e648e2': ('172.30.10.128', 38343)
2026-09-23 07:49:44.005 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-ddd741ab9f20': ('172.21.0.1', 35956)
2026-09-23 07:49:44.005 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-192bade39052': ('172.22.0.1', 55090)
2026-09-23 07:49:44.005 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-46c1012d2902': ('172.23.0.1', 38242)
2026-09-23 07:49:44.005 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-40dfec75c8d6': ('172.19.0.1', 36933)
2026-09-23 07:49:44.006 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 10.1.2.255 via interface 'eno1' from 10.1.2.10
2026-09-23 07:49:44.007 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'eno1' from 10.1.2.10
2026-09-23 07:49:44.007 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 10.255.255.255 via interface 'eno1' from 10.1.2.10
2026-09-23 07:49:44.008 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.18.255.255 via interface 'br-3f14b2e58493' from 172.18.0.1
2026-09-23 07:49:44.009 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-3f14b2e58493' from 172.18.0.1
2026-09-23 07:49:44.009 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-3f14b2e58493' from 172.18.0.1
2026-09-23 07:49:44.009 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.17.255.255 via interface 'docker0' from 172.17.0.1
2026-09-23 07:49:44.009 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'docker0' from 172.17.0.1
2026-09-23 07:49:44.009 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'docker0' from 172.17.0.1
2026-09-23 07:49:44.009 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.20.255.255 via interface 'br-e094742905e1' from 172.20.0.1
2026-09-23 07:49:44.010 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-e094742905e1' from 172.20.0.1
2026-09-23 07:49:44.010 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-e094742905e1' from 172.20.0.1
2026-09-23 07:49:44.010 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.30.255.255 via interface 'br-3d4d58e648e2' from 172.30.10.128
2026-09-23 07:49:44.010 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-3d4d58e648e2' from 172.30.10.128
2026-09-23 07:49:44.010 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-3d4d58e648e2' from 172.30.10.128
2026-09-23 07:49:44.010 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.21.255.255 via interface 'br-ddd741ab9f20' from 172.21.0.1
2026-09-23 07:49:44.010 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-ddd741ab9f20' from 172.21.0.1
2026-09-23 07:49:44.010 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-ddd741ab9f20' from 172.21.0.1
2026-09-23 07:49:44.011 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.22.255.255 via interface 'br-192bade39052' from 172.22.0.1
2026-09-23 07:49:44.011 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-192bade39052' from 172.22.0.1
2026-09-23 07:49:44.011 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-192bade39052' from 172.22.0.1
2026-09-23 07:49:44.011 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.23.255.255 via interface 'br-46c1012d2902' from 172.23.0.1
2026-09-23 07:49:44.011 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-46c1012d2902' from 172.23.0.1
2026-09-23 07:49:44.011 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-46c1012d2902' from 172.23.0.1
2026-09-23 07:49:44.011 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.19.255.255 via interface 'br-40dfec75c8d6' from 172.19.0.1
2026-09-23 07:49:44.011 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-40dfec75c8d6' from 172.19.0.1
2026-09-23 07:49:44.011 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-40dfec75c8d6' from 172.19.0.1
2026-09-23 07:49:44.012 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending unicast scan to 1 hosts from ('0.0.0.0', 53610)
2026-09-23 07:49:44.012 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sent discovery packets, waiting for replies...
2026-09-23 07:49:44.022 DEBUG (MainThread) [custom_components.gree.gree_protocol] Decrypted discovery response from ('10.1.4.103', 7000) on interface 'unicast'
2026-09-23 07:49:44.022 DEBUG (MainThread) [custom_components.gree.gree_protocol] Discovered gateway 502cc6bb65b6 (subCnt=3), deferring sub-device fetch
2026-09-23 07:49:49.013 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching sub-devices for 1 gateway(s)
2026-09-23 07:49:49.014 DEBUG (MainThread) [custom_components.gree.gree_protocol] Detecting encryption version for device 502cc6bb65b6 at 10.1.4.103:7000
2026-09-23 07:49:49.014 DEBUG (MainThread) [custom_components.gree.gree_protocol] Testing encryption version 1 for device 502cc6bb65b6
2026-09-23 07:49:49.014 DEBUG (MainThread) [custom_components.gree.gree_protocol] Retrieving HVAC encryption key
2026-09-23 07:49:49.014 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid": "app","i": 1,"pack": "dIVu3efPO1ZaxdcHTqpzzbIb7C+RvOsAGSxMG4lL4QCj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc6bb65b6","uid": 0})
2026-09-23 07:49:49.159 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1
2026-09-23 07:49:49.159 DEBUG (MainThread) [custom_components.gree.gree_protocol] GetDeviceKey: FetchResult: {'t': 'bindOk', 'mac': '502cc6bb65b6', 'key': 'Xy1Ab4De7Gh0Jk3M', 'r': 200}
2026-09-23 07:49:49.159 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetched device encryption key: b'Xy1Ab4De7Gh0Jk3M'
2026-09-23 07:49:49.159 DEBUG (MainThread) [custom_components.gree.gree_protocol] Device 502cc6bb65b6 uses encryption version 1
2026-09-23 07:49:49.159 DEBUG (MainThread) [custom_components.gree.gree_protocol] Retrieving HVAC encryption key
2026-09-23 07:49:49.159 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid": "app","i": 1,"pack": "dIVu3efPO1ZaxdcHTqpzzbIb7C+RvOsAGSxMG4lL4QCj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc6bb65b6","uid": 0})
2026-09-23 07:49:49.170 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1
2026-09-23 07:49:49.170 DEBUG (MainThread) [custom_components.gree.gree_protocol] GetDeviceKey: FetchResult: {'t': 'bindOk', 'mac': '502cc6bb65b6', 'key': 'Xy1Ab4De7Gh0Jk3M', 'r': 200}
2026-09-23 07:49:49.170 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetched device encryption key: b'Xy1Ab4De7Gh0Jk3M'
2026-09-23 07:49:49.170 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid":"app","i":0,"pack":"yDSlE+KAaWWQiCg2COfxsP8RPBfbkrs+jR+M6H8/Ouig0YoZsdxQbRl/fOndUOkU","t":"pack","tcid":"502cc6bb65b6","uid":0})
2026-09-23 07:50:15.003 ERROR (MainThread) [custom_components.gree.gree_protocol] All 8 attempts failed for 10.1.4.103:7000, but the device DID answer a plain discovery probe. The port is open and the device is speaking, so this is not a network problem -- the encrypted exchange is failing. Check the device key and the encryption version. WiFi module: hid=362001067012+U-W06AV30.bin, ver=V1.1.0.0. Original error: TimeoutError
2026-09-23 07:50:15.004 ERROR (MainThread) [custom_components.gree.gree_protocol] Error fetching sub-device list for 502cc6bb65b6: 
2026-09-23 07:50:15.004 DEBUG (MainThread) [custom_components.gree.gree_protocol] Discovery completed, found 0 devices

@meirlo

meirlo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@vellad1 update on your W06 module — I figured out what was going on.

The gateway encrypts the subList response with a different key depending on how the request is sent:

  • the i:0/t:pack form → response encrypted with the gateway's bound key (this is what my working gateways answer),
  • the classic i:1/t:subList app form → response encrypted with the generic key.

Earlier builds only handled the first case, so even when a module answered the second form the reply came back as garbage (the 0xbb decrypt error) and looked like a failure. I've updated #507 to try the bound-key form first and then fall back to the generic-key form, decrypting each with the right key.

Could you re-pull the same combined build and try discovery once more? (Same link — it's been updated.)
Zip: https://github.com/meirlo/HomeAssistant-GreeClimateComponent/archive/refs/heads/test/vrf-all.zip

With custom_components.gree.gree_protocol: debug enabled, the line to look for is:
get_subunits_list: found N sub-units (device-key form) — or — (generic-key fallback form)

If neither appears, please paste the get_subunits_list lines and I'll take it from there. Thanks again for sticking with this! 🙏

@meirlo

meirlo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@Ilya-Draigor thanks again — your logs helped me understand the protocol much better.

Quick recap: your gateway answered on the device-key form and returned c:6 but only 5 units in the list. It turns out the gateway can return a different subset of units depending on how the subList request is framed. So I've updated #507 to query both request forms and merge the results — if your missing 6th unit shows up in the other form, you'll now get all 6.

Could you re-pull the same build and run discovery once more? (Same link — it's been updated.)
Zip: https://github.com/meirlo/HomeAssistant-GreeClimateComponent/archive/refs/heads/test/vrf-all.zip

With custom_components.gree.gree_protocol: debug on, the key line is now:
get_subunits_list: <gw> device-key=N, generic-key=M, merged=K

If merged shows 6 — great, we recovered it. If it still shows 5, then the 6th unit genuinely isn't returned by the gateway over the local protocol (a firmware limitation), and you can keep adding it manually as you're doing. Either way, please paste that line. Thanks!

@vellad1

vellad1 commented Sep 23, 2026

Copy link
Copy Markdown

@meirlo

still fails; i am really sorry - i hope i'm not doing something wrong myself

2026-09-23 12:52:18.982 DEBUG (MainThread) [custom_components.gree.gree_protocol] Starting Gree device discovery...
2026-09-23 12:52:18.983 DEBUG (MainThread) [custom_components.gree.gree_protocol] Discovered IPv4 interfaces for scan: [('10.1.2.10', '10.1.2.255', 'eno1'), ('172.18.0.1', '172.18.255.255', 'br-3f14b2e58493'), ('172.17.0.1', '172.17.255.255', 'docker0'), ('172.20.0.1', '172.20.255.255', 'br-e094742905e1'), ('172.30.10.128', '172.30.255.255', 'br-3d4d58e648e2'), ('172.21.0.1', '172.21.255.255', 'br-ddd741ab9f20'), ('172.22.0.1', '172.22.255.255', 'br-192bade39052'), ('172.23.0.1', '172.23.255.255', 'br-46c1012d2902'), ('172.19.0.1', '172.19.255.255', 'br-40dfec75c8d6')]
2026-09-23 12:52:18.983 DEBUG (MainThread) [custom_components.gree.gree_protocol] Found broadcast addresses from HA: ['255.255.255.255']
2026-09-23 12:52:18.983 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'eno1': ('10.1.2.10', 57349)
2026-09-23 12:52:18.983 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-3f14b2e58493': ('172.18.0.1', 47176)
2026-09-23 12:52:18.983 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'docker0': ('172.17.0.1', 41183)
2026-09-23 12:52:18.983 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-e094742905e1': ('172.20.0.1', 42099)
2026-09-23 12:52:18.983 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-3d4d58e648e2': ('172.30.10.128', 34412)
2026-09-23 12:52:18.983 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-ddd741ab9f20': ('172.21.0.1', 33112)
2026-09-23 12:52:18.983 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-192bade39052': ('172.22.0.1', 33855)
2026-09-23 12:52:18.983 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-46c1012d2902': ('172.23.0.1', 39493)
2026-09-23 12:52:18.984 DEBUG (MainThread) [custom_components.gree.gree_protocol] Using discovery socket bound for interface 'br-40dfec75c8d6': ('172.19.0.1', 53185)
2026-09-23 12:52:18.984 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 10.1.2.255 via interface 'eno1' from 10.1.2.10
2026-09-23 12:52:18.984 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'eno1' from 10.1.2.10
2026-09-23 12:52:18.984 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 10.255.255.255 via interface 'eno1' from 10.1.2.10
2026-09-23 12:52:18.984 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.18.255.255 via interface 'br-3f14b2e58493' from 172.18.0.1
2026-09-23 12:52:18.984 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-3f14b2e58493' from 172.18.0.1
2026-09-23 12:52:18.985 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-3f14b2e58493' from 172.18.0.1
2026-09-23 12:52:18.985 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.17.255.255 via interface 'docker0' from 172.17.0.1
2026-09-23 12:52:18.985 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'docker0' from 172.17.0.1
2026-09-23 12:52:18.985 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'docker0' from 172.17.0.1
2026-09-23 12:52:18.985 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.20.255.255 via interface 'br-e094742905e1' from 172.20.0.1
2026-09-23 12:52:18.985 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-e094742905e1' from 172.20.0.1
2026-09-23 12:52:18.985 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-e094742905e1' from 172.20.0.1
2026-09-23 12:52:18.986 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.30.255.255 via interface 'br-3d4d58e648e2' from 172.30.10.128
2026-09-23 12:52:18.986 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-3d4d58e648e2' from 172.30.10.128
2026-09-23 12:52:18.986 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-3d4d58e648e2' from 172.30.10.128
2026-09-23 12:52:18.986 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.21.255.255 via interface 'br-ddd741ab9f20' from 172.21.0.1
2026-09-23 12:52:18.986 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-ddd741ab9f20' from 172.21.0.1
2026-09-23 12:52:18.986 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-ddd741ab9f20' from 172.21.0.1
2026-09-23 12:52:18.986 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.22.255.255 via interface 'br-192bade39052' from 172.22.0.1
2026-09-23 12:52:18.986 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-192bade39052' from 172.22.0.1
2026-09-23 12:52:18.987 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-192bade39052' from 172.22.0.1
2026-09-23 12:52:18.987 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.23.255.255 via interface 'br-46c1012d2902' from 172.23.0.1
2026-09-23 12:52:18.987 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-46c1012d2902' from 172.23.0.1
2026-09-23 12:52:18.987 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-46c1012d2902' from 172.23.0.1
2026-09-23 12:52:18.987 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.19.255.255 via interface 'br-40dfec75c8d6' from 172.19.0.1
2026-09-23 12:52:18.987 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 255.255.255.255 via interface 'br-40dfec75c8d6' from 172.19.0.1
2026-09-23 12:52:18.987 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending discovery to 172.31.255.255 via interface 'br-40dfec75c8d6' from 172.19.0.1
2026-09-23 12:52:18.988 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sending unicast scan to 254 hosts from ('0.0.0.0', 42025)
2026-09-23 12:52:18.990 DEBUG (MainThread) [custom_components.gree.gree_protocol] Sent discovery packets, waiting for replies...
2026-09-23 12:52:19.001 DEBUG (MainThread) [custom_components.gree.gree_protocol] Decrypted discovery response from ('10.1.4.103', 7000) on interface 'unicast'
2026-09-23 12:52:19.002 DEBUG (MainThread) [custom_components.gree.gree_protocol] Discovered gateway 502cc6bb65b6 (subCnt=3), deferring sub-device fetch
2026-09-23 12:52:19.004 DEBUG (MainThread) [custom_components.gree.gree_protocol] Decrypted discovery response from ('10.1.4.105', 7000) on interface 'unicast'
2026-09-23 12:52:19.005 DEBUG (MainThread) [custom_components.gree.gree_protocol] Discovered gateway 502cc6bb6594 (subCnt=3), deferring sub-device fetch
2026-09-23 12:52:23.991 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching sub-devices for 2 gateway(s)
2026-09-23 12:52:23.993 DEBUG (MainThread) [custom_components.gree.gree_protocol] Detecting encryption version for device 502cc6bb65b6 at 10.1.4.103:7000
2026-09-23 12:52:23.993 DEBUG (MainThread) [custom_components.gree.gree_protocol] Testing encryption version 1 for device 502cc6bb65b6
2026-09-23 12:52:23.993 DEBUG (MainThread) [custom_components.gree.gree_protocol] Retrieving HVAC encryption key
2026-09-23 12:52:23.994 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid": "app","i": 1,"pack": "dIVu3efPO1ZaxdcHTqpzzbIb7C+RvOsAGSxMG4lL4QCj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc6bb65b6","uid": 0})
2026-09-23 12:52:23.996 DEBUG (MainThread) [custom_components.gree.gree_protocol] Detecting encryption version for device 502cc6bb6594 at 10.1.4.105:7000
2026-09-23 12:52:23.996 DEBUG (MainThread) [custom_components.gree.gree_protocol] Testing encryption version 1 for device 502cc6bb6594
2026-09-23 12:52:23.996 DEBUG (MainThread) [custom_components.gree.gree_protocol] Retrieving HVAC encryption key
2026-09-23 12:52:23.996 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.105:7000, data sent: {"cid": "app","i": 1,"pack": "dIVu3efPO1ZaxdcHTqpzzYgS0gA+lvgEqfLIh99c3Wej9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc6bb6594","uid": 0})
2026-09-23 12:52:24.020 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1
2026-09-23 12:52:24.020 DEBUG (MainThread) [custom_components.gree.gree_protocol] GetDeviceKey: FetchResult: {'t': 'bindOk', 'mac': '502cc6bb65b6', 'key': 'Xy1Ab4De7Gh0Jk3M', 'r': 200}
2026-09-23 12:52:24.020 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetched device encryption key: b'Xy1Ab4De7Gh0Jk3M'
2026-09-23 12:52:24.020 DEBUG (MainThread) [custom_components.gree.gree_protocol] Device 502cc6bb65b6 uses encryption version 1
2026-09-23 12:52:24.020 DEBUG (MainThread) [custom_components.gree.gree_protocol] Retrieving HVAC encryption key
2026-09-23 12:52:24.020 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.103:7000, data sent: {"cid": "app","i": 1,"pack": "dIVu3efPO1ZaxdcHTqpzzbIb7C+RvOsAGSxMG4lL4QCj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc6bb65b6","uid": 0})
2026-09-23 12:52:24.030 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1
2026-09-23 12:52:24.030 DEBUG (MainThread) [custom_components.gree.gree_protocol] GetDeviceKey: FetchResult: {'t': 'bindOk', 'mac': '502cc6bb6594', 'key': '0Tu3Wx6Za9Cd2Fg5', 'r': 200}
2026-09-23 12:52:24.030 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetched device encryption key: b'0Tu3Wx6Za9Cd2Fg5'
2026-09-23 12:52:24.030 DEBUG (MainThread) [custom_components.gree.gree_protocol] Device 502cc6bb6594 uses encryption version 1
2026-09-23 12:52:24.030 DEBUG (MainThread) [custom_components.gree.gree_protocol] Retrieving HVAC encryption key
2026-09-23 12:52:24.031 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetching device at: 10.1.4.105:7000, data sent: {"cid": "app","i": 1,"pack": "dIVu3efPO1ZaxdcHTqpzzYgS0gA+lvgEqfLIh99c3Wej9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc6bb6594","uid": 0})
2026-09-23 12:52:24.032 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1
2026-09-23 12:52:24.032 DEBUG (MainThread) [custom_components.gree.gree_protocol] GetDeviceKey: FetchResult: {'t': 'bindOk', 'mac': '502cc6bb65b6', 'key': 'Xy1Ab4De7Gh0Jk3M', 'r': 200}
2026-09-23 12:52:24.032 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetched device encryption key: b'Xy1Ab4De7Gh0Jk3M'
2026-09-23 12:52:24.048 DEBUG (MainThread) [custom_components.gree.gree_protocol] Successfully received response on attempt 1
2026-09-23 12:52:24.048 DEBUG (MainThread) [custom_components.gree.gree_protocol] GetDeviceKey: FetchResult: {'t': 'bindOk', 'mac': '502cc6bb6594', 'key': '0Tu3Wx6Za9Cd2Fg5', 'r': 200}
2026-09-23 12:52:24.048 DEBUG (MainThread) [custom_components.gree.gree_protocol] Fetched device encryption key: b'0Tu3Wx6Za9Cd2Fg5'
2026-09-23 12:52:26.034 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 1/3 failed for 10.1.4.103:7000: TimeoutError: 
2026-09-23 12:52:26.050 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 1/3 failed for 10.1.4.105:7000: TimeoutError: 
2026-09-23 12:52:28.436 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 2/3 failed for 10.1.4.103:7000: TimeoutError: 
2026-09-23 12:52:28.457 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 2/3 failed for 10.1.4.105:7000: TimeoutError: 
2026-09-23 12:52:31.165 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 3/3 failed for 10.1.4.103:7000: TimeoutError: 
2026-09-23 12:52:31.166 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 3/3 failed for 10.1.4.105:7000: TimeoutError: 
2026-09-23 12:52:33.167 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 1/3 failed for 10.1.4.103:7000: TimeoutError: 
2026-09-23 12:52:33.167 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 1/3 failed for 10.1.4.105:7000: TimeoutError: 
2026-09-23 12:52:35.569 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 2/3 failed for 10.1.4.103:7000: TimeoutError: 
2026-09-23 12:52:35.569 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 2/3 failed for 10.1.4.105:7000: TimeoutError: 
2026-09-23 12:52:38.271 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 3/3 failed for 10.1.4.103:7000: TimeoutError: 
2026-09-23 12:52:38.271 WARNING (MainThread) [custom_components.gree.gree_protocol] get_subunits_list: no subList form answered for 502cc6bb65b6
2026-09-23 12:52:38.272 DEBUG (MainThread) [custom_components.gree.gree_protocol] _subunits_send_ecb attempt 3/3 failed for 10.1.4.105:7000: TimeoutError: 
2026-09-23 12:52:38.274 WARNING (MainThread) [custom_components.gree.gree_protocol] get_subunits_list: no subList form answered for 502cc6bb6594
2026-09-23 12:52:38.274 DEBUG (MainThread) [custom_components.gree.gree_protocol] Discovery completed, found 0 devices

@meirlo

meirlo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@vellad1 no need to apologise at all — your logs are exactly what we needed, and they've answered the question.

The new build now tries both request forms, and your gateways answered neither — every attempt timed out, on both the device-key and the generic-key form:

_subunits_send_ecb attempt 1/3 failed ... TimeoutError
...
get_subunits_list: no subList form answered for 502cc6bb65b6

Binding and status/command requests work fine on your gateways, but the subList command specifically gets no response in any form. Your WiFi module is a W06 (hid=362001067012+U-W06AV30.bin, ver=V1.1.0.0) — an older module than the GR-Gcloud V3.2.M units the other testers and I have, which do answer subList. It looks like this firmware simply doesn't implement local sub-unit enumeration (some Gree modules only expose that over the cloud), so there isn't a request format that will make it list the units locally.

Two questions/suggestions:

  1. Did VRF discovery ever work for you on this integration (any earlier version), or has listing sub-units always failed on these gateways? I want to be sure I'm not introducing a regression versus something that used to work.

  2. You can still add each indoor unit manually without the auto-list. In the Gree+ app, each indoor unit has its own MAC — enter it in the integration as subMAC@gatewayMAC, e.g. xxxxxxxxxxxx@502cc6bb65b6 (the sub-unit's MAC, then @, then the gateway MAC). That routes commands to the individual unit through the gateway, which is exactly what discovery would have produced. Use the real device key auto-discovered from the gateway.

Thanks again for the thorough testing — it's genuinely helpful for making this robust across modules. 🙏

@vellad1

vellad1 commented Sep 23, 2026

Copy link
Copy Markdown
  1. Did VRF discovery ever work for you on this integration (any earlier version), or has listing sub-units always failed on these gateways? I want to be sure I'm not introducing a regression versus something that used to work.

I don't believe it ever did.

  1. You can still add each indoor unit manually without the auto-list. In the Gree+ app, each indoor unit has its own MAC — enter it in the integration as subMAC@gatewayMAC, e.g. xxxxxxxxxxxx@502cc6bb65b6 (the sub-unit's MAC, then @, then the gateway MAC). That routes commands to the individual unit through the gateway, which is exactly what discovery would have produced. Use the real device key auto-discovered from the gateway.

Yes, I can add them manually as subMAC@gatewayMAC. That's how i was working before. I tried it again now and I can add them individually.

Before all this I had 'reverse-engineered' it manually using the UDP Sender but it has been quite some time. However I just found some random notes that I am pasting below in case it gives you some indication on how I was getting the sub-units.

{"t":"pack","i":1,"uid":0,"cid":"502cc6bb6594","tcid":"","pack":"LP24Ek0OaYogxs3iQLjL4CBxnFxsHnmj5ooGcY8cM8JYT1PXPBDouOPiWHaG4G8lz22fUZtUbkblUYF5BzlKDV9xeQzMlsaP4RKBtrnsDrP2vDhZT5SKFgDtaqaj1AEDqWiTgGkoXDxunmUMdG7sp/aOGxc0vwxgjIcGCxHsPhQzC4lTnSTLUh7rJxHLkPTAUgEZnR87H5dIVewkCjMlC6n+/sB6g39ps/bszRb9no2vwosJlmZ9sWYMTM53/iMO650SUm5+PUAHJCHoMNFTY1e0UhcQlGKBKmvII+q4NwFIb8ZoqBOXkJzzQshsMp024LtWExRG/CLU0E8ebLPQtg=="}

{"t":"dev","cid":"502cc6bb6594","bc":"gree","brand":"gree","catalog":"gree","mac":"502cc6bb6594","mid":"60","model":"gree","name":"c6bb6594","series":"gree","vender":"1","ver":"V1.1.0.0","lock":0,"hid":"362001067012+U-W06AV30.bin","subCnt":3}


-

{"t":"dev","cid":"502cc6bb6594","bc":"gree","brand":"gree","catalog":"gree","mac":"502cc6bb6594","mid":"60","model":"gree","name":"c6bb6594","series":"gree","vender":"1","ver":"V1.1.0.0","lock":0,"hid":"362001067012+U-W06AV30.bin","subCnt":3}

--

{"mac":"502cc6bb6594","t":"bind","uid":0}

{"cid":"app","i":1,"pack":"dIVu3efPO1ZaxdcHTqpzzYgS0gA+lvgEqfLIh99c3Wej9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc6bb6594","uid":0}

--

{"t":"pack","i":1,"uid":0,"cid":"502cc6bb6594","tcid":"app","pack":"MWQd8NecdFWZIS8jB7ovXe5GDPGzi75B6sOWRLb4mASWd8J6Ujyw7mLS7FnyJUAHMFZBVmMrfMT3/4FMO+qPoozD1k6jjxiwE2rMrTg7Xnk="}

{"t":"bindOk","mac":"502cc6bb6594","key":"0Tu3Wx6Za9Cd2Fg5","r":200}

--

climate:
  - platform: gree
    name: GVRF
    host: 10.1.4.105
    port: 7000
    #mac: '50:2c:c6:bb:65:94'
	mac: '22:47:eb:1c:00:00:00'
	encryption_key: '0Tu3Wx6Za9Cd2Fg5'
    target_temp_step: 1
	
	--
	{"cid":"502cc6bb6594","i":0,"mac":"502cc6bb6594","t":"subDev"}
	
	
{"cid":"app","i":0,"pack":"ynnmFkts7/IH+Ixajd1ybOXyJal3H9quKCToaAzbq1R8NaLBVgnnX1YfpNKfQPDuSCAs0ctCHTJnJQU4b57DRw==","t":"pack","tcid":"502cc6bb6594","uid":1677840}

-
{"t":"pack","i":1,"uid":0,"cid":"502cc6bb6594","tcid":"app","pack":"MWQd8NecdFWZIS8jB7ovXe5GDPGzi75B6sOWRLb4mASWd8J6Ujyw7mLS7FnyJUAHMFZBVmMrfMT3/4FMO+qPoozD1k6jjxiwE2rMrTg7Xnk="}

--

{"t":"pack","i":0,"uid":1677840,"cid":"502cc6bb6594","tcid":"app","pack":"4KMJb3wvQ9i2hztM8Ewzz4TrcZNsu0QyAq7B4GKjZehoNahTb9tg4FF2mmRvpt1U9+J2+6vLleBO3G+HKSuWOm8/XLNy0pKRJEBkGCZaFESbmOagTbqZR2GYcwzitA3J/ROSSmZmC6oibxY+vS1Z2YGX/LWMvQEdKSixr5ztVOtiRiTVU+05aHD+zhpuWMVSS2epqO1Gqvjy9YmJSXvFow=="}


{"t":"subList","c":3,"i":0,"r":200,"list":[{"mac":"2247eb1c000000","mid":"6092"},{"mac":"7993281e000000","mid":"608f"},{"mac":"8cf2281e000000","mid":"608f"}]}

--
.103>> Ground

{"t":"pack","i":1,"uid":0,"cid":"502cc6bb65b6","tcid":"","pack":"LP24Ek0OaYogxs3iQLjL4LV+3itYf/Sqi0dRr8i/zBhYT1PXPBDouOPiWHaG4G8lz22fUZtUbkblUYF5BzlKDV9xeQzMlsaP4RKBtrnsDrNsptsE1BRixdGF03CDtGrcqWiTgGkoXDxunmUMdG7sp/aOGxc0vwxgjIcGCxHsPhSxsoOqjCHOzs3PN4R4TgI2UgEZnR87H5dIVewkCjMlC6n+/sB6g39ps/bszRb9no2vwosJlmZ9sWYMTM53/iMO650SUm5+PUAHJCHoMNFTY1e0UhcQlGKBKmvII+q4NwFIb8ZoqBOXkJzzQshsMp024LtWExRG/CLU0E8ebLPQtg=="}

PP> 

{"t":"dev","cid":"502cc6bb65b6","bc":"gree","brand":"gree","catalog":"gree","mac":"502cc6bb65b6","mid":"60","model":"gree","name":"c6bb65b6","series":"gree","vender":"1","ver":"V1.1.0.0","lock":0,"hid":"362001067012+U-W06AV30.bin","subCnt":3}

--

{"mac":"502cc6bb65b6","t":"bind","uid":0}

{"cid":"app","i":1,"pack":"dIVu3efPO1ZaxdcHTqpzzbIb7C+RvOsAGSxMG4lL4QCj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"502cc6bb65b6","uid":0}

--

{"t":"pack","i":1,"uid":0,"cid":"502cc6bb65b6","tcid":"app","pack":"MWQd8NecdFWZIS8jB7ovXfkQyTF5SVVgzmILcLZCb1Rtj8DpfZhG5lqQw9iF69In5FK4d8Qx4B3rWSa+kckBxIzD1k6jjxiwE2rMrTg7Xnk="}

PP> {"t":"bindOk","mac":"502cc6bb65b6","key":"Xy1Ab4De7Gh0Jk3M","r":200}

--

{"cid":"app","i":0,"pack":"6OFizQTKTWJu9xU+OtszS6bkRWnmzUQq5A8+wtyZONr6MSFgAvARc434u+ta6QtrV0CRNXVGaoi8JZ0z9f2f6A==","t":"pack","tcid":"502cc6bb65b6","uid":1677840}

{"cid":"502cc6bb65b6","i":0,"mac":"502cc6bb65b6","t":"subDev

--

{"t":"pack","i":0,"uid":1677840,"cid":"502cc6bb65b6","tcid":"app","pack":"OX9Jx2p/2LZt/VkcTWhPpA92QZnVGknTlxmiGgwLKu1K1YzcaBW4jHXrgM6Jxiy7sgrRtXsg1j5Qv+1o6Wuqr/RpVVQQzh7PJ+CgZzS64tDj8EMv0Xk4UupiUAPyuMw1cWvX2O9gujSEjPMXhURhgMtQM6Zf9hF9YTHJjBAhjeuvb8X6NXUl8FAkqnxOpG1+81/lJhkj1bsQtT1ROhlIuw=="}

{"t":"subList","c":3,"i":0,"r":200,"list":[{"mac":"945e6e1c000000","mid":"6092"},{"mac":"0e9e6b1c000000","mid":"6092"},{"mac":"f712291e000000","mid":"608f"}]}

--

{"cid":"app","i":0,"pack":"vRZXtzGRgS1e73BgfR4I3l0Q7WmqDTv68J3i4MC+55Jo5wpoapvxUC/5ZrnPDs0RAsUMBKn54/oGSGZ6RE1krlOyo8Gq8oRC7qBZGxkueiE=","t":"pack","tcid":"502cc6bb65b6","uid":1677840}

{"opt":["Pow"],"p":[0],"t":"cmd","sub":"0e9e6b1c000000"}
m8eOKoLKXrKgekxiE1pqPVxg5Ab7DC1WJaM4gBOlKCdK0kCbWyF1Q/glxvRgE2BcrxZkcLX06eRpG9LnGy3i2w==

{"opt":["Pow"],"p":[0],"t":"cmd","sub":"945e6e1c000000"}
m8eOKoLKXrKgekxiE1pqPVxg5Ab7DC1WJaM4gBOlKCeU61IaEDiViGo9L1LXCQA2rxZkcLX06eRpG9LnGy3i2w==

{"opt":["Pow"],"p":[1],"t":"cmd","sub":"f712291e000000"}
m8eOKoLKXrKgekxiE1pqPVxg5Ab7DC1WJaM4gBOlKCdYb9CyOFs0eWRqkiz2bOjVrxZkcLX06eRpG9LnGy3i2w==

@Ilya-Draigor

Copy link
Copy Markdown

@meirlo
Finaly!
Now i see 6 units in drop-down list on discovery page

[custom_components.gree.gree_protocol] get_subunits_list: 9424b8fd5ba3 device-key=5, generic-key=5, merged=6
[custom_components.gree.gree_protocol] Discovery completed, found 6 devices

Thanks !!!

@vellad1

vellad1 commented Sep 23, 2026

Copy link
Copy Markdown

some more notes i found; with remarks:

> To init first I send: 

{"t": "scan"}

< It respons with the below:

{"t":"pack","i":1,"uid":0,"cid":"","tcid":"","pack":"LP24Ek0OaYogxs3iQLjL4BVQrnhhm6bIbF4lYMZHEBXLzN9Hu47j/i2SOavdy6LSJe9nJOSQSkTAceSmRpiXiuMNvEK0mv+gSzBluS/4bRfakI8L01ztFMDGEJqbVpG5HwVwXwkfxAVGlFCSKfxY2aRXNYcGXOKIKxj2Bw09PDT7uCcQL+2Znh8GznBiMsyyEIKj4lXhPYADBPEHeNEvAGsMCWONUbO4OGEgUT8EJqw="} 

The 'pack' is a AES encrypted BASE64 encoded JSON object.  On the initial msg it will encrypt with the Generic AES Key (see top of this file).  While experimenting you can use the website at top of file.

Once we decode the pack it will return the JSON object below.

PACK>
{
	"t": "dev",
	"cid": "",
	"bc": "",
	"brand": "",
	"catalog": "",
	"mac": "b4430dd50fd2",  (MAC ADDRESS if the MASTER unit in the VRF)
	"mid": "60",
	"model": "",
	"name": "格力空调",
	"lock": 0,
	"series": "",
	"vender": "",
	"ver": "",
	"subCnt": 4  (This seems to show the number of Indoor Units that form part of this VRF)
	
	
}

----

The VRF Wifi system, if already configured via Wifi to the Mobile App, will have a different AES key.  We need to get this AES key; once we receive it we will need to start using this new AES key instead of the Generic AES key.

> We need to bind to device so we create the pack, base64 encode and AES encrypt and we send it.

{"cid":"app","i":1,"pack":"RYRzIhbdBOK69NE4Sn3+BltUHn/8ST9D6NuQwySi58ij9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"b4430dd50fd2","uid":0}

			PACK>
			{
				"mac": "b4430dd50fd2",
				"t": "bind",
				"uid": 0
			}
			
< It will retun to us with the AES key to use.

{"t":"pack","i":1,"uid":0,"cid":"b4430dd50fd2","tcid":"app","pack":"FtZAY6UHKBwtaI55He0IndbigvnBprnXzJ0aHiL7qKrIfPIT8CQPmH3vmroMbWrqoG3/wyIVV1S95fAE+XH3azheNV4XSEuWnzFUL6Jcvf8="}

			PACK>

			{
				"r": 200,
				"t": "bindOk",
				"mac": "b4430dd50fd2",
				"key": "<NEW AES KEY123>"
			}
			

----

> Now we need to pass a command so that it tells us how many Indoor units there are connected to this VRF.  Important; from now on use the NEW AES KEY.  We send:

{"cid":"app","i":0,"pack":"2aakQct9yAaNyBcR+0pBxJMzj+Nh6Nd1rVOU4Ox2zCSWXzfTeob/3Tn7VxeCRI+co+WAHnuq4TiaN5S7aLcMGw==","t":"pack","tcid":"b4430dd50fd2","uid":1677840}

< I will return to us the list of indoor units and a 'mac' address for each indoor unit.  I am calling it a MAC address but this seems to be a nonroutable fake mac address - basically it's an identifier.

{"t":"pack","i":0,"uid":1677840,"cid":"b4430dd50fd2","tcid":"app","pack":"ieZhmrdQTSz6jAsxv/aTfWGeCBE0QKM0Y0tX66qlTjDkW0rv8O2U++gTj6vjKcXuiTQGzfmUSVgMuFlaSTWsgVF9JzXiEpntPp59OGTN+d8rvQ4sucDDNml3bdgy9A1Kxx8FMSZlxrj1xQ9gw3tTjaSzC0mwl3Y7wyDtfxQysLDyxCQZSBu9b+BXyPx3ynfhUX0nNeISme0+nn04ZM353yu9Diy5wMM2aXdt2DL0DUrHHwUxJmXGuPXFD2DDe1ON2h7eVjdNraJZ1//Z8A5gspnOQA8RCxTZ9xsGLOfSuZ1RfSc14hKZ7T6efThkzfnfK70OLLnAwzZpd23YMvQNSscfBTEmZca49cUPYMN7U42RS2ZqFWsvJ1jo3uAg/Bgdmc5ADxELFNn3GwYs59K5nVF9JzXiEpntPp59OGTN+d8rvQ4sucDDNml3bdgy9A1Kxx8FMSZlxrj1xQ9gw3tTjVV4K2y5g5L3oUqG66uknW0="

PACK>
{
	"t": "subList",
	"c": 4,
	"i": 0,
	"list": [
		{
			"mac": "5259911b000000",  (fake mac address for each indoor unit; to be used as reference when sending commands)
			"name": "格力空调",
			"mid": "604b",
			"model": "",
			"lock": 0
		},
		{
			"mac": "fa7ad91a000000",
			"name": "格力空调",
			"mid": "604b",
			"model": "",
			"lock": 0
		},
		{
			"mac": "61fed31a000000",
			"name": "格力空调",
			"mid": "604b",
			"model": "",
			"lock": 0
		},
		{
			"mac": "dcecd31a000000",
			"name": "格力空调",
			"mid": "604b",
			"model": "",
			"lock": 0
		}
	],
	"r": 200
}

----

@meirlo

meirlo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@vellad1 those notes are the missing piece — thank you, this is exactly what I needed! 🎯

Your W06 module doesn't use the subList command at all. It enumerates sub-units via a different command, subDev, wrapped in a device-key pack with a non-zero uid — visible right here in your capture:

{"cid":"502cc6bb65b6","i":0,"mac":"502cc6bb65b6","t":"subDev"}
→ {"t":"subList","c":3,"i":0,"r":200,"list":[{"mac":"945e6e1c000000","mid":"6092"}, ...]}

We'd only ever been sending subList, which your firmware ignores — hence the timeouts. I've added the subDev form to #507, and it unions with the others. Interestingly it also returns the full list on my GR-Gcloud V3.2.M gateway, so it looks like a good universal path.

Could you re-pull the same build and run discovery once more?
Zip: https://github.com/meirlo/HomeAssistant-GreeClimateComponent/archive/refs/heads/test/vrf-all.zip

With custom_components.gree.gree_protocol: debug on, the key line is now:
get_subunits_list: <gw> device-key=N, generic-key=M, subDev=K, merged=T

I'm expecting your two gateways to finally list their 3 units each via the subDev column. Fingers crossed — and thanks again, your reverse-engineering notes cracked this. 🙏

@vellad1

vellad1 commented Sep 23, 2026 •

Copy link
Copy Markdown

@meirlo

Great news; they are now being shown :) Well done and Thank you!!

image

@meirlo

meirlo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@Ilya-Draigor 🎉 excellent — 6 of 6! And it confirms exactly why the union matters:

get_subunits_list: 9424b8fd5ba3 device-key=5, generic-key=5, merged=6

Each form returned a different set of 5, so neither alone was complete — merging them by MAC recovered the full 6. Really glad it's all showing now, and thanks a lot for the patient back-and-forth and logs. 🙏

@vellad1 fantastic — and this one's down to your reverse-engineering notes. Your W06 needed the subDev command instead of subList, which we'd never have found without your captures. Both your gateways listing their units now is a great result. Thank you for sticking with it and sharing all that detail! 🙏

@meirlo

meirlo commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@RobHofmann summary across the VRF series — all three PRs are now validated on real hardware by VRF owners:

The three are independent and additive, but together they make VRF/multi-split work end-to-end. Testing surfaced real module variance that #507 now handles (different sub-enumeration commands — subList vs subDev — and gateways returning a partial list per form, so results are unioned by MAC).

Given the confirmations from multiple VRF owners, would you be open to reviewing/merging the set? Happy to rebase, split, or adjust anything you'd like. Thanks!

@RobHofmann
RobHofmann merged commit 641b7e9 into RobHofmann:master Sep 23, 2026
@RobHofmann

Copy link
Copy Markdown
Owner

https://github.com/RobHofmann/HomeAssistant-GreeClimateComponent/releases/tag/4.0.7

Thanks for contributing guys! amazing work!

I will do another PR towards the 5.0-dev branch for the future version with the same knowledge! Will ask you guys to help me test that one too later.

RobHofmann added a commit that referenced this pull request Sep 23, 2026
Since #508, the xfan, lights, health, powersave, 8 degC heat, sleep and air
switches took their availability from `_device_online`. With "Disable
Available Check" on, the climate entity never sets that field, so it stays
None and the seven switches were unavailable for good. The climate entity
itself stayed available, because its `available` checks the option first.

`_prop_supported()` now uses the climate entity's `available`, so the
switches follow the same rule as the climate entity.
RobHofmann added a commit that referenced this pull request Sep 23, 2026
#508 re-applies the commanded values over the read-back for up to 8 s, so a
VRF gateway's stale cache does not revert the UI. It did that for every
unit. A standalone unit is read directly, and when it corrects a value it
cannot take (for example an unsupported swing mode), it reports its own
value. The hold then kept the refused value on screen for up to 8 s,
where before the UI showed the corrected value at once.

The hold and the 2 s follow-up read now only apply when the device is a
sub-unit (sub MAC differs from the gateway MAC). Standalone units behave
as before #508. The same change went into the 5.0 port (#522).
RobHofmann added a commit that referenced this pull request Sep 24, 2026
…until confirmed (#522)

* VRF gateways: ask all sub-device list forms, hold sent values until confirmed

Port of the VRF fixes that landed on master in #507 and #508. #454 needs no
port: 5.0 already gives each indoor unit its own device.

Sub-device list: a gateway answers one or more of three request forms,
depending on its WiFi module firmware (device key, generic key, subDev).
The old single hybrid form was never confirmed on hardware. V1 gateways
now get all three forms and the lists are joined by MAC; V2 gets the
device key form. The generic key form is encrypted with the device key
but answered with the generic key, so request_json() takes an optional
response_cipher. Gateways from a scan are handled side by side. On the
GR-Gcloud V3.2.M gateway from #507 the forms gave 4, 3 and 4 units,
joined 4.

Stale state: a gateway answers from a cache for a few seconds after a
command, so the read right after it showed the old value again. The
device state now holds sent values until the device reports them, for at
most 8 s. The coordinator polls again every 2 s while values are held. A
standalone unit confirms on the first read and gets no extra poll.

Suite: 247 passed (227 before).

* Only hold sent values for VRF sub-units

The stale cache was only seen on VRF gateways. For a standalone unit a hold
has a cost: when the unit corrects a value it cannot take, for example an
unsupported swing mode, it reports its own value, and the hold kept the
refused value on screen for up to 8 s. Standalone units now behave as they
did before the hold.

To find out whether a standalone unit or the MQTT transport caches too,
every device now logs at debug level when the read right after a command
does not report the sent value, with the transport and whether it is a
sub-unit.

Suite: 249 passed.

* Send the generic-key sub-device list request with the generic key

The generic-key form is answered with the generic key, but its request used
the bound device key, so transport.request_json() needed a separate
response_cipher for this one case. A probe on a GR-Gcloud V3.2.M gateway
(PR 507) showed the gateway ignores the request pack of this form: device,
generic and random keys all got the same answer, 3 units, readable with the
generic key. The request now uses the generic key too, and response_cipher
is removed again. The form stays in the union, because it adds units on some
gateways.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed to test This issue needs testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants