Fix hybrid Gree firmware bind and protocol version detection - #13
Open
rasmusbe wants to merge 3 commits into
Open
Fix hybrid Gree firmware bind and protocol version detection#13rasmusbe wants to merge 3 commits into
rasmusbe wants to merge 3 commits into
Conversation
Some units reply to discovery with a V1-style envelope but only accept bind over AES-GCM. Match greeclimate by aligning wire-format details and falling back from V1 to V2 bind on the same UDP session.
Retry encrypted requests on the alternate protocol version when the stored version times out or fails to decrypt, then write the working version back to the config entry so existing setups upgrade without re-adding the device.
This was referenced May 30, 2026
Some Gree units return opt/p on res packets instead of opt/val, which caused set_state to fail after a successful command.
|
I am currently having this issue "Could not reach the device on the supplied IP" with modern Daitsu ACs. Bumping due to interest. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tcid, JSON serialization) so encrypted packets match what Gree firmware expects.scan_then_bind()on a single UDP session with V1→V2 fallback when bind times out — required for units that reply to scan with a V1-style envelope but only accept bind over AES-GCM (same behaviour as the official Gree integration).protocol_versionon encrypted traffic — if status/cmd fails on the stored version (timeout or decrypt error), retry the alternate version and write the working one back to the config entry. Existing integrations upgrade without remove/re-add.tools/probe.pywith--bindfor standalone setup debugging; fix config-flow error mapping and test fixtures.Context
Reported setup failure: discovery finds the device, then "Could not reach the device on the supplied IP". Tested against a Gree
V3.4.Munit at192.168.50.196— scan succeeds, V1 bind times out (~10s), V2 bind returnsbindok. Official HA Gree integration works on the same hardware.Hybrid units also require V2 for all post-bind encrypted traffic (status, commands). Config entries created before this fix may store
protocol_version: 1from the V1 scan envelope; the auto-fallback corrects that on the first successful poll.Test plan
pytest tests/— 43 passed (includes protocol-version fallback unit test)python tools/probe.py <ip> --bind— V1 timeout then V2 bind OK on live Gree unitEwpeDevice.bind()+get_status()against live device after fix