Giter Club home page Giter Club logo

homeassistant-greeclimatecomponent's Introduction

hacs_badge

HomeAssistant-GreeClimateComponent

Custom Gree climate component written in Python3 for Home Assistant. Controls AC's supporting the Gree protocol.

Tested on the following hardware:

  • Innova HVAC
  • Cooper & Hunter (CH-S12FTXE(WI-FI)-NG)
  • AC Pioneer Fortis Series with WI-FI module CS532AE
  • AC Gree GWH12ACC-K6DNA1D
  • Inventor Life Pro WiFi
  • Toyotomi Izuru TRN/TRG-828ZR
  • Sinclair ASH-13BIF2
  • TOSOT BORA-GWH09AAB
  • CASCADE BORA-CWH09AAB
  • EWT S-090 GDI-HRFN1, EWT S-120 GDI-HRFN1 (WI-FI module CS532AEH)
  • Tadiran Alpha Expert Inverter
  • Copmax Air-Air Heatpump GWH12QC-K6DNA5F 3.5kW
  • Bulex vivair multisplit units; 20-080MC4NO outdoor unit, 20-025 NWI (2,5 kW) indoor unit, 20-035 NWI (3,5 kW) indoor unit

Tested on Home Assistant 2024.5.4.

If you are experiencing issues please be sure to provide details about your device, Home Assistant version and what exactly went wrong.

If your HVAC has already been configured to be controlled remotely by an android app, the encryption key might have changed.

To configure HVAC wifi (without the android app): https://github.com/arthurkrupa/gree-hvac-mqtt-bridge#configuring-hvac-wifi

Sources used:

HACS

This component is added to HACS default repository list.

Custom Component Installation

!!! PLEASE NOTE !!!: Skip step 1 if you are using HACS.

  1. Copy the custom_components folder to your own hassio /config folder.

  2. In the root of your /config folder, create a file called climate.yaml

    - platform: gree
      name: First AC
      host: <ip of your first AC>
      port: 7000
      mac: '<mac address of your first AC. NOTE: Format can be XX:XX:XX:XX:XX:XX or XX-XX-XX-XX-XX-XX depending on your model>'
      target_temp_step: 1
      encryption_key: <OPTIONAL: custom encryption key. Integration will try to get key from device if empty>
      encryption_version: <OPTIONAL: should be set to 2 for V1.21>
      uid: <some kind of device identifier. NOTE: for some devices this is optional>
      temp_sensor: <entity id of the EXTERNAL temperature sensor. For example: sensor.bedroom_temperature>
      lights: <OPTIONAL: input_boolean to switch AC lights mode on/off. For example: input_boolean.first_ac_lights>
      xfan: <OPTIONAL: input_boolean to switch AC xfan mode on/off. For example: input_boolean.first_ac_xfan>
      health: <OPTIONAL: input_boolean used to switch the Health option on/off of your first AC. For example: input_boolean.first_ac_health>
      sleep: <OPTIONAL: input_boolean to switch AC sleep mode on/off. For example: input_boolean.first_ac_sleep>
      powersave: <OPTIONAL: input_boolean to switch AC powersave mode on/off. For example: input_boolean.first_ac_powersave>
      eightdegheat: <OPTIONAL: input_boolean used to switch 8 degree heating on/off on your first AC>
      air: <OPTIONAL: input_boolean used to switch air/scavenging on/off on your first AC>
      target_temp: <OPTIONAL: input_number used to set the temperature of your first AC>
      auto_xfan: <OPTIONAL: boolean (true/false); this feature will always turn on xFan in cool and dry mode to avoid mold & rust created from potential water buildup in the AC>
      auto_light: <OPTIONAL: boolean (true/false); this feature will always turn light on when power on and turn light light off when power off automatically>
      horizontal_swing: <OPTIONAL: boolean (true/false); this feature will enable horizontal swing on devices that have this functionality. This feature replaces presets in the UI
      anti_direct_blow: <OPTIONAL: input_boolean used to switch Anti Direct Blow feature on devices devices that have this functionality. Until next release, it should be set only when device   has this feature. For example: input_boolean.first_ac_anti_direct_blow>
      max_online_attempts: <OPTIONAL: integer specifying number of attempts to connect to the device before it goes into the unavailable state
      disable_available_check: <OPTIONAL: boolean (true/false); if set to true device is always available in Home Assistant, useful for automation, device never goes into an unavailable state
    
    - platform: gree
      name: Second AC
      host: <ip of your second AC>
      port: 7000
      mac: '<mac address of your second AC. NOTE: Format can be XX:XX:XX:XX:XX:XX or XX-XX-XX-XX-XX-XX depending on your model>'
      target_temp_step: 1
  3. In your configuration.yaml add the following:

    climate: !include climate.yaml
  4. OPTIONAL: Add info logging to this component (to see if/how it works)

    logger:
      default: error
      logs:
        custom_components.gree: debug
        custom_components.gree.climate: debug
  5. OPTIONAL: Provide encryption key if you have it or feel like extracting it.

    One way is to pull the sqlite db from android device like described here:

    https://stackoverflow.com/questions/9997976/android-pulling-sqlite-database-android-device

    adb backup -f ~/backup.ab -noapk com.gree.ewpesmart
    dd if=data.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf -
    sqlite3 data.ab 'select privateKey from db_device_20170503;' # but table name can differ a little bit.
    

    Write it down in climate.yaml encryption_key: <key>.

  6. OPTIONAL: Provide the uid parameter (can be sniffed) NOTE: This is not needed for all devices

  7. OPTIONAL: Provice input_boolean's to set lights, xfan, sleep and powersave mode on/off.

Optional Features

NOTE: Your AC has to support these features for it to be used.

     temp_sensor: This attaches an external temperature sensor to your AC. Gree unfortunately doesnt support a "current temperature" on its own.
     lights: This switches the backlight of the AC Display on or off
     xfan: This dries the AC after being used. This is to avoid nasty smells from usage.
     health: The air goes through a filter to "clean the air".
     sleep: This will enable a comfortable sleep mode. The AC won't make a lot of noise using this.
     powersave: It seems this mode should be an efficient way of approximately reaching the desired temperature (temperatures will vary using this).
     eightdegheat:  This feature maintains the room temperature steadily at 8°C and prevents the room from freezing by activating the heating operation automatically when nobody is at home over a longer period during severe winter
     air: This feature will extract air from the room. This is to remove hot air or nasty smells from the room.
     target_temp: You can use a custom input_number entity as the input of the set temperature for this AC. Define the input_number entity in this parameter. This is useful if you want to use dashboards with custom frontend components.
     auto_xfan: This feature will always turn on xFan in cool and dry mode to avoid mold & rust created from potential water buildup in the AC
     auto_light: This feature will always turn light on when power on and turn light light off when power off automatically

homeassistant-greeclimatecomponent's People

Contributors

ardeus-ua avatar azuwis avatar ivanovd avatar janmashat avatar knackrack615 avatar lenisko avatar orbin avatar pltorrent avatar puzz3d avatar robhofmann avatar sandersjds avatar svlsbrg avatar szerencl avatar thetimewalker avatar tomaszduda23 avatar toughvj avatar vampywiz17 avatar wjketting avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homeassistant-greeclimatecomponent's Issues

"socket.timeout: timed out" on home assistant 0.96

Hi,

I will appreciate your help to understand why it's not working.

This is climate.yaml:

  • platform: gree
    name: Tadiran
    host: 192.168.1.132
    port: 7000
    mac: 'xx:xx:xx:xx:xx:xx' //removed it
    target_temp_step: 1

home_assistant.log:
2019-07-18 15:52:31 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform 2019-07-18 15:52:31 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass 2019-07-18 15:52:31 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device 2019-07-18 15:52:31 INFO (MainThread) [custom_components.gree.climate] Retrieving HVAC encryption key 2019-07-18 15:52:31 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.1.132, 7000, 10, {"cid": "app","i": 1,"pack": "<REMOVED_IT>","t":"pack","tcid":"341513bbf39d","uid": 0}) 2019-07-18 15:52:43 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform gree Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform SLOW_SETUP_MAX_WAIT) File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for return fut.result() File "/usr/lib/python3.7/asyncio/coroutines.py", line 120, in coro res = func(*args, **kw) File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 112, 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, hvac_modes, fan_modes, swing_modes, encryption_key, uid) File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 155, in __init__ self._encryption_key = self.GetDeviceKey().encode("utf8") File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 227, in GetDeviceKey return self.FetchResult(cipher, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['key'] File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 210, in FetchResult data, addr = clientSock.recvfrom(64000) socket.timeout: timed out

Many thanks!

"Error while setting up platform gree" (Home Assistant on Raspbian)

Hi, and thank you for your work on this component. I was hoping you could help shed some light on why the set up for the component may be failing:

2019-05-15 07:15:28 INFO (MainThread) [custom_components.gree.climate] Fetching Device Encryption Key
2019-05-15 07:15:28 INFO (MainThread) [custom_components.gree.climate] GetDeviceKey()
2019-05-15 07:15:28 INFO (MainThread) [custom_components.gree.climate] Creating encryptor with Device Key
2019-05-15 07:15:28 INFO (MainThread) [custom_components.gree.climate] Encrypting Pack
2019-05-15 07:15:28 INFO (MainThread) [custom_components.gree.climate] Creating JSON
2019-05-15 07:15:28 INFO (MainThread) [custom_components.gree.climate] Fetching & Returning result
2019-05-15 07:15:28 INFO (MainThread) [custom_components.gree.climate] FetchResult(<192.168.86.140>, 7000, {"cid": "app","i": 1,"pack": "nCSrGV4L+TyuYwrmhZH6mkkLd5OEPeolO6mwrilXgbWj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"f4911e69d75c","uid": 0})
2019-05-15 07:15:28 INFO (MainThread) [custom_components.gree.climate] Creating sock
2019-05-15 07:15:28 INFO (MainThread) [custom_components.gree.climate] Sending over UDP
2019-05-15 07:15:30 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform gree
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/lib/python3.5/asyncio/coroutines.py", line 210, in coro
    res = func(*args, **kw)
  File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 113, in async_setup_platform
    GreeClimate(hass, name, ip_addr, port, mac_addr, min_temp, max_temp, target_temp, target_temp_step, temp_sensor_entity_id, operation_list, fan_list, swing_updn_mode_list, default_operation, default_fan_mode, default_operation_from_idle, default_swing_updn_mode, encryption_key, uid)
  File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 152, in __init__
    self._encryption_key = self.GetDeviceKey().encode("utf8")
  File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 220, in GetDeviceKey
    return self.FetchResult(cipher, self._ip_addr, self._port, jsonPayloadToSend)['key']
  File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 188, in FetchResult
    clientSock.sendto(bytes(json, "utf-8"), (ip_addr, port))
socket.gaierror: [Errno -2] Name or service not known
2019-05-15 07:15:41 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UPnP/IGD for upnp
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/async_upnp_client/aiohttp.py", line 103, in async_do_http_request
    async with self._session.request(method, url, headers=headers, data=body) as response:
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/client.py", line 1005, in __aenter__
    self._resp = await self._coro
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/client.py", line 476, in _request
    timeout=real_timeout
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py", line 522, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py", line 854, in _create_connection
    req, traces, timeout)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py", line 974, in _create_direct_connection
    req=req, client_error=client_error)
  File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/connector.py", line 924, in _wrap_create_connection
    await self._loop.create_connection(*args, **kwargs))
  File "/usr/lib/python3.5/asyncio/base_events.py", line 729, in create_connection
    yield from tasks.wait(fs, loop=self)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 355, in wait
    return (yield from _wait(fs, timeout, return_when, loop))
  File "/usr/lib/python3.5/asyncio/tasks.py", line 438, in _wait
    yield from waiter
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
concurrent.futures._base.CancelledError

I'm not sure what the problem might be. I did not specify an encryption key in the .yaml file though. Could this be the problem? Unfortunately I do not have an Android device to recover the SQLite db. Are there any alternative solutions for iOS? Many thanks.

Unable to start HA

When I try to use your custom component I am facing issue that HA does not start. All I get is:
Oct 18 21:05:59 raspberrypi hass[31437]: 2018-10-18 21:05:59 INFO (MainThread) [custom_components.climate.gree] Fetching Device Encryption Key
Oct 18 21:05:59 raspberrypi hass[31437]: 2018-10-18 21:05:59 INFO (MainThread) [custom_components.climate.gree] GetDeviceKey()
Oct 18 21:05:59 raspberrypi hass[31437]: 2018-10-18 21:05:59 INFO (MainThread) [custom_components.climate.gree] Creating encryptor with Device Key
Oct 18 21:05:59 raspberrypi hass[31437]: 2018-10-18 21:05:59 INFO (MainThread) [custom_components.climate.gree] Encrypting Pack
Oct 18 21:05:59 raspberrypi hass[31437]: 2018-10-18 21:05:59 INFO (MainThread) [custom_components.climate.gree] Creating JSON
Oct 18 21:05:59 raspberrypi hass[31437]: 2018-10-18 21:05:59 INFO (MainThread) [custom_components.climate.gree] Fetching & Returning result
Oct 18 21:05:59 raspberrypi hass[31437]: 2018-10-18 21:05:59 INFO (MainThread) [custom_components.climate.gree] FetchResult(192.168.0.119, 7000, {"cid": "a..."uid": 0})
Oct 18 21:05:59 raspberrypi hass[31437]: 2018-10-18 21:05:59 INFO (MainThread) [custom_components.climate.gree] Creating sock
Oct 18 21:05:59 raspberrypi hass[31437]: 2018-10-18 21:05:59 INFO (MainThread) [custom_components.climate.gree] Sending over UDP
Oct 18 21:05:59 raspberrypi hass[31437]: 2018-10-18 21:05:59 INFO (MainThread) [custom_components.climate.gree] Receiving over UDP

And HA does not start.
Do you have any idea what can cause this?

Operation Mode

Hi.
While in other climate components the operation mode list the power state (on/off), in this component we get the operation state (cool/heat/etc).

The result is that the component cannot powered on/off from the lovelace thermostat card.

example from other climate component (detailes from entity attributes):

fan_list: low,mid,high,auto
operation_mode: off
operation_list: off,cool,heat

and example from gree component:

fan_list: auto,Low,Medium-Low,Medium,Medium-High,High,Turbo,Quiet
operation_mode: cool
operation_list: auto,cool,dry,fan_only,heat

Thanks!

User manual

Hi Rob, thank for you efforts. Do you mind adding simple manual how to connect ac with your plugin? Thank you

invalid configuration

As a relative newb related to ha and custom components, after installing arthurkrupa's gree mqtt bridge I was inquisitive to try this greeclimatecomponent.

Installed the custom component in custom_components/climate folder.
Followed the steps 1, 2 and 3 as described in the component installation remarks but when validating the configuration I got below mentioned error message.
afbeelding
Any idea what I'm doing wrong?

To be complete, here's a view of the folders and files of my system:
afbeelding
Climate.yaml:
afbeelding
Also tried entering the platform directly in configuration.yaml (same error message):
afbeelding

I-Feel function implementation

Hello. Is it possible to implement I-Feel function to feed HVAC with temperature value from external sensor?
Thank you.

Connection Timedout

Describe the bug
Sporadically the connection is timed out between the HAS instance and GREE AC. Two Comfort X AC are placed in the flat and got a static IP address. The issue causes service outage of gree component.

2019-05-27 21:19:32 INFO (MainThread) [custom_components.gree.climate] name(): Livingroom AC
2019-05-27 21:19:32 INFO (MainThread) [custom_components.gree.climate] supported_features(): 4801
2019-05-27 21:19:32 INFO (SyncWorker_3) [custom_components.gree.climate] update()
2019-05-27 21:19:32 INFO (SyncWorker_3) [custom_components.gree.climate] Starting SyncState
2019-05-27 21:19:32 INFO (SyncWorker_3) [custom_components.gree.climate] Fetching(192.168.0.16, 7000, 10, {"cid":"app","i":0,"pack":"6LzEUcYr4hmHnV32fNv240aHdxLcp/fFBt1k/8Dd1A1Rgs/OVhL5EZpGV5E2n9oMtx+8uHMk0/LWP5FJI7BOr4is+KDNIIZzaKdd+Ima
ZLn39YlGV8lLhXDHuqGfRzxEb3B5+WoAEQNRGQPVlmeOQV4Ui87oc6fUJTeHeiqk15bngeY+mzwTR1+Hy71jJ1VWk3jS1sFwrRlMAT1JRXbI3p7SBcso7HnAurv41nE9slu/i1EHocLv81Z1Z5w6bbSW8yDGX0AJvocSvBdZ+daJETTKhu3d6AP3rRPgHt26hLU=","t":"pack","tcid":"f4911e66da91","uid":
0})
2019-05-27 21:19:41 INFO (SyncWorker_10) [root] Sending control command: KEY
2019-05-27 21:19:42 WARNING (MainThread) [homeassistant.helpers.entity] Update of climate.bedroom_ac is taking over 10 seconds
2019-05-27 21:19:42 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.bedroom_ac fails
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 377, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/gree/climate.py", line 548, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 365, in SyncState
    currentValues = self.GreeGetValues(optionsToFetch)
  File "/config/custom_components/gree/climate.py", line 217, in GreeGetValues
    return self.FetchResult(self.CIPHER, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['dat']
  File "/config/custom_components/gree/climate.py", line 196, in FetchResult
    data, addr = clientSock.recvfrom(64000)
socket.timeout: timed out

To Reproduce
Most of the time it can be reproducible when HAS is restarted or wait enough time.

Configuration
climate:

  • platform: gree
    name: Livingroom AC
    host: 192.168.0.15
    port: 7000
    mac: F4:91:1E:66:8C:80
    target_temp_step: 1
  • platform: gree
    name: Bedroom AC
    host: 192.168.0.16
    port: 7000
    mac: F4:91:1E:66:DA:91
    target_temp_step: 1

Expected behavior
It is expected to prevent connection timeout.

Screenshots
If applicable, add screenshots to help explain your problem.

Platform:

  • OS: HAS in a docker
  • Browser: chrome
  • Version: saw from 0.91.0 - 0.93.2

Climate.py error

Hey.
After install i get the following error (hassbian 0.92.2, RPI3):

Update for climate.4th_room_ac failsTraceback (most recent call last): File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 220, in async_update_ha_state await self.async_device_update() File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 377, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/lib/python3.5/asyncio/futures.py", line 380, in iter yield self # This tells Task to wait for completion. File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup future.result() File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result raise self._exception File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 408, in update self.SyncState() File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 326, in SyncState currentValues = self.GreeGetValues(optionsToFetch) File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 224, in GreeGetValues return self.FetchResult(self.CIPHER, self._ip_addr, self._port, jsonPayloadToSend)['dat'] File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 192, in FetchResult receivedJson = simplejson.loads(data) File "/usr/lib/python3.5/json/init.py", line 312, in loads s.class.name)) TypeError: the JSON object must be str, not 'bytes'

Thank you for the amazing effort!

AC Beep ON/OFF

Is your feature request related to a problem? Please describe.
It would be really great to have an option to turn ON/OFF beep we hear after sending a command.

Describe the solution you'd like
Callable service with payload to turn ON/OFF beep.

No possible disable sleep

Describe the bug
I added the option for sleep, with an input Boolean
When I set the button to true, the sleep is enabled on the final device.
If I make the button change status, the sleep is not disabled on the device

my yaml

  • platform: gree
    name: Condizionatore camera
    host: 192.168.x.x
    port: 7000
    mac: '123456789'
    target_temp_step: 1
    sleep: input_boolean.bedroom_ac_sleep

Platform:

  • OS: Hassbian
  • Browser: Chrome
  • Version: 0.10x

toggle on off command

When I integrate the code to Home assistant the options to turn on and off are:

  1. on - need to choose auto,cool,dry,fan_only,heat.
    2.off - need to choose off.

I would like only to toggle between on and off. while on is the last state the AC was on.

The reason I want it, is to configure on a smart switch one button that each press will togle the AC to ON and OFF. that way I can turn ON/OFF in a pres of a button like a light. using an automation similar to light see below.

  • alias: 'Toggle Philips light on single press from sonoff6 2CH'
    initial_state: 'on'
    trigger:
    platform: state
    entity_id: switch.Kitchen_corner_SW_Kids ----------> this would be the smart switch button
    ! # to: ANYSTATE WAS CHANGE (ON/OFF)
    action:
    service: switch.toggle ----------> this would be the AC
    entity_id: switch.Kids ----------> this would be the AC

Hope you can help.

Thank you.

how to add the temperature sensor

i have a temperature sensor by broadlink and want to appear it into the climate temperature graph;
but i put the temperature_sensor command into the py file.....
error ........

could U add the Temp Sensor into the Py?

Encryption key

Hi,

What is the simples way to get my climate's encryption key? I'm very beginner in programming...
Or if I reset the wifi in my Gree AC, how can I add it to Home Assistant?

Please help me :'(

Recovering encryption key

I follow the steps of the Readme, there is a little error in the first command creates the backup.ad file, but in the second command calls to "data.ad", I think it is because it the exact line than in the referred URL.

but the problem I fin on the last line, that's what it say:

Last login: Wed Jun 17 14:37:46 on ttys000
Javiers-iMac:~ javier$ export PATH=~/Library/Android/sdk/tools:$PATH
Javiers-iMac:~ javier$ export PATH=~/Library/Android/sdk/platform-tools:$PATH
Javiers-iMac:~ javier$ adb backup -f ~/gree.ab -noapk com.gree.ewpesmart
WARNING: adb backup is deprecated and may be removed in a future release
Now unlock your device and confirm the backup operation...
Javiers-iMac:~ javier$ dd if=gree.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.write(zlib.decompress(sys.stdin.read()))" | tar -xvf -
23+0 records in
23+0 records out
23 bytes transferred in 0.045295 secs (508 bytes/sec)
Javiers-iMac:~ javier$ sqlite3 gree.ab 'select privateKey from db_device_20170503
> 
> ls
> 

I also see that the .ad file created on the first command it is only 47bytes

Update for climate.ac fails Traceback

Hello,

a lot of this error in my HA log:

2020-02-26 22:37:56 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.ac fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/gree/climate.py", line 627, in update self.SyncState() File "/config/custom_components/gree/climate.py", line 410, in SyncState currentValues = self.GreeGetValues(optionsToFetch) File "/config/custom_components/gree/climate.py", line 241, in GreeGetValues return self.FetchResult(self.CIPHER, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['dat'] File "/config/custom_components/gree/climate.py", line 220, in FetchResult data, addr = clientSock.recvfrom(64000)

Home Assistant 0.105.5 (docker)
Gree A/C: 2.1.1
HACS: 0.21.6
AC model: GREE GWH18QD

automation script for HA to set climate.set_hvac_mode

Hi,

I need to know how to write the script, since it is requires a mode parameter I don't know how to write it.

what I use the following script it semi works . (do nit require parameter) using climate or home asistent ON service (turns the ac to heat mode).

  • alias: 'AC kids on'
    initial_state: 'on'
    trigger:
    platform: state
    entity_id: switch.Hall_front_SW1

    to: ANYSTATE WAS CHANGE (ON/OFF)

    action:
    service: homeassistant.turn_on
    entity_id: climate.first_ac

Thank you,
and thank you for your amazing work.

Lack of exception handling during a socket timeout

Is your feature request related to a problem? Please describe.
I'm always frustrated when I see a traceback upon HA startup. This happens every time I restart my HA.

Describe the solution you'd like
Putting a clientSock.recvFrom(64000) inside a try except and log a warning line instead of full traceback.

Describe alternatives you've considered
Not logging anything at all, yet handle the exception.

Additional context
Full traceback goes here:

2020-02-05 21:05:39 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 422, in _async_add_entity
    await entity.async_added_to_hass()
  File "/usr/lib/python3.7/asyncio/coroutines.py", line 120, in coro
    res = func(*args, **kw)
  File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 709, in async_added_to_hass
    self.SyncState()
  File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 382, in SyncState
    currentValues = self.GreeGetValues(optionsToFetch)
  File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 231, in GreeGetValues
    return self.FetchResult(self.CIPHER, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['dat']
  File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 210, in FetchResult
    data, addr = clientSock.recvfrom(64000)
socket.timeout: timed out

Unable to change the State of my GREE A/C

Describe the bug
I am retrieving the states of my GREE airconditioning unit, but I am unable to change those states. For example I cannot change the Temperature, the Operation etc. If I change those states from GREE remote control, then the HA card is refreshed showing the correct states.

Configuration

- platform: gree
  name: "Test AC"
  host: 192.168.10.xxx
  port: 7000
  mac: xx-xx-xx-xx-xx-xx
  target_temp_step: 1
  encryption_key: "xxxxxxxxxxxxx"

Expected behavior
Expecting to be able to control the states of my AC through HA

Platform:

  • OS: HomeAssistant (Docker)
  • Browser Chrome
  • Version H.A. 0.101.2

Additional context
I have enabled the debug logger and I am receiving the following:

2019-11-11 12:30:15 INFO (SyncWorker_6) [custom_components.gree.climate] Start sending state to HVAC
2019-11-11 12:30:19 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 1261, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    self._platforms.values(), func, call, service_name, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 348, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 370, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 415, in async_set_hvac_mode
    await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/gree/climate.py", line 703, in set_hvac_mode
    self.SyncState({'Mod': self._hvac_modes.index(hvac_mode), 'Pow': 1})
  File "/config/custom_components/gree/climate.py", line 398, in SyncState
    self.SendStateToAc(self._timeout)
  File "/config/custom_components/gree/climate.py", line 256, in SendStateToAc
    data, addr = clientSock.recvfrom(64000)
socket.timeout: timed out

Is the AC operating?

I can't detect if my AC were operating.
Powered on but it is blowing heat or just standing by?

I'd like to start a fan when AC start working.
I'd like to stop a fan 10 minutes after AC stop working.

Readme.md update

Hello! Today I have found your custom component and it works well with my Gree GWH18UC air conditioner, thank you!

I had a lot of trouble with wifi connection and I think it would be helpful if you would add this to readme file:

If you can't provide the encryption key (because you don't have any android device), you can use the component without it in the following way:

  1. Reset your AC's wifi: Press "Mode" + "Wifi" buttons together for 5 sec
  2. Connect your PC to AC's wifi, default password is: 12345678
  3. Use the following command to connect your AC to your Wifi network: echo -n "{\"psw\": \"<YOUR_WIFI_PASSWORD>\",\"ssid\": \"<YOUR_WIFI_SSID>\",\"t\": \"wlan\"}" | nc -cu 192.168.1.1 7000
  4. Now you can use the component without defining encryption key in config file

Also I think there is a way to obtain encryption key on iOS device, but this is UNTESTED:

You can download GREE.sqlite database file from your phone/tablet with iExplorer application (Windows/Mac) and you can see a deviceTable table in the database if you view the database file with DB Browser for SQLite application. This table has a publicKey column, maybe if you put this in the configuration file as encryption key, then it will work too. SQL command: `select publicKey from deviceTable;

cannot import name 'ClimateEntity' from 'homeassistant.components.climate - HA0.109.6

At new version of HA exactli 0.109.6
Error in log at loading custom component.
Platform error climate.gree - cannot import name 'ClimateEntity' from 'homeassistant.components.climate' (/usr/src/homeassistant/homeassistant/components/climate/init.py)

Configuration

  • platform: gree
    name: First AC
    host: 192.168.50.114
    port: 7000
    mac: 'F4:91:1E:D0:C0:F2'
    target_temp_step: 1
    encryption_key: xxxxxxxxxx
    uid: f4911ed0c0f2
    temp_sensor: sensor.owm_temperature

Platform:

  • OS: HASSIO
  • Browser Chrome
  • Version 0.109.6

Full integration with Lovelance Thermostat card

Hello guys. Is there a way to control input_booleans within Lovelance thermostat card? I only see modes and off\on button. But I have input_bolleans (health, economy mode, fan) in my config. Also there is no swing control.

Unable to control AC

I am unable to change any settings of the AC and/or turn it on or off, even though according to the logs, Home Assistant communicates with the device correctly and the AC control panel is avaliable in the lovelace interface.
The log says it's setting values to the AC, but that doesn't happen and no error is reported.

my config is as follows:

  • platform: gree
    name: Pracovna
    host: 172.16.0.101
    port: 7000
    mac: 'xx:xx:xx:xx:xx:xx'
    uid: 0
    target_temp_step: 1
    temp_sensor: sensor.garaz_teplota
    lights: input_boolean.ac_pracovna_display

I am running HassOS 4.6 in virtualbox, Home Assistant version 0.110.3

However, I am able to control the AC with my own script also based on https://github.com/tomikaa87/gree-remote and it works perfectly, I can control everything on the AC so it's strange that this HA integration doesn't work.

Set Horizontal Swing

Is your feature request related to a problem? Please describe.
Ability to set horizontal swing would be great.

Describe the solution you'd like
As far as I know, base climate doesn't have set_horizontal_swing_mode service.
Register new handler within component should be possible?

Describe alternatives you've considered
Add set_horizontal_swing_mode to hass climate base module, and support it within component.

Additional context
Constants: here - not sure if they are same for all models though.
My model: ASH-13BIF2

Can't setup gree component

Describe the bug
Homeassistant can't setup gree component

Configuration

  • platform: gree
    name: C&H AC1
    host: 192.168.1.182
    port: 7000
    mac: 98:29:A6:F8:74:B7
    #min_temp: 16
    #max_temp: 30
    #target_temp: 21
    target_temp_step: 1

  • platform: gree
    name: C&H AC2
    host: 192.168.1.192
    port: 7000
    mac: F4:91:1E:64:2E:5C
    #min_temp: 16
    #max_temp: 30
    #target_temp: 21
    target_temp_step: 1

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Retrieving HVAC encryption key
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.1.192, 7000, 10, {"cid": "app","i": 1,"pack": "EmFry4kFAsXrxMJi4m1xeW7GLOpEAXIjgdobYmkZL+aj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"f4911e642e5c","uid": 0})
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Fetched device encrytion key: b'Vw1Yz4Bc7Ef0Hi3K'
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Retrieving HVAC encryption key
2019-06-14 22:37:12 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.1.182, 7000, 10, {"cid": "app","i": 1,"pack": "ypbAvOtLlYGIvQEo3/f7IP6adwz+SiCj34Ff1CGDwsaj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"9829a6f874b7","uid": 0})
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] name(): C&H AC2
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Gree climate device added to hass()
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Starting SyncState
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.1.192, 7000, 10, {"cid":"app","i":0,"pack":"88M0XfZ8V7j4QjzeOg8L+xCBiLhEg0plrijJF27A62Ny30vdXSnnxfrckfNdsNEMok0VZ4p9um2JKXypDzaKhZq+tAIIvoKEt7gK0t3/Gzjj8Mda+7a6FfFdkpn8hKHu9gCbJK0LNpIA+lwXyaN/A791vrI/WueEWeFTxcr2G+z5hO9JBUdzgxvBjWyRrjauL1b7YgX+jIPFiHJzB+3nPyXb+PWdvmw3T0yhMPxNUYVx5hSdfho/fWK2ExiagpoO/txeTGl2OcLqMIr4eh4Mnta+Meb9tT/6iREiUJRFxrA=","t":"pack","tcid":"f4911e642e5c","uid":0})
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting acOptions with retrieved HVAC values
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting Pow: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting Mod: 1
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting SetTem: 23
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting WdSpd: 1
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting Air: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting Blo: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting Health: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting SwhSlp: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting Lig: 1
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting SwingLfRig: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting SwUpDn: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting Quiet: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting Tur: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting StHt: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting TemUn: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting HeatCoolType: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting TemRec: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Setting SvSt: 0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Done setting acOptions
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] HA target temp set according to HVAC state to: 23
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] HA lights option set according to HVAC state to: on
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] HA xfan option set according to HVAC state to: off
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] HA powersave option set according to HVAC state to: off
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] HA sleep option set according to HVAC state to: off
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] HA operation mode set according to HVAC state to: off
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] HA On/Off set according to HVAC state to: off
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] HA swing mode set according to HVAC state to: Default
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] HA fan mode set according to HVAC state to: Low
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] Finished SyncState
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] state(): off
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] current_temperature(): None
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] target_temperature(): 23
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] supported_features(): 4801
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] current_fan_mode(): Low
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] current_operation(): off
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] operation_list(): ['auto', 'cool', 'dry', 'fan_only', 'heat', 'off']
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] operation_list(): ['auto', 'cool', 'dry', 'fan_only', 'heat', 'off']
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] current_swing_mode(): Default
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] swing_list(): ['Default', 'Swing in full range', 'Fixed in the upmost position', 'Fixed in the middle-up position', 'Fixed in the middle position', 'Fixed in the middle-low position', 'Fixed in the lowest position', 'Swing in the downmost region', 'Swing in the middle-low region', 'Swing in the middle region', 'Swing in the middle-up region', 'Swing in the upmost region']
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] swing_list(): ['Default', 'Swing in full range', 'Fixed in the upmost position', 'Fixed in the middle-up position', 'Fixed in the middle position', 'Fixed in the middle-low position', 'Fixed in the lowest position', 'Swing in the downmost region', 'Swing in the middle-low region', 'Swing in the middle region', 'Swing in the middle-up region', 'Swing in the upmost region']
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] name(): C&H AC2
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] supported_features(): 4801
2019-06-14 22:37:22 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform gree
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/asyncio/coroutines.py", line 120, in coro
res = func(*args, **kw)
File "/config/custom_components/gree/climate.py", line 104, 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, powersave_entity_id, sleep_entity_id, operation_mode_list, fan_mode_list, swing_mode_list, encryption_key, uid)
File "/config/custom_components/gree/climate.py", line 146, in init
self._encryption_key = self.GetDeviceKey().encode("utf8")
File "/config/custom_components/gree/climate.py", line 213, in GetDeviceKey
return self.FetchResult(cipher, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['key']
File "/config/custom_components/gree/climate.py", line 196, in FetchResult
data, addr = clientSock.recvfrom(64000)
socket.timeout: timed out
2019-06-14 22:37:22 INFO (MainThread) [custom_components.gree.climate] should_poll()

Platform:

  • OS: Hassio vmdk
  • Chrome
  • 0.94.1

Additional context
Hi there, would be very appreciate if you take a look into log above, not so much info regarding this component. Seems it starts connecting but then fails for some reason. Thanks in advance

Please add support for 8C heating, multiple devices in log

Hello,

Could you add support of StHt (8 Celsius heating)?
I see in the logs that it is recognized but I can't see how to handle it via switches or inputbooleans.

Could you add an ID to log lines?
I have two AC, I can't recognize now which lines are related to AC1 and which are related to AC2

$ grep "Setting StHt" *.log
2019-12-20 15:56:24 INFO (MainThread) [custom_components.gree.climate] Setting StHt: 1
2019-12-20 15:56:24 INFO (MainThread) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 15:57:26 INFO (SyncWorker_4) [custom_components.gree.climate] Setting StHt: 1
2019-12-20 15:57:26 INFO (SyncWorker_0) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 15:58:27 INFO (SyncWorker_4) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 15:58:27 INFO (SyncWorker_0) [custom_components.gree.climate] Setting StHt: 1
2019-12-20 15:59:28 INFO (SyncWorker_4) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 15:59:28 INFO (SyncWorker_0) [custom_components.gree.climate] Setting StHt: 1
2019-12-20 16:00:00 INFO (SyncWorker_1) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 16:00:00 INFO (SyncWorker_2) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 16:00:29 INFO (SyncWorker_0) [custom_components.gree.climate] Setting StHt: 1
2019-12-20 16:00:29 INFO (SyncWorker_1) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 16:01:29 INFO (SyncWorker_2) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 16:01:29 INFO (SyncWorker_1) [custom_components.gree.climate] Setting StHt: 1
2019-12-20 16:02:30 INFO (SyncWorker_0) [custom_components.gree.climate] Setting StHt: 1
2019-12-20 16:02:30 INFO (SyncWorker_1) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 16:03:31 INFO (SyncWorker_4) [custom_components.gree.climate] Setting StHt: 1
2019-12-20 16:03:31 INFO (SyncWorker_0) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 16:04:32 INFO (SyncWorker_3) [custom_components.gree.climate] Setting StHt: 1
2019-12-20 16:04:32 INFO (SyncWorker_0) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 16:05:33 INFO (SyncWorker_1) [custom_components.gree.climate] Setting StHt: 0
2019-12-20 16:05:33 INFO (SyncWorker_3) [custom_components.gree.climate] Setting StHt: 1

Help for call service in raw config ui trought cards

Hi pls help,
i need to call service swing,mode,fan etc trought button, i make this cards but not work:

CARD 1
type: 'custom:button-card'
icon: 'mdi:air-conditioner'
color: 'rgb(28, 128, 199)'
tap_action:
action: call-service
service: climate.set_swing_mode
entity_id: climate.condizionatore
data: 1
swing_mode: 1
name: Swing
show_icon: true
show_name: true

Give me this error:
Fallita chiamata a servizio climate/set_swing_mode . required key not provided @ data['swing_mode']

CARD2 NO WORK
type: 'custom:button-card'
icon: 'mdi:air-conditioner'
color: 'rgb(28, 128, 199)'
tap_action:
action: null
service: climate.set_temperature
data: null
entity_id: hvac_mode
temperature: 20
operation_mode: cool

TKs

Integrations, config_flow.py

Is your feature request related to a problem? Please describe.
Please make this component serve like integration for the Home Assistant setup

Describe the solution you'd like
config_flow.py with autodiscovery based on https://github.com/tomikaa87/gree-remote#device-discovery-scanning

Describe alternatives you've considered
The manual procedure with user input of MAC and/or IP address

Additional context
https://developers.home-assistant.io/docs/en/config_entries_config_flow_handler.html
If found multiple AC's through the discovery defining the name of it can be made through turning all indicators and the display on the unit on or off or through suggesting with the decoded friendly name of the unit from the discovery process

Localization strings

Hi, is this possible to replace state attributes to localized strings, so it will appear with translated strings? Thank you

Can not find climate platform

I run this addon on Hassio but i always get response can not find platform climate

When i look at traceback i get this response

Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/loader.py", line 92, in get_component module = importlib.import_module(path) File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "&lt;frozen importlib._bootstrap&gt;", line 994, in _gcd_import File "&lt;frozen importlib._bootstrap&gt;", line 971, in _find_and_load File "&lt;frozen importlib._bootstrap&gt;", line 955, in _find_and_load_unlocked File "&lt;frozen importlib._bootstrap&gt;", line 665, in _load_unlocked File "&lt;frozen importlib._bootstrap_external&gt;", line 678, in exec_module File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed File "/config/custom_components/climate/gree.py", line 21, in &lt;module&gt; from homeassistant.helpers.restore_state import async_get_last_state ImportError: cannot import name 'async_get_last_state'

Health option

I have setup buttons on my dashboard, for Light, Health, Sleep. The Light and Sleep work fine,however Health does not, it returns to it's previous setting after a few seconds. It doesn't matter if the setting is previously on/off it can't be changed using the add on.

Fan in Quiet Mode

Hi,
The problem remains.
(#33)

I turned on debug logging.
When I open the HVAC from HA, it goes to low. I suppose that it the gree component defaults to low.

Then I choose Quiet and the fan goes louder!
It is very strange behaviour.
Below the debug logs the moment I choose quiet:

2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] set_fan_mode(): Quiet
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Enabling quiet mode
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Starting SyncState
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Fetching(................)
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting acOptions with retrieved HVAC values
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting Pow: 1
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting Mod: 1
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting SetTem: 25
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting WdSpd: 1
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting Air: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting Blo: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting Health: 1
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting SwhSlp: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting Lig: 1
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting SwingLfRig: 4
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting SwUpDn: 2
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting Quiet: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting Tur: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting StHt: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting TemUn: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting HeatCoolType: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting TemRec: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Setting SvSt: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Done setting acOptions
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Overwriting acOptions with new settings
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Overwriting Tur: 0
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Overwriting Quiet: 1
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Done overwriting acOptions
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Start sending state to HVAC
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Done sending state to HVAC: {'t': 'res', 'mac': '.............', 'r': 200, 'opt': ['Pow', 'Mod', 'SetTem', 'WdSpd', 'Air', 'Blo', 'Health', 'SwhSlp', 'Lig', 'SwingLfRig', 'SwUpDn', 'Quiet', 'Tur', 'StHt', 'TemUn', 'HeatCoolType', 'TemRec', 'SvSt'], 'p': [1, 1, 25, 1, 0, 0, 1, 0, 1, 4, 2, 1, 0, 0, 0, 0, 0, 0], 'val': [1, 1, 25, 1, 0, 0, 1, 0, 1, 4, 2, 1, 0, 0, 0, 0, 0, 0]}
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] HA target temp set according to HVAC state to: 25
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] HA lights option set according to HVAC state to: on
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] HA health option set according to HVAC state to: on
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] HA health option set according to HVAC state to: on
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] HA powersave option set according to HVAC state to: off
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] HA sleep option set according to HVAC state to: off
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] HA operation mode set according to HVAC state to: cool
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] HA swing mode set according to HVAC state to: Fixed in the upmost position
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] HA fan mode set according to HVAC state to: Quiet
2019-07-30 22:37:23 INFO (SyncWorker_2) [custom_components.gree.climate] Finished SyncState
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] hvac_mode(): cool
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] supported_features(): 41
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): ['auto', 'cool', 'dry', 'fan_only', 'heat', 'off']
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] current_temperature(): None
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] target_temperature(): 25
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] fan_mode(): Quiet
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'low', 'Medium-Low', 'medium', 'Medium-High', 'high', 'Turbo', 'Quiet']
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] swing_mode(): Fixed in the upmost position
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] swing_modes(): ['Default', 'Swing in full range', 'Fixed in the upmost position', 'Fixed in the middle-up position', 'Fixed in the middle position', 'Fixed in the middle-low position', 'Fixed in the lowest position', 'Swing in the downmost region', 'Swing in the middle-low region', 'Swing in the middle region', 'Swing in the middle-up region', 'Swing in the upmost region']
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] name(): Hall AC
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] supported_features(): 41
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] should_poll()
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] update()
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Starting SyncState
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Fetching(..............)
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting acOptions with retrieved HVAC values
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting Pow: 1
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting Mod: 1
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting SetTem: 25
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting WdSpd: 1
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting Air: 0
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting Blo: 0
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting Health: 1
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting SwhSlp: 0
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting Lig: 1
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting SwingLfRig: 4
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting SwUpDn: 2
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting Quiet: 1
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting Tur: 0
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting StHt: 0
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting TemUn: 0
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting HeatCoolType: 0
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting TemRec: 0
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Setting SvSt: 0
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Done setting acOptions
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] HA target temp set according to HVAC state to: 25
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] HA lights option set according to HVAC state to: on
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] HA health option set according to HVAC state to: on
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] HA health option set according to HVAC state to: on
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] HA powersave option set according to HVAC state to: off
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] HA sleep option set according to HVAC state to: off
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] HA operation mode set according to HVAC state to: cool
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] HA swing mode set according to HVAC state to: Fixed in the upmost position
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] HA fan mode set according to HVAC state to: Quiet
2019-07-30 22:37:23 INFO (SyncWorker_4) [custom_components.gree.climate] Finished SyncState
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] hvac_mode(): cool
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] supported_features(): 41
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): ['auto', 'cool', 'dry', 'fan_only', 'heat', 'off']
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] current_temperature(): None
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] target_temperature(): 25
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] fan_mode(): Quiet
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'low', 'Medium-Low', 'medium', 'Medium-High', 'high', 'Turbo', 'Quiet']
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] swing_mode(): Fixed in the upmost position
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] swing_modes(): ['Default', 'Swing in full range', 'Fixed in the upmost position', 'Fixed in the middle-up position', 'Fixed in the middle position', 'Fixed in the middle-low position', 'Fixed in the lowest position', 'Swing in the downmost region', 'Swing in the middle-low region', 'Swing in the middle region', 'Swing in the middle-up region', 'Swing in the upmost region']
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] name(): Hall AC
2019-07-30 22:37:23 INFO (MainThread) [custom_components.gree.climate] supported_features(): 41

error in the message

Log Details (WARNING)
Mon Jun 10 2019 23:08:34 GMT+0800 (CST)

Updating state for climate.zhuwokongtiao (<class 'custom_components.gree.climate.GreeClimate'>) took 0.411 seconds. Please report platform to the developers at https://goo.gl/Nvioub

AC is beeping every 5-10 seconds

Describe the bug

AC unit (Gree Amber Standard GWH09YC-K6DNA1A) is beeping every few seconds after enabling this component

To Reproduce

restart HA with configured component

Configuration
standard options only.

Expected behavior
stop beeping ;)

Platform:

  • OS: latest Hassio on docker (Debian)
  • Browser Chrome
  • Version Home Assistant 0.94.1

I can upload logs tomorrow, this beeping is annoying my family so I cannot do it now.

I assume that HA is setting AC every x seconds. When AC is reconfigured beeps to confirm changes. When I use app AC also makes this beep but only when I change something.

Temperature Sensor

I cannot see the current temperature sensor neither in the graph nor anywhere else in Home Assistant.
Also, the HVAC is not showing up in Entity Registry. However, I can see it under the developer tools menu.

climate.yaml

  • platform: gree
    name: Hall AC
    host: 192.168..
    port: 7000
    mac: ':::::'
    target_temp_step: 1
    temp_sensor: sensor.ac_hall_temp

Expected behavior
Current Temperature should be in the graph and in general it should be in entity registry.

Platform:

  • OS: HASSIO
  • Browser [e.g. chrome, safari]
  • Version: 0.95.4
  • HVAC: Toyotomi KURO

From Debug Logs:
2019-07-15 20:22:19 INFO (MainThread) [custom_components.gree.climate] current_temperature(): None

I suppose that this shouldn't be None as well. Maybe that's why is not showing up in the graph.

Thank you in advance.

Fan in Quiet Mode

Describe the bug
After update to 0.96+ and the newest Gree component, the Quiet Fan Mode is not as Quiet it should be. For some reason the Fan is working a little above from Low (like Medium-Low).
Although even the EWPE App shows it as Quiet, the fan is not working in Quiet Mode.
When I change from EWPE to another Fan mode and then back again to Quiet, then it is working in Quiet Speed.
However, If I do the same from Home Assistant the Quiet Mode is above the Low.

Platform:

  • OS: HASSIO
  • Version 0.96.3
  • Gree Component 2.0.1
  • HVAC Toyotomi Kuro

Additional context
Add any other context about the problem here.

can not run this component please

Describe the bug
sorry for my bad english
first,i clean install HA on "termux-ubuntu"on android, HA service is normal.
upload this component to server,and edited the yaml,something goes wrong.
To Reproduce
restart the ha service
so is the log:
2020-06-19 13:05:57 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant. 2020-06-19 13:06:10 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for gree which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant. 2020-06-19 13:06:13 ERROR (MainThread) [homeassistant.components.climate] Error while setting up gree platform for climate Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/homeassistant/helpers/entity_platform.py", line 186, in _async_setup_platform await asyncio.gather(*pending) File "/usr/local/lib/python3.8/dist-packages/homeassistant/helpers/entity_platform.py", line 292, in async_add_entities await asyncio.gather(*tasks) File "/usr/local/lib/python3.8/dist-packages/homeassistant/helpers/entity_platform.py", line 441, in _async_add_entity await entity.async_added_to_hass() File "/usr/lib/python3.8/asyncio/coroutines.py", line 124, in coro res = func(*args, **kw) File "/root/.homeassistant/custom_components/gree/climate.py", line 760, in async_added_to_hass self.SyncState() File "/root/.homeassistant/custom_components/gree/climate.py", line 410, in SyncState currentValues = self.GreeGetValues(optionsToFetch) File "/root/.homeassistant/custom_components/gree/climate.py", line 241, in GreeGetValues return self.FetchResult(self.CIPHER, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['dat'] File "/root/.homeassistant/custom_components/gree/climate.py", line 223, in FetchResult pack = receivedJson['pack'] KeyError: 'pack'
Configuration
Share your YAML here
`# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

Text to speech

tts:

  • platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
climate: !include climate.yaml

`

- platform: gree name: First AC host: 192.168.1.51 port: 7000 mac: '37-49-9d-19-00-00-00' target_temp_step: 1 encryption_key: oxp5wq4TrtwJ6ARo
Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Platform:

  • OS: ubuntu 20.14 on termux on android
  • Browser: chrome
  • Version:current github version

Additional context
Add any other context about the problem here.

3 climates

Hi,

I have 3 gree climates, but unfortunately all three don’t work at the same time. What can I mess up with the setup?

Thanks
Cyber

Row 302

I was reviewing the script for the sleep issue (see other post).
It seems there is an error in row 302

Could you please check?

cannot import name 'SUPPORT_TARGET_TEMPERATURE'

Home Assistant release with the issue: 0.89

Last working Home Assistant release (if known): 0.88.1

Operating environment (Hass.io/Docker/Windows/etc.): Docker raspberrypi3-homeassistant

Component/platform: Neato Robotics

Description of problem:

Since the last update of hass I have an issue when it start and the sensors are not present.

Traceback (if applicable):

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 166, in _load_file
    module = importlib.import_module(path)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 673, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/climate/gree.py", line 16, in <module>
    from homeassistant.components.climate import (ClimateDevice, PLATFORM_SCHEMA,
ImportError: cannot import name 'SUPPORT_TARGET_TEMPERATURE'

AC is working but keep getting errors

I can see the AC in HA and I can control it, everything works fine for me
but I keep getting a lots of error message. and I don't like seeing error in my log 😃
I have tried ":" and "-" but nothing changed
sometimes it happend in Gree+ app I got network timeout error

YMAL configuration

climate:
  - platform: gree
    name: Malak_AC
    host: 192.168.1.6
    port: 7000
    mac: xx:xx:xx:xx:xx:xx
    target_temp_step: 1
    encryption_key: XXXXXXXXXXXXX (got it from iphone gree.sqlite file"
Logger: homeassistant.helpers.entity
Source: custom_components/gree/climate.py:220
First occurred: 11:59:51 AM (1 occurrences)
Last logged: 11:59:51 AM

Update for climate.malak_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 472, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/gree/climate.py", line 627, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 410, in SyncState
    currentValues = self.GreeGetValues(optionsToFetch)
  File "/config/custom_components/gree/climate.py", line 241, in GreeGetValues
    return self.FetchResult(self.CIPHER, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['dat']
  File "/config/custom_components/gree/climate.py", line 220, in FetchResult
    data, addr = clientSock.recvfrom(64000)
socket.timeout: timed out
```

```
Logger: homeassistant.helpers.entity
Source: __main__.py:356
First occurred: 11:59:41 AM (1 occurrences)
Last logged: 11:59:41 AM

Update of climate.malak_ac is taking over 10 seconds
```

**Platform:**
HASSIO
Chrome

Error while setting up platform gree when not connected to power line

My Air Conditioning unit is not connected to power line for a few months every year. when I want I can enable it remotely from HA (via sonoff pow). But there is a problem. When HA was restarted during that time I get "entity not absent" warnings in UI.

Can You setup unit even is not connected? For example with unknown status or similar?

Now when I want to power on AC I have to restart Home Assistant to get my entity back.

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for return fut.result() File "/usr/local/lib/python3.7/asyncio/coroutines.py", line 120, in coro res = func(*args, **kw) File "/config/custom_components/gree/climate.py", line 112, 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, hvac_modes, fan_modes, swing_modes, encryption_key, uid) File "/config/custom_components/gree/climate.py", line 155, in __init__ self._encryption_key = self.GetDeviceKey().encode("utf8") File "/config/custom_components/gree/climate.py", line 227, in GetDeviceKey return self.FetchResult(cipher, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['key'] File "/config/custom_components/gree/climate.py", line 210, in FetchResult data, addr = clientSock.recvfrom(64000) socket.timeout: timed out

problem identifying all ACs

Hi,

I am receiving the following err when HA loads and only 1 AC is up and recognized:

Error while setting up platform gree
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/asyncio/coroutines.py", line 120, in coro
res = func(*args, **kw)
File "/config/custom_components/gree/climate.py", line 112, 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, hvac_modes, fan_modes, swing_modes, encryption_key, uid)
File "/config/custom_components/gree/climate.py", line 155, in init
self._encryption_key = self.GetDeviceKey().encode("utf8")
File "/config/custom_components/gree/climate.py", line 227, in GetDeviceKey
return self.FetchResult(cipher, self._ip_addr, self._port, self._timeout, jsonPayloadToSend)['key']
File "/config/custom_components/gree/climate.py", line 210, in FetchResult
data, addr = clientSock.recvfrom(64000)
socket.timeout: timed out

Any ideas?

Air Conditioner State

Hi.
In this component, the state of the ac's is on/off.
In different climates entities, the state is off/cool/heat/etc...
This reflected at the lovelace climate card. The ac's seems turned on at first look (even though the state display is shows 'off', but the card is painted in color like it turned on).

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.