cmroche / greeclimate

Python package for controlling Gree based minisplit systems
GNU General Public License v3.0
42 stars 21 forks source link

Gree Vimeo+ always returning temp in C even if F selected #30

Closed seantibor closed 2 years ago

seantibor commented 3 years ago

My new Gree Vireo+ is passing through the current temperature setting in C, even if the temperature units are set to F. Here is the output of the device info and properties. I believe the model number is VIR12HP115V1B.

asyncio - DEBUG - Using selector: EpollSelector libs.greeclimate.discovery - INFO - Scanning for Gree devices ... libs.greeclimate.discovery - DEBUG - Listening for devices on 192.168.1.197 libs.greeclimate.discovery - DEBUG - Listening for devices on 172.18.0.1 libs.greeclimate.discovery - DEBUG - Listening for devices on 172.19.0.1 libs.greeclimate.discovery - DEBUG - Listening for devices on 172.17.0.1 greeclimate.network - DEBUG - Sending packet: {"t": "scan"} greeclimate.network - DEBUG - Sending packet: {"t": "scan"} greeclimate.network - DEBUG - Sending packet: {"t": "scan"} greeclimate.network - DEBUG - Sending packet: {"t": "scan"} greeclimate.network - DEBUG - Received packet from 192.168.1.122: {"t": "pack", "i": 1, "uid": 0, "cid": "502cc62cc6ea", "tcid": "178a137c151d", "pack": {"t": "dev", "cid": "502cc62cc6ea", "bc": "", "brand": "gree", "catalog": "gree", "mac": "502cc62cc6ea", "mid": "10001", "model": "gree", "name": "c62cc6ea", "series": "gree", "vender": "1", "ver": "V1.2.1", "lock": 0}} libs.greeclimate.discovery - INFO - Found gree device Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea) libs.greeclimate.device - INFO - Starting device binding to Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea) greeclimate.network - DEBUG - Sending packet: {"cid": "app", "i": 1, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"mac": "502cc62cc6ea", "t": "bind", "uid": 0}} greeclimate.network - DEBUG - Received packet: {"t": "pack", "i": 1, "uid": 0, "cid": "502cc62cc6ea", "tcid": "178a137c151d", "pack": {"t": "bindok", "mac": "502cc62cc6ea", "key": "1Cd4Fg7Ij0Lm3Op6", "r": 200}} libs.greeclimate.device - INFO - Bound to device using key 1Cd4Fg7Ij0Lm3Op6 root - DEBUG - Adding Gree device at 192.168.1.122:7000 (c62cc6ea) libs.greeclimate.device - DEBUG - Updating device properties for (Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea)) greeclimate.network - DEBUG - Sending packet: {"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"mac": "502cc62cc6ea", "t": "status", "cols": ["hid"]}} greeclimate.network - DEBUG - Received packet: {"t": "pack", "i": 0, "uid": 0, "cid": "502cc62cc6ea", "tcid": "178a137c151d", "pack": {"t": "dat", "mac": "502cc62cc6ea", "r": 200, "cols": ["hid"], "dat": ["362001000762+U-CS532AE(LT)V3.31.bin"]}} greeclimate.network - DEBUG - Sending packet: {"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"mac": "502cc62cc6ea", "t": "status", "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"]}} greeclimate.network - DEBUG - Received packet: {"t": "pack", "i": 0, "uid": 0, "cid": "502cc62cc6ea", "tcid": "178a137c151d", "pack": {"t": "dat", "mac": "502cc62cc6ea", "r": 200, "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"], "dat": [1, 1, 23, 63, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]}} Props.POWER: 1 Props.MODE: 1 Props.TEMP_SET: 23 Props.TEMP_SENSOR: 63 Props.TEMP_UNIT: 1 Props.TEMP_BIT: 0 Props.FAN_SPEED: 0 Props.FRESH_AIR: 0 Props.XFAN: 0 Props.ANION: 1 Props.SLEEP: 0 Props.SLEEP_MODE: 0 Props.LIGHT: 1 Props.SWING_HORIZ: 0 Props.SWING_VERT: 0 Props.QUIET: 0 Props.TURBO: 1 Props.STEADY_HEAT: 0 Props.POWER_SAVE: 0 Props.UNKNOWN_HEATCOOLTYPE: 0

cmroche commented 3 years ago

Working on this in #31 and #32

cmroche commented 3 years ago

@seantibor I just pushed an update to the test branch, install with

wget -O - https://raw.githubusercontent.com/cmroche/HA-GreeComponentInstaller/master/install-test.sh | bash

And please confirm. Thanks.

seantibor commented 3 years ago

still getting the same behavior and logs. I reloaded the component from the script, restarted the server, uninstalled and reinstalled the custom component.

Here's everything after deleting and reloading the device.


{"t": "pack", "i": 1, "uid": 0, "cid": "502cc62cc6ea", "tcid": "", "pack": {"t": "dev", "cid": "502cc62cc6ea", "bc": "", "brand": "gree", "catalog": "gree", "mac": "502cc62cc6ea", "mid": "10001", "model": "gree", "name": "c62cc6ea", "series": "gree", "vender": "1", "ver": "V1.2.1", "lock": 0}}
2021-05-05 21:56:07 INFO (MainThread) [greeclimate.discovery] Found gree device Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea)
2021-05-05 21:56:07 INFO (MainThread) [greeclimate.device] Starting device binding to Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea)
2021-05-05 21:56:07 DEBUG (MainThread) [greeclimate.network] Sending packet:
{"cid": "app", "i": 1, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"mac": "502cc62cc6ea", "t": "bind", "uid": 0}}
2021-05-05 21:56:07 DEBUG (MainThread) [greeclimate.network] Received packet:
{"t": "pack", "i": 1, "uid": 0, "cid": "502cc62cc6ea", "tcid": "", "pack": {"t": "bindok", "mac": "502cc62cc6ea", "key": "1Cd4Fg7Ij0Lm3Op6", "r": 200}}
2021-05-05 21:56:07 INFO (MainThread) [greeclimate.device] Bound to device using key 1Cd4Fg7Ij0Lm3Op6
2021-05-05 21:56:07 INFO (MainThread) [custom_components.gree.bridge] Adding Gree device c62cc6ea at 192.168.1.122:7000
2021-05-05 21:56:07 DEBUG (MainThread) [greeclimate.device] Updating device properties for (Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea))
2021-05-05 21:56:07 DEBUG (MainThread) [greeclimate.network] Sending packet:
{"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"mac": "502cc62cc6ea", "t": "status", "cols": ["hid"]}}
2021-05-05 21:56:07 DEBUG (MainThread) [greeclimate.network] Received packet:
{"t": "pack", "i": 0, "uid": 0, "cid": "502cc62cc6ea", "tcid": "", "pack": {"t": "dat", "mac": "502cc62cc6ea", "r": 200, "cols": ["hid"], "dat": ["362001000762+U-CS532AE(LT)V3.31.bin"]}}
2021-05-05 21:56:07 DEBUG (MainThread) [greeclimate.network] Sending packet:
{"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"mac": "502cc62cc6ea", "t": "status", "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"]}}
2021-05-05 21:56:07 DEBUG (MainThread) [greeclimate.network] Received packet:
{"t": "pack", "i": 0, "uid": 0, "cid": "502cc62cc6ea", "tcid": "", "pack": {"t": "dat", "mac": "502cc62cc6ea", "r": 200, "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"], "dat": [1, 1, 24, 64, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]}}
2021-05-05 21:56:21 DEBUG (MainThread) [greeclimate.device] Pushing state updates to (Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea))
2021-05-05 21:56:21 DEBUG (MainThread) [greeclimate.device] Sending remote state update Tur -> 1
2021-05-05 21:56:21 DEBUG (MainThread) [greeclimate.network] Sending packet:
{"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"opt": ["Tur"], "p": [1], "t": "cmd"}}
2021-05-05 21:56:21 DEBUG (MainThread) [greeclimate.network] Received packet:
{"t": "pack", "i": 0, "uid": 0, "cid": "502cc62cc6ea", "tcid": "", "pack": {"t": "res", "mac": "502cc62cc6ea", "r": 200, "opt": ["Tur"], "p": [1], "val": [1]}}
2021-05-05 21:56:23 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.olga_the_robot_vacuum is taking over 10 seconds
2021-05-05 21:56:24 DEBUG (MainThread) [greeclimate.device] Pushing state updates to (Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea))
2021-05-05 21:56:24 DEBUG (MainThread) [greeclimate.device] Sending remote state update Tur -> 0
2021-05-05 21:56:24 DEBUG (MainThread) [greeclimate.network] Sending packet:
{"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"opt": ["Tur"], "p": [0], "t": "cmd"}}
2021-05-05 21:56:24 DEBUG (MainThread) [greeclimate.network] Received packet:
{"t": "pack", "i": 0, "uid": 0, "cid": "502cc62cc6ea", "tcid": "", "pack": {"t": "res", "mac": "502cc62cc6ea", "r": 200, "opt": ["Tur"], "p": [0], "val": [0]}}
2021-05-05 21:56:43 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.olga_the_robot_vacuum is taking over 10 seconds
2021-05-05 21:57:03 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.olga_the_robot_vacuum is taking over 10 seconds
2021-05-05 21:57:07 DEBUG (MainThread) [greeclimate.device] Updating device properties for (Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea))
2021-05-05 21:57:07 DEBUG (MainThread) [greeclimate.network] Sending packet:
{"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"mac": "502cc62cc6ea", "t": "status", "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"]}}
2021-05-05 21:57:07 DEBUG (MainThread) [greeclimate.network] Received packet:
{"t": "pack", "i": 0, "uid": 0, "cid": "502cc62cc6ea", "tcid": "", "pack": {"t": "dat", "mac": "502cc62cc6ea", "r": 200, "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"], "dat": [1, 1, 24, 64, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]}}
2021-05-05 21:57:23 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.olga_the_robot_vacuum is taking over 10 seconds
2021-05-05 21:57:43 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.olga_the_robot_vacuum is taking over 10 seconds
2021-05-05 21:57:52 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140373382862400] Specified temperature is out of range.
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 167, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1481, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1516, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 658, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 743, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 695, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 548, in async_service_temperature_set
    await entity.async_set_temperature(**kwargs)
  File "/config/custom_components/gree/climate.py", line 180, in async_set_temperature
    self.coordinator.device.target_temperature = round(temperature)
  File "/usr/local/lib/python3.8/site-packages/greeclimate/device.py", line 335, in target_temperature
    validate(rec["temSet"])
  File "/usr/local/lib/python3.8/site-packages/greeclimate/device.py", line 331, in validate
    raise ValueError("Specified temperature is out of range.")
ValueError: Specified temperature is out of range.
2021-05-05 21:57:54 INFO (SyncWorker_3) [custom_components.mail_and_packages.helpers] No mail found.
2021-05-05 21:58:02 DEBUG (MainThread) [greeclimate.device] Pushing state updates to (Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea))
2021-05-05 21:58:02 DEBUG (MainThread) [greeclimate.device] Sending remote state update TemRec -> 0
2021-05-05 21:58:02 DEBUG (MainThread) [greeclimate.network] Sending packet:
{"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"opt": ["TemRec"], "p": [0], "t": "cmd"}}
2021-05-05 21:58:02 DEBUG (MainThread) [greeclimate.network] Received packet:
{"t": "pack", "i": 0, "uid": 0, "cid": "502cc62cc6ea", "tcid": "", "pack": {"t": "res", "mac": "502cc62cc6ea", "r": 200, "opt": ["TemRec"], "p": [0], "val": [0]}}
2021-05-05 21:58:03 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.olga_the_robot_vacuum is taking over 10 seconds
2021-05-05 21:58:06 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtmp://192.168.1.197/live/pool
2021-05-05 21:58:06 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtmp://192.168.1.197/live/north
2021-05-05 21:58:06 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtmp://192.168.1.197/live/waterfront
2021-05-05 21:58:06 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtmp://192.168.1.197/live/south
2021-05-05 21:58:07 DEBUG (MainThread) [greeclimate.device] Updating device properties for (Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea))
2021-05-05 21:58:07 DEBUG (MainThread) [greeclimate.network] Sending packet:
{"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"mac": "502cc62cc6ea", "t": "status", "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"]}}
2021-05-05 21:58:07 DEBUG (MainThread) [greeclimate.network] Received packet:
{"t": "pack", "i": 0, "uid": 0, "cid": "502cc62cc6ea", "tcid": "", "pack": {"t": "dat", "mac": "502cc62cc6ea", "r": 200, "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"], "dat": [1, 1, 24, 64, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]}}
2021-05-05 21:58:23 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.olga_the_robot_vacuum is taking over 10 seconds
2021-05-05 21:58:43 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.olga_the_robot_vacuum is taking over 10 seconds
2021-05-05 21:59:03 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.olga_the_robot_vacuum is taking over 10 seconds
2021-05-05 21:59:07 DEBUG (MainThread) [greeclimate.device] Updating device properties for (Device: c62cc6ea @ 192.168.1.122:7000 (mac: 502cc62cc6ea))
2021-05-05 21:59:07 DEBUG (MainThread) [greeclimate.network] Sending packet:
{"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc62cc6ea", "pack": {"mac": "502cc62cc6ea", "t": "status", "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"]}}
2021-05-05 21:59:07 DEBUG (MainThread) [greeclimate.network] Received packet:
{"t": "pack", "i": 0, "uid": 0, "cid": "502cc62cc6ea", "tcid": "", "pack": {"t": "dat", "mac": "502cc62cc6ea", "r": 200, "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingLfRig", "SwUpDn", "Quiet", "Tur", "StHt", "SvSt", "HeatCoolType"], "dat": [1, 1, 24, 64, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]}}
2021-05-05 21:59:23 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.olga_the_robot_vacuum is taking over 10 seconds```
seantibor commented 3 years ago

Can we change the min_temp and max_temp properties when it's in F mode? Screen Shot 2021-05-05 at 10 02 09 PM

cmroche commented 3 years ago

Ah yes, that's a good catch. I'll have to make that change on the HA side though.. this could definitely explain the error.

However, your logs also show me that you were not on the latest greeclimate, I changed the log to include to temperature pushed, which wasn't in the logs you shared.

raise ValueError(f"Specified temperature {val} is out of range.")

In any case, thanks for the info. I'll look at this tomorrow, if problems persist I'll setup a pi with an image I can test on directly.

seantibor commented 3 years ago

Ok -- I got it showing that ValueError message format now with a few more restarts and reinstalls. I also updated climate.py in the gree component to test out min_temp and max_temp by updating MIN_TEMP & MAX_TEMP to MIN_TEMP_C & MAX_TEMP_C in const.py. Also added MIN_TEMP_F and MAX_TEMP_F with values of 60 and 86 respectively.

Then updated climate.py to have the following.

@property
    def min_temp(self) -> float:
        """Return the minimum temperature supported by the device."""
        return MIN_TEMP_C if self.temperature_unit == TEMP_CELSIUS else MIN_TEMP_F

    @property
    def max_temp(self) -> float:
        """Return the maximum temperature supported by the device."""
        return MAX_TEMP_C if self.temperature_unit == TEMP_CELSIUS else MAX_TEMP_F

It worked exactly as expected and I can set temps up and down without an issue. Thank you for chasing this down with me. Looking forward to having it fixed up on the main HA releases. :)

cmroche commented 3 years ago

Thank again for your help. I'll update tests tonight to cover this case as well and should submit the fix soon.

cmroche commented 3 years ago

@seantibor Pushed an update to the test branch with the changes you've added. I think this will be good now, so I'll prepare the bugfix MR to HA tonight.