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

Swing modes resets to full range option if any swing selected #180

Closed alanoitaliano closed 3 months ago

alanoitaliano commented 3 months ago

Describe the bug The swing mode resets to full range if I select anything from swing options. Swing gets applied only for "fixed" positions. AC reacts with a beep for every option selected. It was working in every position before the update.

To Reproduce Steps to reproduce the behavior:

  1. Go to AC
  2. Select any swing mode that is not fixed position
  3. In couple of seconds the swing goes back to full range

Configuration

- platform: gree
  name: AM AC
  host: 192.168.0.182
  port: 7000
  mac: ###
  target_temp_step: 1
  temp_sensor: sensor.ble_temperature_am_salon
  lights: input_boolean.am_ac_lights
  xfan: input_boolean.am_ac_xfan
  health: input_boolean.am_ac_health
  sleep: input_boolean.am_ac_sleep
  powersave: input_boolean.am_ac_powersave
  eightdegheat: input_boolean.am_ac_antifreeze
  air: input_boolean.am_ac_fresh_air
  auto_xfan: true
  auto_light: true
  horizontal_swing: true

Expected behavior The swing oprion should stay and change the AC swing

Platform:

Additional context Add any other context about the problem here.

Logs

2024-06-21 16:54:24.660 INFO (SyncWorker_38) [custom_components.gree.climate] update()
2024-06-21 16:54:24.660 INFO (SyncWorker_38) [custom_components.gree.climate] Starting SyncState
2024-06-21 16:54:24.660 INFO (SyncWorker_38) [custom_components.gree.climate] Fetching(192.168.0.182, 7000, 10, {"cid":"app","i":0,"pack":"oPyu/cDfM6Pdnm2ZegPo8jsz6SdEZ7cnJGrNhSEhcHGjwnl811yDZnbi2fpZ7fyjbuLy3I6n7FYT8NlQK4wdms75DjG93iiJ3yX8Nx/oMkx2+7MokZFdsZxP13U82Uc1izb5+QAH13rGk4QVja58nKN186Z5QT2gM757gML+ADuqqKimncdStv2dqmaKlEu18dI9TqwfYTsfiTru3RhwWAT560s8qyqdFX2bedQCBvkFNb3tX4R2swgnvc3xua9Z4Ff39VQITndxmpvnRq4sF3RbO25xwYHkGCyh7lGWstsFW4Vg4CvuLZxz+EOd/Nu3","t":"pack","tcid":"9424b80cda33","uid":0})
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting acOptions with retrieved HVAC values
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting Pow: 1
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting Mod: 1
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting SetTem: 25
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting WdSpd: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting Air: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting Blo: 1
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting Health: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting SwhSlp: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting Lig: 1
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting SwingLfRig: 6
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting SwUpDn: 11
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting Quiet: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting Tur: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting StHt: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting TemUn: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting HeatCoolType: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting TemRec: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting SvSt: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting SlpMod: 0
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Setting TemSen: 64
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] Done setting acOptions
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] HA target temp set according to HVAC state to: 25
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] HA lights option set according to HVAC state to: on
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] HA health option set according to HVAC state to: off
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] HA powersave option set according to HVAC state to: off
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] HA sleep option set according to HVAC state to: off
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] HA 8℃ heat option set according to HVAC state to: off
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] HA air option set according to HVAC state to: off
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] HA operation mode set according to HVAC state to: cool
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] HA swing mode set according to HVAC state to: Swing in the upmost region
2024-06-21 16:54:24.698 INFO (SyncWorker_38) [custom_components.gree.climate] HA preset mode set according to HVAC state to: Fixed in the rightmost position
2024-06-21 16:54:24.699 INFO (SyncWorker_38) [custom_components.gree.climate] HA fan mode set according to HVAC state to: Auto
2024-06-21 16:54:24.699 INFO (SyncWorker_38) [custom_components.gree.climate] Finished SyncState
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-06-21 16:54:24.699 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-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] preset_modes(): ['Default', 'Full swing', 'Fixed in the leftmost position', 'Fixed in the middle-left position', 'Fixed in the middle postion', 'Fixed in the middle-right position', 'Fixed in the rightmost position']
2024-06-21 16:54:24.699 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-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] available(): Device is online
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] hvac_mode(): cool
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] current_temperature(): 24.71
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] target_temperature(): 25
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] fan_mode(): Auto
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] preset_mode(): Fixed in the rightmost position
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] swing_mode(): Swing in the upmost region
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] name(): AM AC
2024-06-21 16:54:24.699 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-21 16:54:35.472 INFO (MainThread) [custom_components.gree.climate] temp_sensor state changed | sensor.ble_temperature_am_salon from 24.71 to 24.76
2024-06-21 16:54:35.472 INFO (MainThread) [custom_components.gree.climate] Thermostat updated with changed temp_sensor state | 24.76
2024-06-21 16:54:35.472 INFO (MainThread) [custom_components.gree.climate] Current state temp_sensor: 24.76
2024-06-21 16:54:35.472 INFO (MainThread) [custom_components.gree.climate] temp_sensor state represents_float |24.76
2024-06-21 16:54:35.472 INFO (MainThread) [custom_components.gree.climate] Current temp: 24.76
2024-06-21 16:54:35.478 INFO (SyncWorker_61) [custom_components.gree.climate] update()
2024-06-21 16:54:35.478 INFO (SyncWorker_61) [custom_components.gree.climate] Starting SyncState
2024-06-21 16:54:35.478 INFO (SyncWorker_61) [custom_components.gree.climate] Fetching(192.168.0.182, 7000, 10, {"cid":"app","i":0,"pack":"oPyu/cDfM6Pdnm2ZegPo8jsz6SdEZ7cnJGrNhSEhcHGjwnl811yDZnbi2fpZ7fyjbuLy3I6n7FYT8NlQK4wdms75DjG93iiJ3yX8Nx/oMkx2+7MokZFdsZxP13U82Uc1izb5+QAH13rGk4QVja58nKN186Z5QT2gM757gML+ADuqqKimncdStv2dqmaKlEu18dI9TqwfYTsfiTru3RhwWAT560s8qyqdFX2bedQCBvkFNb3tX4R2swgnvc3xua9Z4Ff39VQITndxmpvnRq4sF3RbO25xwYHkGCyh7lGWstsFW4Vg4CvuLZxz+EOd/Nu3","t":"pack","tcid":"9424b80cda33","uid":0})
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting acOptions with retrieved HVAC values
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting Pow: 1
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting Mod: 1
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting SetTem: 25
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting WdSpd: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting Air: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting Blo: 1
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting Health: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting SwhSlp: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting Lig: 1
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting SwingLfRig: 6
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting SwUpDn: 1
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting Quiet: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting Tur: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting StHt: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting TemUn: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting HeatCoolType: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting TemRec: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting SvSt: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting SlpMod: 0
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Setting TemSen: 64
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Done setting acOptions
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA target temp set according to HVAC state to: 25
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA lights option set according to HVAC state to: on
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA health option set according to HVAC state to: off
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA powersave option set according to HVAC state to: off
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA sleep option set according to HVAC state to: off
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA 8℃ heat option set according to HVAC state to: off
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA air option set according to HVAC state to: off
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA operation mode set according to HVAC state to: cool
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA swing mode set according to HVAC state to: Swing in full range
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA preset mode set according to HVAC state to: Fixed in the rightmost position
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] HA fan mode set according to HVAC state to: Auto
2024-06-21 16:54:35.764 INFO (SyncWorker_61) [custom_components.gree.climate] Finished SyncState
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-06-21 16:54:35.765 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-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] min_temp(): 16
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] max_temp(): 30
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] target_temperature_step(): 1.0
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] fan_list(): ['Auto', 'Low', 'Medium-Low', 'Medium', 'Medium-High', 'High', 'Turbo', 'Quiet']
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] preset_modes(): ['Default', 'Full swing', 'Fixed in the leftmost position', 'Fixed in the middle-left position', 'Fixed in the middle postion', 'Fixed in the middle-right position', 'Fixed in the rightmost position']
2024-06-21 16:54:35.765 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-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] available(): Device is online
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] hvac_mode(): cool
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] temperature_unit(): °C
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] current_temperature(): 24.76
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] target_temperature(): 25
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] fan_mode(): Auto
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] preset_mode(): Fixed in the rightmost position
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] swing_mode(): Swing in full range
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] name(): AM AC
2024-06-21 16:54:35.765 INFO (MainThread) [custom_components.gree.climate] supported_features(): 441
toughvj commented 3 months ago

Are you sure that Gree Pular has a swing function in various blind settings? Because in my opinion there is no such function. What you are describing is normal behavior of the device when it is commanded to enable a function it does not support. The device makes a sound when accepting a command and then switches to swing in full range. In my opinion, your device only supports fixed positions and full swing. If I'm wrong, please send me back log file, but when you operate with remote control.

alanoitaliano commented 3 months ago

Are you sure that Gree Pular has a swing function in various blind settings? Because in my opinion there is no such function. What you are describing is normal behavior of the device when it is commanded to enable a function it does not support. The device makes a sound when accepting a command and then switches to swing in full range. In my opinion, your device only supports fixed positions and full swing. If I'm wrong, please send me back log file, but when you operate with remote control.

Yup You're right, I never even noticed that, just saw the manual and tested with remote. Sorry for wasting Your time!