echavet / MitsubishiCN105ESPHome

Mix of MisubishiHeatpump from SwiCago and esphome-mitsubishiheatpump from Geoffdavis.
197 stars 39 forks source link

Fan speeds in wrong/weird order #146

Open supermarkert opened 2 months ago

supermarkert commented 2 months ago

I have a Mitsubishi MSY unit and everything works, but notice odd visual behavior of the Climate component that gets built in Home Assistant. The unit appears to support 6 fan modes:

However, when I add a climate component to Home Assistant, the order is always:

I don't mind the Quiet placement, but 3 & 4 are definitely out of place. I see the same behavior whether I use the official Thermostat card or use a 3rd party "Simple Thermostat" card. image image

Is there any way to re-order the fan speeds so they at least show 1-4 properly? Preferably, Quiet should be before 1 (low).

phidauex commented 2 months ago

I've dug into this one a bit and ran into a dead end. The issue appears to be with how ESPHome enumerates the fan modes. In this component the default fan modes are defined here (I don't think the order matters here): https://github.com/echavet/MitsubishiCN105ESPHome/blob/89e75b4eb4e0232a90f374bbb6410d7990566427/components/cn105/climate.py#L45

You can also specify other fan modes in your climate component definition.

But when ESPhome sends that over to HomeAssistant, it uses its own order, which is defined here: https://esphome.io/api/namespaceesphome_1_1climate#adb5ca2756a8991cedb030edebb3028dc

image

You can see the order here matches what you are seeing in HA.

My workaround for my MSZ-GLxxNA units is to just drop the "middle" speed from my list. Honestly if I don't want auto fan speed, it is probably because I want minimum or maximum, so it doesn't add much value to me to select "middle" or "medium", so dropping one from the list is a small sacrifice.

      fan:
        _name: Fan
        auto:
          name: null
          icon: mdi:fan-auto
        low:
          name: null
          icon: mdi:fan-speed-1
        medium:
          name: null
          icon: mdi:fan-speed-2
        high:
          name: null
          icon: mdi:fan-speed-3
        middle: false
        quiet:
          name: null
          icon: mdi:volume-mute
supermarkert commented 2 months ago

Thanks for the info.
I dug into it a little more after I posted, and noticed that the latest Thermostat card in HA actually allows you to customize the order that is displayed. It doesn't fix the climate entity, just what's shown on the dashboard. So I can fix it with the standard card and it works good enough for my use. This seems new and I don't know exactly when this feature was added.
Oddly, I can't change the displayed order in Simple Thermostat card; I had started using it a while ago specifically because it gave me more custom options for my mini split. But with all the updates to HA, I think I'll just switch back to the native one.

disruptivepatternmaterial commented 2 months ago

yeah this is silly and frustrating - I have to this point assumed this is because it seems many of the people writing code for esphome/ha do not speak English as a first language. As someone who has lived in many place and tried to speak many languages with hysterical results at time (repeatedly asking for bread I my coffee because I confused milk for bread and when the person put bread in my coffee it had the coffee shop laughing or when I asked for stamps once and instead demanded a stampede, somehow which caused all the postal workers to laugh hysterically), I just shrug because middle makes no sense being at the end HAHA...but like @echavet mentioned, I too remove middle form my setup.