home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.51k stars 30.34k forks source link

Gree Climate Integration - error in fresh install #122200

Closed ilya-draigor closed 2 months ago

ilya-draigor commented 2 months ago

The problem

Gree Climate with GCloud wifi module connected to one of the VRF units All works with Gree+ android app, can see and controll all 6 units In HA have errors in integration start up

  File "/usr/local/lib/python3.12/site-packages/greeclimate/device.py", line 402, in current_temperature
    return self._convert_to_units(prop - TEMP_OFFSET, bit)
                                  ~~~~~^~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'str' and 'int'

Core 2024.7.3 Supervisor 2024.06.2 Operating System 12.4 Frontend 20240710.0

Gree Wifi module: v1.10 MID: 6000-v2.8

What version of Home Assistant Core has the issue?

2024.7.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Gree

Link to integration documentation on our website

https://www.home-assistant.io/integrations/gree/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-07-19 21:52:51.098 DEBUG (MainThread) [greeclimate.device] Updating device properties for (Device: GR-Gcloud_60_0a_5ba3_EC @ 192.168.1.20:7000 (mac: 9424b8fd5ba3))
2024-07-19 21:52:51.101 DEBUG (MainThread) [greeclimate.network] Sending packet:
{"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "9424b8fd5ba3", "pack": {"mac": "9424b8fd5ba3", "t": "status", "cols": ["Pow", "Mod", "Dwet", "DwatSen", "Dfltr", "DwatFul", "Dmod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"]}}
2024-07-19 21:52:51.120 DEBUG (MainThread) [greeclimate.network] Received packet:
{"t": "pack", "cid": "9424b8fd5ba3", "tcid": "app", "uid": 0, "i": 0, "pack": {"t": "dat", "mac": "9424b8fd5ba3", "cols": ["Pow", "Mod", "Dwet", "DwatSen", "Dfltr", "DwatFul", "Dmod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"], "dat": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], "r": 200}}
2024-07-19 21:52:51.120 DEBUG (MainThread) [homeassistant.components.gree.coordinator] Finished fetching gree-GR-Gcloud_60_0a_5ba3_EC data in 0.023 seconds (success: True)
2024-07-19 21:52:51.122 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 255, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 411, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 165, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 491, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1133, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1070, in __async_calculate_state
    if state_attributes := self.state_attributes:
                           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 318, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 526, in state_attributes
    hass, self.current_temperature, temperature_unit, precision
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 318, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/gree/climate.py", line 145, in current_temperature
    return self.coordinator.device.current_temperature
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/greeclimate/device.py", line 402, in current_temperature
    return self._convert_to_units(prop - TEMP_OFFSET, bit)
                                  ~~~~~^~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'str' and 'int'

Additional information

No response

home-assistant[bot] commented 2 months ago

Hey there @cmroche, mind taking a look at this issue as it has been labeled with an integration (gree) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `gree` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign gree` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


gree documentation gree source (message by IssueLinks)

cmroche commented 2 months ago

Your device is not returning meaningful data to the request:

["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], "r": 200}

What type and model is it? Does it work in Gree+ app? Can you copy and paste responses to the scan and bind messages please.

cmroche commented 2 months ago

@home-assistant add-label needs-more-information

ilya-draigor commented 2 months ago

Thanks for responding, this wifi module working thru Gree+ on android and all 6 AC units are available as i understand from other discussions this integration still not supporting VRF units with single wifi controller

cmroche commented 2 months ago

@ilya-draigor Could you clarify for me what a VRF unit is, and do you have link to the other discussions? If I can get the needed info, I don't mind adding support... though it's a bit challenging without someone providing details and communications between the app and wifi unit as I don't have one myself.

Would you be comfortable setting up wireshark to capture comms between your phone and the units, running through all the commands in the app, then sending that capture? It would take some time, but I could always investigate if there is a way to make it work.

ilya-draigor commented 2 months ago

@cmroche VRF is one outdoor unit and multiple indoor units connected to one line (chain) i don't have wifi module installed in each indoor unit, i have only one installed in one of the units, and this wifi module have access to all units thru canbus image image

sure, i can try to capture some packeck with wireshark

thanks

cmroche commented 2 months ago

Since this is an unsupported device, closing.

@home-assistant close

ilya-draigor commented 2 months ago

I did some checks.

This can be supported, by adding subList function.

When sending {"t": "scan"} request i got: {"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.

Then sending request to get a list of units: {"cid":"app","i":0,"pack":"Lmtc+jPqo5okmScSkppBww==","t":"subList","tcid":"9424b8fd5ba3","uid":0} (pack with empty payload), "t":"subList" is the point. The responce will be: {"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"}]} (Here i have something strange, i have 6 units, but list contain only 5, on phone app i see all 6 units)

And now if i send regular payload, but in "mac" i put internal unit mac adress, it works, {"cols":["Pow"],"mac":"21eda91c000000","t":"status"} i successfully got stats, powered on and off, changed temperature.

Hope this can help to update the integration.

cmroche commented 2 months ago

@ilya-draigor Yes, thanks for the info. I will enter this into the issues backlog on greeclimate and take a look in due time. It will take a little bit of rework to support this, as there is presently an assumption of a single device per wifi controller at the moment in both the underlying lib and the gree integration.

cmroche commented 2 months ago

@home-assistant close