fix: complete VRF device_info fix started in #338 — sub-units still share one HA device#454
Open
ItayGo wants to merge 1 commit into
Open
fix: complete VRF device_info fix started in #338 — sub-units still share one HA device#454ItayGo wants to merge 1 commit into
ItayGo wants to merge 1 commit into
Conversation
In a multi-split setup (subMAC@gatewayMAC), all indoor units share the same device_info identifier (the gateway MAC). HA treats them as entities of one single device, so assigning the device to an area moves all units together — it is impossible to put each unit in its own room. The same bug affects unique_id in GreeEntity, which also used the gateway MAC, causing entity conflicts across units. Fix: use _sub_mac_addr (the indoor unit MAC) as the device identifier and unique_id base in both climate.py and entity.py. Each indoor unit now registers as its own independent HA device and can be assigned to a different area individually. Note: after deploying this fix, delete the old shared ghost device that HA will leave behind in Settings > Devices.
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.
Problem
For Gree multi-split VRF gateways (one WiFi module controlling multiple indoor units, e.g.
GR-Gcloud), all indoor units were grouped under a single shared HA device. This made it impossible to assign individual units to different rooms/areas.Root cause:
device_infoused_mac_addr(the gateway MAC, shared by all sub-units) instead of_sub_mac_addr(the unique per-unit sub-MAC).This is a continuation of #338, which fixed
unique_idinclimate.pyto use_sub_mac_addrbut leftdevice_infoinclimate.pyand bothunique_id+device_infoinentity.pystill using the gateway MAC.Changes
climate.py:device_infoidentifiers now useself._sub_mac_addrinstead ofself._mac_addrentity.py: both_attr_unique_idanddevice_infoidentifiers now useself._device._sub_mac_addrResult
Each VRF indoor unit appears as its own separate HA device and can be assigned to its own room/area independently.
Migration note for existing users
If you already have a multi-split VRF setup configured, after updating you will see a lingering ghost shared device (the old combined device with the gateway MAC). HA will keep it around because it was previously in your device registry.
To clean it up: go to Settings → Devices & Services → Devices, find the old shared Gree device (it will have no active entities), and delete it. The 5 individual devices will remain unaffected.
Tested on
GR-Gcloudtype) with 5 indoor units, sub-MACs insubMAC@gatewayMACformat