[ESPHome Component] Cloud-Free Midea / Inventor / Comfee Dehumidifier (based on Hypfer’s project)

I agree with you on that. But since I use my own popups and cards I simply added this stuff into my cards, so not a problem for me otherwise.

I just created this component for myself, but I figured that if one would like to try it (or really want a humidifier entity instead of climate) then they could simply download my component and do so.

But yeah the humidifier component is indeed a bit weird and I wish it would be more like climate (with fan speed control etc).

Regardless, you have done me a great service by creating this ESPHome component. Once again thanks!

Works like a charm now! Thanks a lot once again. I will not bother you again :joy:





Hi, thanks for your work, i am trying to replace the wifi dongle on a comfee MDDF-20DEN7-WF (so basically slightly bigger but same as yours model) I just received the swlf-01 Pro dongle.
apart from tearing down the dehumidifier do i need to flash different firmware or is already compatible and just needs esphome yaml?

You will need to flash the firmware that OP of this thread made.

I need to take the dust off my esphome install (i used it for testing esp32cam only)
which board did you setup for the dongle? (there is a esp8266-12f on the 2.1 dongle)
could you share your yaml for swlf-01 with the comfee?

I will send you a DM with the details!

I ended up taking the leap to ESPHome and ported my Tasmota application with the help of AI.

As long as all required REST services are available on the controller, the UI can be adjusted without recompiling.

All web files of the project are merged into SP.HTML.

I think the result is quite decent.
I am using the component from @ChreeceGR.

ui-flow

Does something like this eps32 work for this?
If i solder a usb-a to it.

https://www.tinytronics.nl/nl/development-boards/microcontroller-boards/met-wi-fi/universele-airco-controller-esp32-s3

Can you share your details here instead of DM?
I am also interested in such a dongle.

You mentioned you swapped 2 pins, but is that necessary? We can't swap the pins in the code?

This one will also work.

I found a bug.

I'm using the script with an ESP01. Every time I change the value of humidity to achieve, the physical buttons of the Comfee MDDF-20DEN7-WF do not work anymore. Do you have any idea to fix this?

Thanks. I found that one as well. I bought it, but since im a total noob with esphome, can i just plug this dongle into the dehumidifier and then transfer the yaml through HA? Or do I need to flash the dongle firmware first to something else?

U will need to first flash the esphome generated firmware to the device by using the usb c connector. NOT the usb a. Then you can insert the dongle where the factory dongle was placed.

I did that. Replaced the parts that need it, since it's a esp8266.
Changed the pins to 12 and 14.
Uploaded it the swlf. Now it's connected and shows up in esphone builder in home assistant as online.
But the sensors and entities aren't automatically added to HA? At least, that's what the docs say.
What else do I need to do?

Are tx and rx connected the right way?
I have a midea cube 20, here is my yaml. Adjust to your dehumidifiers capabilities.

esphome:
  name: midea-dehumidifier

# replace with your esp settings
esp8266:
  board: esp12e
  framework:
    version: recommended
    #type: esp-idf
  restore_from_flash: true

# Enable Home Assistant API
api:
  encryption:
    key: !secret esphome_api_key

captive_portal:

ota:
  platform: esphome
  password: !secret esphome_ota_pass # replace with your password

# replace with your wifi settings
wifi:
  networks:
    - ssid: !secret wifi_ssid
      password: !secret wifi_password
  min_auth_mode: WPA2

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Dehumidifier Fallback Hotspot"
    password: !secret ap_password
## Webserver
#web_server:
#  port: 80
#  auth:
#    username: !secret esphome_user
#    password: !secret esphome_pass

# Enable logging
logger:
  baud_rate: 0

external_components:
  - source:
      type: git
      url: https://github.com/Chreece/ESPHome-Dehumidifier
      ref: main
    components: [midea_dehum]
    refresh: 0min

uart:
  id: uart_midea
  tx_pin: 12 # replace with the TX pin used from esp
  rx_pin: 14 # replace with the RX pin used from esp
  baud_rate: 9600

midea_dehum:
  id: midea_dehum_comp
  uart_id: uart_midea
  handshake_enabled: false # Optional if you have problems with unknown states on esp boot

  status_poll_interval: 1000 #30000 # Optional, how often should ESP ask the device for a status update in ms (1000ms=1sec). Default: 30000ms

  # 🆕 Optional: Rename display modes to match your device’s front panel.
  # For example, your unit may label these as “Cont”, “Dry”, or “Smart”.
  # These names only affect how the presets appear in Home Assistant — 
  # the internal logic and protocol remain the same.
  # 💡 Tip:
  # If any of the modes below are set to "UNUSED" (case-insensitive),
  # that preset will NOT appear in the Home Assistant UI.
  # Use this if your device doesn’t support or respond to a specific mode.
  # For instance, if pressing “SMART”, your unit doesn't change any mode,
  # set display_mode_smart: "UNUSED" to hide it from the UI.
  display_mode_setpoint: 'Set'
  display_mode_continuous: 'Cont'
  display_mode_smart: 'Smart'
  display_mode_clothes_drying: 'Dry'

climate:
  - platform: midea_dehum
    midea_dehum_id: midea_dehum_comp
    name: "Midea Dehumidifier"

# Optional sensor to inform when the Bucket is full
binary_sensor:
  - platform: midea_dehum
    midea_dehum_id: midea_dehum_comp
    bucket_full:
      name: "Bucket Full"
# Optional sensor to inform that is a filter cleaning is required (only if supported)
    clean_filter:
      name: "Clean Filter Request"

# Optional error sensor remove this block if not needed
sensor:
  - platform: midea_dehum
    midea_dehum_id: midea_dehum_comp
    error:
      name: "Error Code"
    tank_level:
      name: "Tank Level"
#    pm25:
#      name: "pm25"

#  - platform: template
#    name: "Current Temperature"
#    lambda: return(id(midea_dehum_comp).current_temperature);
#    unit_of_measurement: "°C"
#    icon: "mdi:thermometer"
#    device_class: "temperature"
#    state_class: "measurement"
#    accuracy_decimals: 1
#    update_interval: 30s

  - platform: template
    name: "Current Humidity"
    lambda: return(id(midea_dehum_comp).current_humidity);
    unit_of_measurement: "%"
    icon: "mdi:water-percent"
    device_class: "humidity"
    state_class: "measurement"
    accuracy_decimals: 0
    update_interval: 30s

# Optional switches remove the block if none is needed # .preset
switch:
  - platform: midea_dehum
    midea_dehum_id: midea_dehum_comp
# Optional ionizer control, add this block only if your device has Ionizer
    ionizer:
      name: "Ionizer"

# Optional swing control, add this only if your device has Swing function (e.g. Comfee (CDDF7-16DEN7-WFI))
    #swing:
      #name: "Swing"
# Optional beep control, add this only if your device has Beep function (e.g. Comfee (CDDF7-16DEN7-WFI))
    beep:
      name: "Beeper"
# Optional pump control, add this only if your device has Pump function (e.g. Comfee (CDDF7-16DEN7-WFI))
    #pump:
      #name: "Pump"
# Optional sleep control, add this only if your device has Sleep function (e.g. Comfee (CDDF7-16DEN7-WFI))
    #sleep:
      #name: "Sleep"


button:
  - platform: midea_dehum
    midea_dehum_id: midea_dehum_comp
# Optional button to reset the filter clean binary_sensor
    filter_cleaned:
      name: "Reset Filter Cleaning"

# Optional timer number entity for the internal device timer
# When device off -> timer to turn on
# When device on -> timer to turn off
# Toggling the device on/off resets the timer
# 0.5h increments, max: 24h
number:
  - platform: midea_dehum
    midea_dehum_id: midea_dehum_comp
    timer:
      name: "Timer"
#      device_class: "duration"

## Get the device capabilities (BETA)
#select:
#  - platform: midea_dehum
#    midea_dehum_id: midea_dehum_comp
#    capabilities:
#      name: "Capabilities"
#      #internal: true

text_sensor:
  - platform: midea_dehum
    midea_dehum_id: midea_dehum_comp
    capabilities:
      name: "Capabilities"

Thanks! This works!
I think I was missing the api: part.

Only thing i find a bit strange is the chrome to turn it on.
You first have to set it to Dry mode and then there's 2 options: Dry and Humidity Target.
What's the difference here?

I think the Mode should be On and Off.

I have the 20den7-wf as well.

The difference is described in the manual of your dehumidifier. Maybe someone with the same model can help you.

I mean, there's a Dry mode as well on the device. But in HA to turn it on, I have to enable Dry mode and then i can actually switch between the 4 modes on the device.
See screenshots:

I’ve been a long time user of the original programming by Hypfer. While debugging I stumbled over this ESPhome-based solution and am checking it out.
Since the other residents of my home are using only Apple’s Home to interact, I was surprised to find that even though the appearance / configurability of the humidifier improved significantly in Home assistant (kudos!), it’s worse for HomeKit / Apple Home:
The Homekit bridge turns this from an Dehumidifier into an Air Conditioner, which is not only confusing but also missing out on settings and features like modes, humidity setpoint and others.
Is that a known thing? Can this be changed / influenced?

*sorry for the late answer I’m not very active here. The climate entity in home assistant doesn’t provide an ON state. The one used for dehumidifiers is the DRY and it’s equivalent to ON. The DRY mode (not state) and all the modes can be selected only when the device is on and that was a hardware limitation if I can remember correctly