Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numbered fan speed modes? #135

Closed
Arn0uDz opened this issue Jan 19, 2024 · 7 comments
Closed

Numbered fan speed modes? #135

Arn0uDz opened this issue Jan 19, 2024 · 7 comments

Comments

@Arn0uDz
Copy link

Arn0uDz commented Jan 19, 2024

I've been using this project for a while now but i'm still bothered by the fan modes in Home Assistant. When I was still using the Melcloud integration I could select the normal fan modes for my unit: 1 , 2 , 3 , 4 and 5

But since using this project i'm forced to use names instead of numbers for the fan modes. The main problem is that my unit has 5 modes and the names for each mode is so confusing. If you only have 3 modes then low/mid/high is logical, but when you have 5 modes it gets confusing.

These are my settings:
fan_mode: [AUTO, DIFFUSE, LOW, MEDIUM, MIDDLE, HIGH]

This gives me the following options in Home Assistant, in this order:
-Auto
-Low (= 2)
-Medium (= 3)
-High (= 5)
-Middle (= 4)
-Diffuse (= 1)

I keep getting confused with the medium and middle setting. I tried this project "https://github.com/gysmo38/mitsubishi2MQTT", that does have numbered fan modes but it wasn't stable for me.

Is there a way to rename them, so I have fan modes with numbers again?

@MarkoPaasila
Copy link

MarkoPaasila commented Jan 19, 2024

I keep a lookup table somewhere to always check the meaning of middle and medium. I bet they will at some point add a "mean" too.

@davidcd13
Copy link

Yes I don't understand why it's not a simple numbering... The medium and middle make no sense...

@echavet
Copy link
Collaborator

echavet commented Mar 16, 2024

fan_map in the swiCago lib implementation is:

static const char* FAN_MAP[6] = { "AUTO", "QUIET", "1", "2", "3", "4" };

ESPHome Climate component define this :

enum ClimateFanMode : uint8_t {
  /// The fan mode is set to On
  CLIMATE_FAN_ON = 0,
  /// The fan mode is set to Off
  CLIMATE_FAN_OFF = 1,
  /// The fan mode is set to Auto
  CLIMATE_FAN_AUTO = 2,
  /// The fan mode is set to Low
  CLIMATE_FAN_LOW = 3,
  /// The fan mode is set to Medium
  CLIMATE_FAN_MEDIUM = 4,
  /// The fan mode is set to High
  CLIMATE_FAN_HIGH = 5,
  /// The fan mode is set to Middle
  CLIMATE_FAN_MIDDLE = 6,
  /// The fan mode is set to Focus
  CLIMATE_FAN_FOCUS = 7,
  /// The fan mode is set to Diffuse
  CLIMATE_FAN_DIFFUSE = 8,
  /// The fan mode is set to Quiet
  CLIMATE_FAN_QUIET = 9,
};

A component that does not use the UI Climate Component is free to define any mapping for these values, but I'm not sure there is a way to override the native ESPHome climate component labels in this implementation. At least I didn't find a way in my implementation. So I had to define an arbitrary mapping for these names.
It looks like this:

void CN105Climate::controlFan() {

    switch (this->fan_mode.value()) {
    case climate::CLIMATE_FAN_OFF:
        this->setPowerSetting("OFF");
        break;
    case climate::CLIMATE_FAN_QUIET:
        this->setFanSpeed("QUIET");
        break;
    case climate::CLIMATE_FAN_DIFFUSE:
        this->setFanSpeed("QUIET");
        break;
    case climate::CLIMATE_FAN_LOW:
        this->setFanSpeed("1");
        break;
    case climate::CLIMATE_FAN_MEDIUM:
        this->setFanSpeed("2");
        break;
    case climate::CLIMATE_FAN_MIDDLE:
        this->setFanSpeed("3");
        break;
    case climate::CLIMATE_FAN_HIGH:
        this->setFanSpeed("4");
        break;
    case climate::CLIMATE_FAN_ON:
    case climate::CLIMATE_FAN_AUTO:
    default:
        this->setFanSpeed("AUTO");
        break;
    }
}

@rudizl
Copy link

rudizl commented Mar 16, 2024

Where exactly you define those names?
BTW I just switched to your component and it works perfectly for now. (FH50VE)

@echavet
Copy link
Collaborator

echavet commented Mar 16, 2024

Actually, you can define it making something like that in your yaml; this is from another component version but the support section is the same:

climate:
  - platform: cn105  
    name: ${friendly_name}
    id: "esp32_clim"
    compressor_frequency_sensor:
      name: Compressor frequency (clim Sejour)    
    vertical_vane_select:
      name: Orientation de la Vane Verticale
    # horizontal_vane_select:
    #   name: Orientation de la Vane Horizontale
    isee_sensor:
      name: ISEE Sensor
    auto_sub_mode_sensor:
      name: auto-submode sensor
    sub_mode_sensor:
      name: submode sensor
    stage_sensor:
      name: stage sensor      
    remote_temperature_timeout: 15min
    update_interval: 2s         # shouldn't be less than 1 second
    debounce_delay : 100ms       # delay to prevent bouncing 
    supports:
      mode: [COOL, HEAT, FAN_ONLY, DRY]
      fan_mode: [AUTO, QUIET, LOW, MEDIUM, HIGH]
      swing_mode: ["OFF", VERTICAL]
    visual:
      min_temperature: 17
      max_temperature: 23
      temperature_step: 1.0

@Arn0uDz
Copy link
Author

Arn0uDz commented Apr 11, 2024

Actually, you can define it making something like that in your yaml; this is from another component version but the support section is the same:

climate:
  - platform: cn105  
    name: ${friendly_name}
    id: "esp32_clim"
    compressor_frequency_sensor:
      name: Compressor frequency (clim Sejour)    
    vertical_vane_select:
      name: Orientation de la Vane Verticale
    # horizontal_vane_select:
    #   name: Orientation de la Vane Horizontale
    isee_sensor:
      name: ISEE Sensor
    auto_sub_mode_sensor:
      name: auto-submode sensor
    sub_mode_sensor:
      name: submode sensor
    stage_sensor:
      name: stage sensor      
    remote_temperature_timeout: 15min
    update_interval: 2s         # shouldn't be less than 1 second
    debounce_delay : 100ms       # delay to prevent bouncing 
    supports:
      mode: [COOL, HEAT, FAN_ONLY, DRY]
      fan_mode: [AUTO, QUIET, LOW, MEDIUM, HIGH]
      swing_mode: ["OFF", VERTICAL]
    visual:
      min_temperature: 17
      max_temperature: 23
      temperature_step: 1.0

How exactly does this change anything? Those are still the same fan modes i'm complaining about.

@Arn0uDz
Copy link
Author

Arn0uDz commented Apr 20, 2024

Solved by installing a custom HACS component and making a climate template.

https://github.com/litinoveweedle/hass-template-climate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants