RobHofmann / HomeAssistant-GreeClimateComponent

Custom Gree climate component written in Python3 for Home Assistant. Controls AC's supporting the Gree protocol.
GNU General Public License v3.0
309 stars 104 forks source link

Device availability #163

Closed toughvj closed 3 months ago

toughvj commented 4 months ago

Solved problem of device unavailability if home assistant starts when devices are offline or have no power. From now on, devices are correctly added to the home assistant. There is a specific time interval when the home assistant checks whether the devices are online or not. If not, device is marked as unavailable until it appears on the network.

RobHofmann commented 4 months ago

Hey! I've just tried this. When booting the devices (all 3 of them in my case) show as unavailable. It takes about a minute before them coming online. This means some of my automations will be triggered because of the statechange.

I think we need to make sure the "online check" is also done at boot time (whenever the device is actually online)

RobHofmann commented 4 months ago

I just noticed one of the AC's went Unavailable for no reason (its online) for a few seconds. Came back in no-time, however: again it triggers automations.

RobHofmann commented 4 months ago

We might want to add retry's with a configurable interval & amount of checks. Something like

online_check_interval: 60
online_check_retries: 5
toughvj commented 4 months ago

I just noticed one of the AC's went Unavailable for no reason (its online) for a few seconds. Came back in no-time, however: again it triggers automations.

I’m sure there was a reason :) check log file, there should be a notice from SyncState()

toughvj commented 4 months ago

We might want to add retry's with a configurable interval & amount of checks. Something like


online_check_interval: 60
online_check_retries: 5
``

online checking is made by update() so interval is defined by const SCAN_INTERVAL.

PR tomorrow :)

toughvj commented 4 months ago

@RobHofmann can U try this one? It should initialize Gree device as online, then tries 3 times to indicte whenever device is online or not, if not device is marked as unavailable until next try. climate.txt

RobHofmann commented 4 months ago

Hmm similar behaviour. It starts at Unknown when booting. After a while the AC's are found and marked with their true status. However, this change immediately triggers automations because of the state changing from Unknown to Cool/Auto/Off/etc

For example, this automation, which checks the window state & hvac state and sends the right message accordingly:

#
# Zolderkamer - Meldingen bij openen/dichtdoen raam & airco aan/uit
#
- alias: 'Zolderkamer - Meldingen bij openen/dichtdoen raam & airco aan/uit'
  id: zolderkamer_meldingen_bij_openen_dichtdoen_raam_airco_aan_uit
  trigger:
    - platform: state
      entity_id:
        - climate.zolderkamer_ac
      from: 'off'
      id: Airco aan
    - platform: state
      entity_id:
        - climate.zolderkamer_ac
      to: 'off'
      id: Airco uit
    - platform: state
      entity_id:
        - binary_sensor.zolderkamer_raamsensor_rechts_access_control_window_door_is_open
      id: Raam open
      to: 'on'
    - platform: state
      entity_id:
        - binary_sensor.zolderkamer_raamsensor_rechts_access_control_window_door_is_open
      id: Raam dicht
      to: 'off'
  action:
    - choose:
        - conditions:
            - condition: trigger
              id: Airco aan
            - condition: state
              entity_id: binary_sensor.zolderkamer_raamsensor_rechts_access_control_window_door_is_open
              state: 'on'
          sequence:
            - service: notify.telegram_home
              data:
                message: Zolderkamerairco is aangegaan terwijl het raam openstaat
        - conditions:
            - condition: trigger
              id: Raam open
            - condition: not
              conditions:
                - condition: state
                  entity_id: climate.zolderkamer_ac
                  state: 'off'
          sequence:
            - service: notify.telegram_home
              data:
                message: Zolderkamerraam is open gegaan terwijl de airco draait
        - conditions:
            - condition: trigger
              id: Airco uit
            - condition: state
              entity_id: binary_sensor.zolderkamer_raamsensor_rechts_access_control_window_door_is_open
              state: 'on'
          sequence:
            - service: notify.telegram_home
              data:
                message: Zolderkamerairco uitgezet. Raam kan open blijven!
        - conditions:
            - condition: trigger
              id: Raam dicht
            - condition: not
              conditions:
                - condition: state
                  entity_id: climate.zolderkamer_ac
                  state: 'off'
          sequence:
            - service: notify.telegram_home
              data:
                message: Zolderkamerraam dichtgedaan. Airco draait!
toughvj commented 4 months ago

Fixed with latest commit! I hope ;) For now when device is added to HA, if is accessible, state is correct, info not state is not available. And this, in my opinion, is correct behavior. This is due to the async_added_to_hass time limit. There can't be multiple attempts here.

Device status will be checked next time the update() method is run, and three attempts are made here. If each attempt fails, the device still has the unavailable state, if not, the counter is reset and the device has the available state.

I have added support for the Anti Direct Blow function on selected devices.

If the device supports horizontal swing, to activate in HA you must add the horizontal_swing: true option in the yaml configuration.

hope everything works like a charm ;)

RobHofmann commented 4 months ago

Hey i'm testing this. My AC's now seem to stay Unavailable on boot.

2024-05-25 00:29:42.253 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.zolderkamer_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-25 00:29:42.280 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.slaapkamer_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-25 00:29:42.302 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.slaapkamer_puck_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

Also, I do the assumption that if I want to use the Anti Direct Blow function, i need to add this?:

anti_direct_blow: true
toughvj commented 4 months ago

anti_direct_blow requires input_boolean helper. Could you send the log content after starting HA and, let's say, 5 minutes of operation?

RobHofmann commented 4 months ago

Alright, we need to update the readme as well then :).

Logs:

2024-05-27 11:17:42.854 ERROR (MainThread) [homeassistant.components.climate] Error adding entity climate.zolderkamer_ac for domain climate with platform gree
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1358, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/gree/climate.py", line 1052, in async_added_to_hass
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:17:43.112 ERROR (MainThread) [homeassistant.components.climate] Error adding entity climate.slaapkamer_ac for domain climate with platform gree
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1358, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/gree/climate.py", line 1052, in async_added_to_hass
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:17:43.229 ERROR (MainThread) [homeassistant.components.climate] Error adding entity climate.slaapkamer_puck_ac for domain climate with platform gree
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1358, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/gree/climate.py", line 1052, in async_added_to_hass
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:18:43.044 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.zolderkamer_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:18:43.072 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.slaapkamer_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:18:43.111 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.slaapkamer_puck_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:19:43.040 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.zolderkamer_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:19:43.057 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.slaapkamer_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:19:43.077 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.slaapkamer_puck_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:20:43.056 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.zolderkamer_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:20:43.078 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.slaapkamer_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 11:20:43.106 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.slaapkamer_puck_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
toughvj commented 4 months ago

this is strange behavior. Can U tray attached file? climate.txt

RobHofmann commented 4 months ago

Still giving me errors.

2024-05-27 14:06:05.003 ERROR (MainThread) [homeassistant.components.climate] Error adding entity climate.zolderkamer_ac for domain climate with platform gree
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1358, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/gree/climate.py", line 1052, in async_added_to_hass
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 14:06:05.183 ERROR (MainThread) [homeassistant.components.climate] Error adding entity climate.slaapkamer_ac for domain climate with platform gree
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1358, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/gree/climate.py", line 1052, in async_added_to_hass
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 14:06:05.306 ERROR (MainThread) [homeassistant.components.climate] Error adding entity climate.slaapkamer_puck_ac for domain climate with platform gree
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1358, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/gree/climate.py", line 1052, in async_added_to_hass
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 14:07:05.114 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.zolderkamer_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 14:07:05.133 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.slaapkamer_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-05-27 14:07:05.162 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.slaapkamer_puck_ac fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 950, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1295, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 853, in update
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 543, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
RobHofmann commented 4 months ago

@toughvj did you get a chance to look at the errors?

toughvj commented 4 months ago

I checked on two HA installations and two different air conditioning installations. In no case did errors occur. Do you provide a device key in the configuration? Try to run ha without the specified key in the configuration to force the key to be downloaded from the devices, and possibly increase DEFAULT_TIMEOUT, e.g. to 8. We'll see what happens then.

RobHofmann commented 3 months ago

Tried it. Set the default timeout to 20, just to be sure and for testing purposes.

This is my config (replaced mac addresses with dummy values):

- platform: gree
  name: Zolderkamer AC
  host: 192.168.10.2
  port: 7000
  mac: 'a0:a0:a0:a0:a0:a0'
  target_temp_step: 1
  lights: input_boolean.zolderkamer_ac_lights
  xfan: input_boolean.zolderkamer_ac_xfan
  health: input_boolean.zolderkamer_ac_health
  sleep: input_boolean.zolderkamer_ac_sleep
  powersave: input_boolean.zolderkamer_ac_powersave
  auto_xfan: true
  auto_light: true

- platform: gree
  name: Slaapkamer AC
  host: 192.168.10.3
  port: 7000
  mac: 'a0:a0:a0:a0:a0:a1'
  target_temp_step: 1
  lights: input_boolean.slaapkamer_ac_lights
  xfan: input_boolean.slaapkamer_ac_xfan
  health: input_boolean.slaapkamer_ac_health
  sleep: input_boolean.slaapkamer_ac_sleep
  powersave: input_boolean.slaapkamer_ac_powersave
  auto_xfan: true

- platform: gree
  name: Slaapkamer Puck AC
  host: 192.168.10.11
  port: 7000
  mac: 'a0:a0:a0:a0:a0:a2'
  target_temp_step: 1
  lights: input_boolean.slaapkamer_puck_ac_lights
  xfan: input_boolean.slaapkamer_puck_ac_xfan
  health: input_boolean.slaapkamer_puck_ac_health
  sleep: input_boolean.slaapkamer_puck_ac_sleep
  powersave: input_boolean.slaapkamer_puck_ac_powersave
  auto_xfan: true

Still the same error. It appears this statement: optionValuesToOverride[newOptionsToOverride.index(key)] is out of range. Maybe we can add some debugging to check what the values are?

toughvj commented 3 months ago

looks like GreeGetValues() failed and retrieved some strange data. You can try the attached file. The content of the GreeGetValues() response should appear in the logs. climate.txt

RobHofmann commented 3 months ago
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] Setting up lights entity: input_boolean.zolderkamer_ac_lights
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] Setting up health entity: input_boolean.zolderkamer_ac_health
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] Setting up powersave entity: input_boolean.zolderkamer_ac_powersave
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] Setting up sleep entity: input_boolean.zolderkamer_ac_sleep
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] name(): Zolderkamer AC
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] name(): Zolderkamer AC
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-11 23:28:40.412 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-06-11 23:28:40.413 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): [<HVACMode.AUTO: 'auto'>, <HVACMode.COOL: 'cool'>, <HVACMode.DRY: 'dry'>, <HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.HEAT: 'heat'>, <HVACMode.OFF: 'off'>]
2024-06-11 23:28:40.413 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2024-06-11 23:28:40.413 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2024-06-11 23:28:40.413 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2024-06-11 23:28:40.413 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2024-06-11 23:28:40.413 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']
2024-06-11 23:28:40.413 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-11 23:28:40.413 INFO (MainThread) [custom_components.gree.climate] Gree climate device added to hass()
2024-06-11 23:28:40.413 INFO (MainThread) [custom_components.gree.climate] Retrieving HVAC encryption key
2024-06-11 23:28:40.415 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.10.2, 7000, 1, {"cid": "app","i": 1,"pack": "Ua2XAJOBEjLrYNCFyBVpEl3Rf5vqlrnah2kvmBsA9yKj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"f4911e3f1ac8","uid": 0})
2024-06-11 23:28:40.453 INFO (MainThread) [custom_components.gree.climate] Fetched device encrytion key: b'1Cd4Fg7Ij0Lm3Op6'
2024-06-11 23:28:40.453 INFO (MainThread) [custom_components.gree.climate] Starting SyncState
2024-06-11 23:28:40.464 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.10.2, 7000, 1, {"cid":"app","i":0,"pack":"XmHULF3UIsUHvRxsemQhzoI2ThNBaUjP6IVFJSlTmvDwNBm/6Le/NxFj7VSBuowCgxODn8Ie5jJU2zHydTnc9mnJzZI6HD9U4pN4eSAde87Mps+0p0VMcUQeujl8nK6OfGwsSoCXDhzoNMEv8Xkt+qJKysZuLVmKX68JGIFkq3lx5UKqYK4mPNaAXaE5uw7uIWWcvwPBrClMo7MvG9E0APfD7+C0NC1xXoQv7jZ+4QJe7G794kdEv5d3MUhoZINYuD8rZCWqUW0cIKhIiCo3ax3fbypDR3oQUHLG2fvHv1zwe+38zJh/FTqxIrWKTSg/3OK65nws3R7eo4MHpydr6Q==","t":"pack","tcid":"f4911e3f1ac8","uid":0})
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] DEBUG: [0, 4, 27, 5, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 61]
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting acOptions with retrieved HVAC values
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting Pow: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting Mod: 4
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting SetTem: 27
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting WdSpd: 5
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting Air: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting Blo: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting Health: 1
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting SwhSlp: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting Lig: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting AntiDirectBlow: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting SwingLfRig: 2
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting SwUpDn: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting Quiet: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting Tur: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting StHt: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting TemUn: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting HeatCoolType: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting TemRec: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting SvSt: 0
2024-06-11 23:28:40.523 INFO (MainThread) [custom_components.gree.climate] Setting SlpMod: 61
2024-06-11 23:28:40.523 ERROR (MainThread) [homeassistant.components.climate] Error adding entity climate.zolderkamer_ac for domain climate with platform gree
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1358, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/gree/climate.py", line 1052, in async_added_to_hass
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 544, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-06-11 23:28:40.628 INFO (MainThread) [custom_components.gree.climate] should_poll()
2024-06-11 23:28:40.628 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform
2024-06-11 23:28:40.628 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass
2024-06-11 23:28:40.628 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device
2024-06-11 23:28:40.628 INFO (MainThread) [custom_components.gree.climate] Setting up lights entity: input_boolean.slaapkamer_ac_lights
2024-06-11 23:28:40.628 INFO (MainThread) [custom_components.gree.climate] Setting up health entity: input_boolean.slaapkamer_ac_health
2024-06-11 23:28:40.628 INFO (MainThread) [custom_components.gree.climate] Setting up powersave entity: input_boolean.slaapkamer_ac_powersave
2024-06-11 23:28:40.628 INFO (MainThread) [custom_components.gree.climate] Setting up sleep entity: input_boolean.slaapkamer_ac_sleep
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] name(): Slaapkamer AC
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] name(): Slaapkamer AC
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): [<HVACMode.AUTO: 'auto'>, <HVACMode.COOL: 'cool'>, <HVACMode.DRY: 'dry'>, <HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.HEAT: 'heat'>, <HVACMode.OFF: 'off'>]
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2024-06-11 23:28:40.629 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']
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] Gree climate device added to hass()
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] Retrieving HVAC encryption key
2024-06-11 23:28:40.629 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.10.3, 7000, 1, {"cid": "app","i": 1,"pack": "Ua2XAJOBEjLrYNCFyBVpEql+drRV45yQ5nLvjhyPfC+j9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"f4911e3f1c00","uid": 0})
2024-06-11 23:28:40.672 INFO (MainThread) [custom_components.gree.climate] Fetched device encrytion key: b'Za1Cd4Fg7Ij0Lm3O'
2024-06-11 23:28:40.672 INFO (MainThread) [custom_components.gree.climate] Starting SyncState
2024-06-11 23:28:40.672 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.10.3, 7000, 1, {"cid":"app","i":0,"pack":"aE3h0Hx9k8Y+/phRLhRQcCpoV1SU8KdGT6j0E45zvebuNtW/4Act0soj6MruGVtj5UjVwUjpg+lSwe5ybZ8n4LUWc6w/eT/MpeW36jtW3SusNtOmVox/IQzzI0SZh1YXgxfSM4otpgQ5xEtyFCgqT9OMg8XsFDc55cJzDrwxYmjPae8hEKp5gRKHy4cqsY956RW7SPXX7i8CO6jE06Ur8sU2m26xnnP2VgSwbQ70jHp6PI7TWGALDWhTPpPoOjCVJ3Cp0pDWco6c1Gm6NJMRDXWTdhHH/kQ5dPmsS5rpU0ZxL2sXlJCXmexK8H4fURvFsC3abkudjmERNY1BJvJP1Q==","t":"pack","tcid":"f4911e3f1c00","uid":0})
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] DEBUG: [0, 1, 21, 1, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 61]
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting acOptions with retrieved HVAC values
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting Pow: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting Mod: 1
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting SetTem: 21
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting WdSpd: 1
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting Air: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting Blo: 1
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting Health: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting SwhSlp: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting Lig: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting AntiDirectBlow: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting SwingLfRig: 2
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting SwUpDn: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting Quiet: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting Tur: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting StHt: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting TemUn: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting HeatCoolType: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting TemRec: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting SvSt: 0
2024-06-11 23:28:40.728 INFO (MainThread) [custom_components.gree.climate] Setting SlpMod: 61
2024-06-11 23:28:40.728 ERROR (MainThread) [homeassistant.components.climate] Error adding entity climate.slaapkamer_ac for domain climate with platform gree
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1358, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/gree/climate.py", line 1052, in async_added_to_hass
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 544, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] Setting up Gree climate platform
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] Adding Gree climate device to hass
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] Initialize the GREE climate device
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] Setting up lights entity: input_boolean.slaapkamer_puck_ac_lights
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] Setting up health entity: input_boolean.slaapkamer_puck_ac_health
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] Setting up powersave entity: input_boolean.slaapkamer_puck_ac_powersave
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] Setting up sleep entity: input_boolean.slaapkamer_puck_ac_sleep
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] name(): Slaapkamer Puck AC
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] name(): Slaapkamer Puck AC
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] hvac_modes(): [<HVACMode.AUTO: 'auto'>, <HVACMode.COOL: 'cool'>, <HVACMode.DRY: 'dry'>, <HVACMode.FAN_ONLY: 'fan_only'>, <HVACMode.HEAT: 'heat'>, <HVACMode.OFF: 'off'>]
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2024-06-11 23:28:40.735 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2024-06-11 23:28:40.736 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2024-06-11 23:28:40.736 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2024-06-11 23:28:40.736 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']
2024-06-11 23:28:40.736 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-11 23:28:40.736 INFO (MainThread) [custom_components.gree.climate] Gree climate device added to hass()
2024-06-11 23:28:40.736 INFO (MainThread) [custom_components.gree.climate] Retrieving HVAC encryption key
2024-06-11 23:28:40.736 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.10.11, 7000, 1, {"cid": "app","i": 1,"pack": "qBHL090NAF8tjsBH4ehuI0B4KaKu9TT6Kv8vsyNDL2qj9mrs/0p7GUTdWxmNaBUt","t":"pack","tcid":"f4911ed32494","uid": 0})
2024-06-11 23:28:40.765 INFO (MainThread) [custom_components.gree.climate] Fetched device encrytion key: b'Mn4Pq7St0Vw3Yz6B'
2024-06-11 23:28:40.765 INFO (MainThread) [custom_components.gree.climate] Starting SyncState
2024-06-11 23:28:40.765 INFO (MainThread) [custom_components.gree.climate] Fetching(192.168.10.11, 7000, 1, {"cid":"app","i":0,"pack":"qyxvFjGX+tEpoTcRX/SJQvFck/bPUihdLKJw1H8R3hSvHd/WfTpAySWiEh9m7eoiIjF5w0jWUWjUzQSeBTxO0E96fj3O7n3NdB1XEQcFFahqmsEkvfULjOuURUrIzZgcrHQMVP7dua4vMVWWvulKoqG2MJAhI81D0G3f+IeFsQTpdaHrPgm8tLzZasdUX4T5sBM1BqwlCI+epkzbYIc+if6P0n8WV34lWo6F/bA++UWxnSHt/BCFJq44kP2pGl+G7xgHy2sQ812T05DSejWCel7UYhXZ073UcnE+Nw+yvqpoR8/NRIRk9Nte594UEeW3oJBXBsJ75ylWwpUiWi30Jw==","t":"pack","tcid":"f4911ed32494","uid":0})
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] DEBUG: [0, 1, 22, 1, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 61]
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting acOptions with retrieved HVAC values
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting Pow: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting Mod: 1
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting SetTem: 22
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting WdSpd: 1
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting Air: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting Blo: 1
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting Health: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting SwhSlp: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting Lig: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting AntiDirectBlow: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting SwingLfRig: 2
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting SwUpDn: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting Quiet: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting Tur: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting StHt: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting TemUn: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting HeatCoolType: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting TemRec: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting SvSt: 0
2024-06-11 23:28:40.807 INFO (MainThread) [custom_components.gree.climate] Setting SlpMod: 61
2024-06-11 23:28:40.808 ERROR (MainThread) [homeassistant.components.climate] Error adding entity climate.slaapkamer_puck_ac for domain climate with platform gree
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1358, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/gree/climate.py", line 1052, in async_added_to_hass
    self.SyncState()
  File "/config/custom_components/gree/climate.py", line 544, in SyncState
    self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/gree/climate.py", line 323, in SetAcOptions
    _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))
                                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

This is the log i'm getting now. Can you make anything of it?

toughvj commented 3 months ago

and we have a winner of the confusion: Anti Direct Blow. From this version, anti direct blow is only checked if the anti_direct_blow entity is specified in the configuration. the attached file also contains recent changes made by others. Please let me know if everything works. It would be nice if someone with a device with the second version of encryption could also test it. If everything is OK, I will commit and complete the readme. climate.txt

RobHofmann commented 3 months ago

and we have a winner of the confusion: Anti Direct Blow. From this version, anti direct blow is only checked if the anti_direct_blow entity is specified in the configuration. the attached file also contains recent changes made by others. Please let me know if everything works. It would be nice if someone with a device with the second version of encryption could also test it. If everything is OK, I will commit and complete the readme. climate.txt

Perfect! This one seems to work for me! I'll be testing this for a few hours/days to see if theres any unexpected behaviour. I'll keep you posted!

Maybe @jodewee can test this with the new Encryption version :).

jodewee commented 3 months ago

@RobHofmann As far as i can see in the ewpe or gree app, i do not see any function like that. I can always try, do i need to download any beta for this one? currently, i cannot add this option in the config: image

jodewee commented 3 months ago

@RobHofmann trien with the climate.py changed, but i get an error on my ac with that option enabled.

Logger: homeassistant.helpers.entity Source: helpers/entity.py:941 First occurred: 09:10:52 (5 occurrences) Last logged: 09:12:42

Update for climate.gree_ac_slaapkamer fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1291, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/gree/climate.py", line 906, in update self.SyncState() File "/config/custom_components/gree/climate.py", line 596, in SyncState self._acOptions = self.SetAcOptions(self._acOptions, optionsToFetch, currentValues) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/gree/climate.py", line 378, in SetAcOptions _LOGGER.info('Setting %s: %s' % (key, optionValuesToOverride[newOptionsToOverride.index(key)]))


IndexError: list index out of range
toughvj commented 3 months ago

@jodewee does your AC Unit support anti direct blow?

jodewee commented 3 months ago

@toughvj i doubt about it, i cannot see any options like that in the ewpe or gree app

toughvj commented 3 months ago

everything is ok. Anti anti direct blow entity should be provided in the configuration only if the device actually has such a function, otherwise this error will appear. This is another issue that I want to rebuild so that the component itself checks whether the desired functions are supported by the device or not. If we do not add such functionality, the component will always throw an error when adding functionalities that the device does not support. We wanted to check whether the entire component works properly on a device with a different encryption method (encryption_version=2)

RobHofmann commented 3 months ago

Been testing this over the past days. No issues found :).

Thanks man! Amazing update!

jodewee commented 3 months ago

hi @RobHofmann , @toughvj , I just updated to the latest release a couple of minutes ago, but now all my 3 ac's are coming "unavailable" When downgrading to the previous version (2.11) everything is working again.

retried; same issue. 2024-06-18 20:42:18.192 INFO (MainThread) [custom_components.gree.climate] Starting SyncState 2024-06-18 20:42:18.192 INFO (MainThread) [custom_components.gree.climate] Could not connect with device. 2024-06-18 20:42:30.452 INFO (MainThread) [custom_components.gree.climate] available(): Device is offline

No idea why it reports offline in version 2.12 (for all my 3 ac's) I read there is a time interval whether HA checks if the device is online, is it predefined? Probably it has something to do with that?

jodewee commented 3 months ago

@RobHofmann do i create a new issue for this one?. Waited for about 30min but devices are not coming available. When switching back to 2.11, the appear right away.

RobHofmann commented 3 months ago

Hmm is there any more logging? Can you put the logging in debug mode?

logger:
  default: error
  logs:
    custom_components.gree: debug
jodewee commented 3 months ago

everything is ok. Anti anti direct blow entity should be provided in the configuration only if the device actually has such a function, otherwise this error will appear. This is another issue that I want to rebuild so that the component itself checks whether the desired functions are supported by the device or not. If we do not add such functionality, the component will always throw an error when adding functionalities that the device does not support. We wanted to check whether the entire component works properly on a device with a different encryption method (encryption_version=2)

Well, i now can confirm is does not work with the n3w encryption method. When i fevert back to 2.11, everything works fine again.

jodewee commented 3 months ago

Hmm is there any more logging? Can you put the logging in debug mode?

logger:
  default: error
  logs:
    custom_components.gree: debug

error_log.txt

jodewee commented 3 months ago

For now, went back to 2.11, after reverting, everything works back as it should.

RobHofmann commented 3 months ago

Can you also share your config? I'm not sure why its going wrong here. @toughvj can you also take a look?

jodewee commented 3 months ago
RobHofmann commented 3 months ago
- platform: gree
  name: Zolderkamer AC
  host: 192.168.10.2
  port: 7000
  mac: 'f4:91:1e:3f:1a:c8'
  timeout: 60
  target_temp_step: 1
  lights: input_boolean.zolderkamer_ac_lights
  xfan: input_boolean.zolderkamer_ac_xfan
  health: input_boolean.zolderkamer_ac_health
  sleep: input_boolean.zolderkamer_ac_sleep
  powersave: input_boolean.zolderkamer_ac_powersave
  auto_xfan: true
  auto_light: true

- platform: gree
  name: Slaapkamer AC
  host: 192.168.10.3
  port: 7000
  mac: 'f4:91:1e:3f:1c:00'
  timeout: 60
  target_temp_step: 1
  lights: input_boolean.slaapkamer_ac_lights
  xfan: input_boolean.slaapkamer_ac_xfan
  health: input_boolean.slaapkamer_ac_health
  sleep: input_boolean.slaapkamer_ac_sleep
  powersave: input_boolean.slaapkamer_ac_powersave
  auto_xfan: true

- platform: gree
  name: Slaapkamer Puck AC
  host: 192.168.10.11
  port: 7000
  mac: 'f4:91:1e:d3:24:94'
  timeout: 60
  target_temp_step: 1
  lights: input_boolean.slaapkamer_puck_ac_lights
  xfan: input_boolean.slaapkamer_puck_ac_xfan
  health: input_boolean.slaapkamer_puck_ac_health
  sleep: input_boolean.slaapkamer_puck_ac_sleep
  powersave: input_boolean.slaapkamer_puck_ac_powersave
  auto_xfan: true

So comparing yours with mine, only things i see is:

jodewee commented 3 months ago

i see this in the logs: 2024-06-18 21:37:55.328 INFO (SyncWorker_49) [custom_components.gree.climate] Error getting device encryption key!

jodewee commented 3 months ago

home-assistant_2024-06-18T19-38-01.905Z.log

RobHofmann commented 3 months ago

Are you sure you are on v2 of encryption? what happens if you use v1?

jodewee commented 3 months ago

v1 does not work. the integration only started working with the support of the new encryption method a couple of weeks ago

toughvj commented 3 months ago

please, give some time ok? I'm on holiday now with limited time. I'll check logs next week and provide a patch.

RobHofmann commented 3 months ago

Alright. I'm currently upgrading one of my AC's. I'll see if that also includes v2 of the encryption mode. Will report back.

RobHofmann commented 3 months ago

@toughvj enjoy your holiday mate! see you next week :).

jodewee commented 3 months ago

please, give some time ok? I'm on holiday now with limited time. I'll check logs next week and provide a patch.

no issues with 2.11, so no pressure ;-) Enjoy you holiday!

jodewee commented 3 months ago
- platform: gree
  name: Zolderkamer AC
  host: 192.168.10.2
  port: 7000
  mac: 'f4:91:1e:3f:1a:c8'
  timeout: 60
  target_temp_step: 1
  lights: input_boolean.zolderkamer_ac_lights
  xfan: input_boolean.zolderkamer_ac_xfan
  health: input_boolean.zolderkamer_ac_health
  sleep: input_boolean.zolderkamer_ac_sleep
  powersave: input_boolean.zolderkamer_ac_powersave
  auto_xfan: true
  auto_light: true

- platform: gree
  name: Slaapkamer AC
  host: 192.168.10.3
  port: 7000
  mac: 'f4:91:1e:3f:1c:00'
  timeout: 60
  target_temp_step: 1
  lights: input_boolean.slaapkamer_ac_lights
  xfan: input_boolean.slaapkamer_ac_xfan
  health: input_boolean.slaapkamer_ac_health
  sleep: input_boolean.slaapkamer_ac_sleep
  powersave: input_boolean.slaapkamer_ac_powersave
  auto_xfan: true

- platform: gree
  name: Slaapkamer Puck AC
  host: 192.168.10.11
  port: 7000
  mac: 'f4:91:1e:d3:24:94'
  timeout: 60
  target_temp_step: 1
  lights: input_boolean.slaapkamer_puck_ac_lights
  xfan: input_boolean.slaapkamer_puck_ac_xfan
  health: input_boolean.slaapkamer_puck_ac_health
  sleep: input_boolean.slaapkamer_puck_ac_sleep
  powersave: input_boolean.slaapkamer_puck_ac_powersave
  auto_xfan: true

So comparing yours with mine, only things i see is:

  • I use v1 of encryption
  • I have another notation for the mac address
  • I dont have the "uid: 0" thing.
  • I've added timeout: 60 for it to connect to my AC's (they are a bit slow)

changed the uid:0 with : timout: 60 --> 2.11 --> ok; 2.12 --> error. so that also can be excluded :-)

RobHofmann commented 3 months ago

i've just updated my gree units to the latest version. still no v2 encryption. I'm unable to test this :(.

jodewee commented 3 months ago

I will assume that other users that use the new encryption version will follow after this upgrade. Maybe it is better to hold the release untill @toughvj can take a look at it?

jodewee commented 3 months ago

for me i think the issue is somewhere over here: image

toughvj commented 3 months ago

No, it’s not here. Wiadomość napisana przez jodewee @.***> w dniu 19.06.2024, o godz. 10:40: for me i think the issue is somewhere over here: image.png (view on web)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

jodewee commented 3 months ago

i'm just an infrastructure engineer, i'm guess i let the developers do their thing ;-)

toughvj commented 3 months ago

@jodewee please try attached file and send me back log. climate.txt