How to change attributes of discovered entities (gree ac / proklima)

This is quite possibly a complete newbie question — I’d be very happy if someone cloud point me into the right direction.

The background:
I have a ProKlima airconditioner which is mostly compatible with gree devices. The gree integration works well and produces a device and an entity with the following attributes:

hvac_modes:
  - auto
  - cool
  - dry
  - fan_only
  - heat
  - 'off'
min_temp: 16
max_temp: 30
target_temp_step: 1
fan_modes:
  - auto
  - low
  - medium low
  - medium
  - medium high
  - high
preset_modes:
  - eco
  - away
  - boost
  - none
  - sleep
swing_modes:
  - 'off'
  - vertical
  - horizontal
  - both
friendly_name: ac_proKlima-ac
supported_features: 57

However, not all of those settings are actually supported by the device. For example, the swing modes don’t exist at all and in the list of hvac modes “heat” has no function.
So, is there a way to fix this?

Is there a way to
a) Somehow override those state attributes
or
b) Create a custom airconditioner with a mix of static attributes and “links” to the actual device?

Kind regards, Jörg

PS: The goal is the have the correct buttons and options on the lovelace card.

There is no way for you to adjust those attributes.

Create an issue on github:

It seems to be actively supported.

I just found out that I can copy the integration to my custom_components folder and customize the heck out of it.

However, I’ll open a feature-request as it seems useful to be able to select the features on a generic platform like gree.

EDIT:
Just in case someone else wants to remove the features not supported by the proklima local air conditioner, here is the diff:


diff -Naur core/homeassistant/components/gree/climate.py config/custom_components/gree/climate.py
--- core/homeassistant/components/gree/climate.py	2021-07-19 13:03:54.049900857 +0200
+++ config/custom_components/gree/climate.py	2021-07-19 13:42:30.268108257 +0200
@@ -65,11 +65,9 @@
 _LOGGER = logging.getLogger(__name__)

 HVAC_MODES = {
-    Mode.Auto: HVAC_MODE_AUTO,
     Mode.Cool: HVAC_MODE_COOL,
     Mode.Dry: HVAC_MODE_DRY,
     Mode.Fan: HVAC_MODE_FAN_ONLY,
-    Mode.Heat: HVAC_MODE_HEAT,
 }
 HVAC_MODES_REVERSE = {v: k for k, v in HVAC_MODES.items()}

@@ -84,9 +82,7 @@
 FAN_MODES = {
     FanSpeed.Auto: FAN_AUTO,
     FanSpeed.Low: FAN_LOW,
-    FanSpeed.MediumLow: FAN_MEDIUM_LOW,
     FanSpeed.Medium: FAN_MEDIUM,
-    FanSpeed.MediumHigh: FAN_MEDIUM_HIGH,
     FanSpeed.High: FAN_HIGH,
 }
 FAN_MODES_REVERSE = {v: k for k, v in FAN_MODES.items()}
@@ -96,8 +92,6 @@
 SUPPORTED_FEATURES = (
     SUPPORT_TARGET_TEMPERATURE
     | SUPPORT_FAN_MODE
-    | SUPPORT_PRESET_MODE
-    | SUPPORT_SWING_MODE
 )


diff -Naur core/homeassistant/components/gree/switch.py config/custom_components/gree/switch.py
--- core/homeassistant/components/gree/switch.py	2021-07-19 13:03:54.049900857 +0200
+++ config/custom_components/gree/switch.py	2021-07-19 14:21:01.137184050 +0200
@@ -18,8 +18,6 @@
         async_add_entities(
             [
                 GreePanelLightSwitchEntity(coordinator),
-                GreeQuietModeSwitchEntity(coordinator),
-                GreeFreshAirSwitchEntity(coordinator),
                 GreeXFanSwitchEntity(coordinator),
             ]
         )
1 Like

Returning to my first ever post on this forum because there is a much better solution:

Instead of copying the whole integration and editing the code it is much easier to change the relevant attributes with manual customizations:

homeassistant:
  customize:
    climate.gree_klimagerat:
      swing_modes: null
      preset_modes: null
      fan_modes:   ["auto", "low", "medium", "high"]
      hvac_modes:  ["cool", "dry", "fan_only", "off"]