HomeAssistant-GreeClimateComponent icon indicating copy to clipboard operation
HomeAssistant-GreeClimateComponent copied to clipboard

Support Central ac with gateway

Open lelemka0 opened this issue 3 years ago • 2 comments

I use a Gree central air conditioner sold in China, which uses a gateway to communicate with every sub-device. This gateway is called "格力云控" and the version I have is 2. Here, the gateway is the parent device, and each air conditioner is the child device. To get or change the settings for each air conditioner requires communication with the gateway. The communication format is basically the same as other air conditioners, but a little difference is as follows.

tcid: the gateway mac address mac: the sub-device mac address

This modification works fine on my device, and sorry for my bad English.

lelemka0 avatar Feb 07 '22 04:02 lelemka0

Hi i'm testing this at the moment. It does seem to be working, however; i'm getting a lot of these (Generic) errors: 2022-02-22 14:13:49 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/gree/climate.py", line 604, in _async_health_entity_state_changed self._async_update_current_health(new_state) File "/config/custom_components/gree/climate.py", line 614, in _async_update_current_health self.SyncState({'Health': 0}) File "/config/custom_components/gree/climate.py", line 490, in SyncState currentValues = self.GreeGetValues(optionsToFetch) File "/config/custom_components/gree/climate.py", line 293, in GreeGetValues return self.FetchResult(self.CIPHER, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['dat'] File "/config/custom_components/gree/climate.py", line 272, in FetchResult data, addr = clientSock.recvfrom(64000) socket.timeout: timed out 2022-02-22 14:13:49 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/gree/climate.py", line 556, in _async_lights_entity_state_changed self._async_update_current_lights(new_state) File "/config/custom_components/gree/climate.py", line 566, in _async_update_current_lights self.SyncState({'Lig': 0}) File "/config/custom_components/gree/climate.py", line 490, in SyncState currentValues = self.GreeGetValues(optionsToFetch) File "/config/custom_components/gree/climate.py", line 293, in GreeGetValues return self.FetchResult(self.CIPHER, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['dat'] File "/config/custom_components/gree/climate.py", line 272, in FetchResult data, addr = clientSock.recvfrom(64000) socket.timeout: timed out

I tested the same thing with the old (current) version; no errors.

Can you look into this & fix those errors?

RobHofmann avatar Feb 22 '22 13:02 RobHofmann

May be the problem is on Input Validation due to my mistake. tcid lacks default value so that is incorrectly defined. Please test the latest commit.

lelemka0 avatar Feb 23 '22 10:02 lelemka0