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

Error while setting up Gree platform for climate

Open merzkem opened this issue 3 years ago • 5 comments

Received this log message while trying to setup the Gree Climate

Logger: homeassistant.components.climate Source: custom_components/gree/climate.py:232 Integration: Climate (documentation, issues) First occurred: 1:38:11 PM (1 occurrences) Last logged: 1:38:11 PM

Error while setting up gree platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform await asyncio.shield(task) File "/usr/local/lib/python3.9/asyncio/coroutines.py", line 124, in coro res = func(*args, **kw) File "/config/custom_components/gree/climate.py", line 118, in async_setup_platform GreeClimate(hass, name, ip_addr, port, mac_addr, timeout, target_temp_step, temp_sensor_entity_id, lights_entity_id, xfan_entity_id, health_entity_id, powersave_entity_id, sleep_entity_id, eightdegheat_entity_id, air_entity_id, hvac_modes, fan_modes, swing_modes, encryption_key, uid) File "/config/custom_components/gree/climate.py", line 165, in init self._encryption_key = self.GetDeviceKey().encode("utf8") File "/config/custom_components/gree/climate.py", line 249, in GetDeviceKey return self.FetchResult(cipher, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['key'] File "/config/custom_components/gree/climate.py", line 232, in FetchResult data, addr = clientSock.recvfrom(64000) socket.timeout: timed out

Configuration climate:

  • platform: gree name: Garage HVAC host: 192.168.1.179 port: 7000 mac: 'c4:39:60:bd:d4:0c' target_temp_step: 1 temp_sensor: sensor.garage_temperature

merzkem avatar Jan 11 '22 18:01 merzkem

Hello, i have exact same error reported:

Logger: homeassistant.components.climate Source: custom_components/gree/climate.py:232 Integration: Klimat First occurred: 11:46:28 (1 occurrences) Last logged: 11:46:28

Error while setting up gree platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform await asyncio.shield(task) File "/usr/local/lib/python3.9/asyncio/coroutines.py", line 124, in coro res = func(*args, **kw) File "/config/custom_components/gree/climate.py", line 118, in async_setup_platform GreeClimate(hass, name, ip_addr, port, mac_addr, timeout, target_temp_step, temp_sensor_entity_id, lights_entity_id, xfan_entity_id, health_entity_id, powersave_entity_id, sleep_entity_id, eightdegheat_entity_id, air_entity_id, hvac_modes, fan_modes, swing_modes, encryption_key, uid) File "/config/custom_components/gree/climate.py", line 165, in init self._encryption_key = self.GetDeviceKey().encode("utf8") File "/config/custom_components/gree/climate.py", line 249, in GetDeviceKey return self.FetchResult(cipher, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['key'] File "/config/custom_components/gree/climate.py", line 232, in FetchResult data, addr = clientSock.recvfrom(64000) socket.timeout: timed out

Config is:

  • platform: gree name: First AC host: 192.168.5.16 port: 7000 mac: '50:2C:C6:6C:88:C7' target_temp_step: 1 temp_sensor: sensor.rm_mini_temperature

Sivv3k avatar Feb 14 '22 10:02 Sivv3k

Same error occurring - using an ecoAir ARTICA.

Configuration:

- platform: gree
  name: Study AC
  host: 10.21.51.37
  port: 7000
  mac: 'f4:91:1e:7d:c7:d3'
  target_temp_step: 1
  temp_sensor: sensor.study_ac_temperature

Debug log output:

2022-04-21 20:36:43 INFO (SyncWorker_6) [custom_components.gree.climate] Fetching(10.21.51.37, 7000, 10, {"cid":"app","i":0,"pack":"Hk2NSJCo13UicB/Zk/Vlflb4yDzzZLsHtlvLCZoHKGjnxpUOaEPtz1L9NbIaxl/N3aKBBA+pIo7+dwXilGLeQqSQqpOrnYCZ5ZHw1jhBJQTPtG3vnw21gzkDDwT0kmFdgMzXvXba8wVNHfW1nAkeNa1I5jvDntcyjQ7Ta9cRp+xKw5p1rFeGNxS4prOo14iADUvDORORkAvjfsVS1JhnDtPHJYmnhqHTIUNuwXsgjzevX5KYdYa9VYRVHqvpWaNg1j3CCv+QO0e9qVKw3sMhHJ5VsbZ7Wy8djurVBfv0III=","t":"pack","tcid":"f4911e7dc7d3","uid":0})
2022-04-21 20:36:53 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.ecoair_artica fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 514, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 750, in async_device_update
await task
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/gree/climate.py", line 674, in update
self.SyncState()
File "/config/custom_components/gree/climate.py", line 434, in SyncState
currentValues = self.GreeGetValues(optionsToFetch)
File "/config/custom_components/gree/climate.py", line 251, in GreeGetValues
return self.FetchResult(self.CIPHER, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['dat']
File "/config/custom_components/gree/climate.py", line 230, in FetchResult
data, addr = clientSock.recvfrom(64000)
socket.timeout: timed out

Increasing timeout didn't help here, and I believe the request is likely in need of updating.

Stealthii avatar Apr 21 '22 19:04 Stealthii

As an FYI, all of these problems went away when I moved to the official integration. Seems a lot of headway has been made, and the same configuration outlined above works.

Stealthii avatar Apr 21 '22 20:04 Stealthii

I tried connecting the official integration instead of a custom one. It worked pretty smooth. But I had the following issues during a 30 min test :

  1. Swing mode - Only Up/Down without an option to select swing region.
  2. Temp sensor was not showing in the thermostat card.
  3. One AC became unavailable 2 times in 30 minutes.

Positive moments were that config was done without messing with the climate.yaml, health and xfan options were exposed from the start, it was working with internet connection taken down. But still with disconnects and limited functionality.

So I'm back to this custom integration. In the config I increased the timeout value to 30 - will check if it will create less noise in error logs.

DaniilMir avatar Jun 09 '22 22:06 DaniilMir

Hi!

I just bought our new Gree - AC: one 3,5kW type of Amber Royal (GWH12YD-S6DBA1A) in Hungary. Never tried to control any AC with my HA as we did not have it yet, so I'm really newby here.

I succesfully registered a new Gree account for the mobile Gree+ application, and after switch off and on again the WIFI function seemed everything worked fine (Interestingly I had to turn off and on the WIFI function as somehow after the initial WIFI/Gree+ app setup my IR remote lost almost all of its functions. The mobile app worked fine, but the IR remote basically could only control the 'light' and the WIFI mode. After turning off and on WIFI the problem had beeen solved.).

So I had a working AC with the official cloud remote functions.

  1. I tried to set it up with the official 'Gree Climate' integration in HA but it simply did not find the AC device.
  2. I tried to install this custom integration with HACS and the following climate: config:
- platform: gree
  name: '[Climate]'
  host: 192.168.1.55
  mac: 'xx:xx:xx:xx:xx:xx'
  port: 7000
  timeout: 10
  target_temp_step: 1
  temp_sensor: sensor.living_room_ac_temp
#  health: input_boolean.ac_health
#  sleep: input_boolean.ac_sleep
#  eightdegheat: input_boolean.ac_eightdegheat

of course with the valid MAC, but at the end I got the exact same errors in the logs as this topic is about.

As you wrote that the official integration could be solve this problem, can anybody help me what could be my problem, and why the official integration could not find the device?

  1. Could it be the result of an unsupported device, with unsupported WIFI controller?
  2. Of could be the result that my HA runs from az RPi 4b (through Docker) on 5GHz WIFI connection while the AC can work only on 2.4GHz? I did not think that, as both of them are connecting to my router/WIFI access-point, so basically both of them are on the same local network.

Appreciated to any help turning me into the right direction!

(Also not so clear for me that the configured sensor in this integration will exposed by the integration itself, or do I need to independently/manually configure something emty/fake sensor for it?)

Tamas-Toth-ebola avatar Nov 15 '22 18:11 Tamas-Toth-ebola

This is a very generic "can not connect" message.

The things I can point in are:

  • Make sure both Home Assistant & your HVAC are on the same network
  • There should be no firewalls blocking traffic between Home Assistant & the HVAC
  • Enable WiFi on your HVAC model (I have to turn this on)
  • Power off -> wait 5 minutes -> power on -> try again

If this doesn't work, I would make the assumption that your device is incompatible.

RobHofmann avatar May 13 '24 07:05 RobHofmann