GithubHelp home page GithubHelp logo

hypfer / esp8266-midea-dehumidifier Goto Github PK

View Code? Open in Web Editor NEW
107.0 17.0 21.0 5.85 MB

Cloud-free wifi dehumidification

License: Apache License 2.0

C++ 98.20% C 1.80%
esp8266 midea home-assistant mqtt cloud-free comfee smarthome

esp8266-midea-dehumidifier's Introduction

esp8266-midea-dehumidifier

Free your dehumidifier from the cloud

This repo contains software to build a replacement wifi adapter for your wifi-enabled midea dehumidifier which enables cloud-free operation utilizing MQTT.

Home Assistant Autodiscovery for all features is supported since Home Assistant 2021.08. Furthermore, the WifiManager library is used for on-the-fly configuration. Also, ArduinoOTA is used, so that firmware updates are possible even with a reassembled device.

If you're looking for the exact opposite of this, check out esp8266-deerma-humidifier. Or maybe even use both simultaneously and see who wins?

This should work with all wifi-enabled Midea-made dehumidifiers. They are sold under different brands including:

  • Comfee
  • Inventor

Quoting from node-mideahvac:

The WiFi interface [on these machines] is provided by a dongle, called WiFi SmartKey, either connected to an USB type-A connector or a JST-HX type of connector. This dongle wraps the UART protocol used to communicate with the unit with a layer for authentication and encryption for communication with a mobile app via the Midea cloud or directly via a local LAN connection.

However, it turned out the dongle is just connected to a serial interface (TTL level) of the unit. This means an alternative is to hook up directly to this serial interface and bypass the cloud, authentication and encryption stuff, [which is exactly what this project does].

Compatibility list

This list contains all tested and known-working dehumidifiers:

  • Midea MAD22S1WWT
  • Comfee MDDF-16DEN7-WF
  • Comfee MDDF-20DEN7-WF
  • Inventor Eva II PRO WI-FI
  • Inventor EVA ION PRO WiFi 20L
  • Midea Cube 20 (#22)
  • Midea Cube 35 (#29)
  • Midea Cube 50 (#27)

Additionally, there are models that technically also work but have some issues:

  • Comfee MDDF-20DEN7 - lacks Wi-Fi Button and USB port. The guide below doesn't fully apply! (#24)

Health and Safety

Please note that some of the supported dehumidifiers such as the Comfee MDDF-20DEN7-WF use R290 as its coolant which - while having a much lower global warming potential than other coolants - is also Propane.

Yes, the Propane.

Therefore, when disassembling, please be extra careful so that you don't damage anything since a leak may result in you blowing yourself up and/or burning your house down.

Building the Adapter

adapter This is how the finished replacement adapter I'm using looks like.

To build one of these, you will need:

  • ESP8266 ESP-01 Module
  • ESP-01 Serial Adapter Board with 3.3v to 5v Level Shifters
  • USB A to Terminal Plug Adapter
  • Some Dupont Cables
  • Something to flash the ESP-01

Just source those from the supplier of your choice and compare product listings with this finished adapter photo.

For flashing the ESP-01, there are some nice and self-contained USB to ESP-01 Adapters.

However, they cannot flash the module without soldering an extra button to it. You might want to get one of those as well and then follow this instructable.

The firmware can be built and flashed using the Arduino IDE.

For this, you will need to add ESP8266 support to it by using the Boards Manager.

Furthermore, you will also need to install the following libraries using the Library Manager:

  • ArduinoOTA 1.0.3
  • ArduinoJSON 6.10.1
  • PubSubClient 2.8.0
  • WiFiManager 0.15.0

Using the Adapter

Current supported features are:

  • On/Off
  • Mode
  • Fan Speed
  • Humidity Setpoint

Also, the WiFi indicator on the unit continues to work like it's the real wifi adapter.

Configuring Wifi

Since this project is using the WifiManager library, the ESP8266 will open up a WiFi Access Point for its initial configuration or if it is unable to connect to the previously configured WiFi.

The library pretends that said WiFi AP requires a captive portal which triggers a notification on recent android phones. Simply connect to the AP with your phone, tap the "Login required"-notification and you should be able to configure everything.

If for any reason you require to reconfigure everything, you can simply push and the WiFi button of your Dehumidifier for three seconds. This also deletes the config and opens up the initial configuration Access Point again.

Controlling the Appliance

Since we're using the Home Assistant Autodiscovery feature, everything should just work™.

If you're using something else other than Home Assistant, you can of course also control it by manually sending JSONs to the command mqtt topic of the unit:

esp8266-midea-dehumidifier/DEHUMIDIFIER-FFFFFF/command

{
	"state": "on",
	"humiditySetpoint": 55,
	"fanSpeed": "medium",
	"mode": "setpoint"
}

You can omit parameters that you don't want to change.

The current status of the unit will be published like this:

esp8266-midea-dehumidifier/DEHUMIDIFIER-FFFFFF/state

{
	"state": "on",
	"humiditySetpoint": 55,
	"humidityCurrent": 41,
	"errorCode": 0,
	"fanSpeed": "medium",
	"mode": "setpoint"
}

Misc

As you can see, on the Comfee MDDF-20DEN7-WF, the replacement adapter actually fits inside the mounting point of the regular WiFi adapter. comfee adapter

References and sources

The knowledge to create the logic to monitor and control the Midea-'like' AC units was gathered by reverse engineering Android applications from various vendors, analyzing the UART protocol between an Artel unit and an SK103 SmartKey, documents found on the Internet, primarily in Chinese and the work from:

esp8266-midea-dehumidifier's People

Contributors

ferenc- avatar ftwmrp avatar hypfer avatar jeija avatar syntaxrabbit avatar tippylion28 avatar tonybrobston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp8266-midea-dehumidifier's Issues

Help with ON/OFF with home assistant

Hey there,
Could someone help me out... i've added this via MQTT Integration to Home Assistant, and i have 3 entities (Fan, Humidity and WIFI)
On the FAN i have a switch and an option to set the fan speed between (low, medium and high).
When turning on the switch it stays on for 1 or 2s and then off again (No effect on the dehumidifier).
If i turn ON the unit, i can set the fan speed successfuly, but the switch on home assistant shows as turned off (click on it has no effect on the unit).
Any clue why this is happening?

Here's an example of MQTT info (state) in Home Assistant... When the unit is turned on the "payload: state:" changes to "on".

QoS: 0
Payload: state: 'off'
humiditySetpoint: 55
humidityCurrent: 70
errorCode: 0
fanSpeed: low
mode: setpoint
wifi:
  ssid: MY_SSID
  ip: xxx.xxx.xxx.xxx
  rssi: -68

Thanks a lot for sharing this projects.

Tank full alert

There doesn't seem to be a tank full alert in the firmware. Is it possible to add? Will be quite useful

Thanks

Feature Request AC Unit support

Hi Hypfer,

I wanted to ask you if you are willing to try and make a similar component but then for AC units that's also use the cloud service. Rene Klootwijk has built something that can do this, but your solution runs on the ESP8266 unit itself. Im not that experienced with coding, if I was I would definitely give it a try. But im willing to help you in gathering information so it would be easier to write the coding.

Let me here what you think,

Best Regards

Midea Cube 50

Confirmed working on Midea Cube 50 model MAD50PS1QGR. Disassembly and dongle location is the same as the Cube 20.

Midea Cube 35

I set this up with a D1 mini clone and installed it in my Midea Cube 35 last week and everything is working well so far. EDIT: It is reporting Humidity level and Wifi strength, and I can change the fan speed, humidity setpoint, mode, and power on/off.

The USB dongle is again in the same location as the 20 and 50 pint models. Thank you!

Comfee Board

Hi,
I have a Comfee CF-DEHU-12 without WiFi support. I've found that it has the internal connector but I can't get any data from UART (power is ok). I've checked the PCB routes and all seems connected (except from the lines that goes to the different display of other products, the "disp n5" on image).
The fact is that I don't have the WiFi toggle button, can someone check in their unit what the WiFi button does? I suppose that only pulls up or down on pin of the IC.
Probably a wire check of the display connector to see which pins are shorted could be fine.
For any one interested the IC is a SINO WEALTH SH79F161AF (search for SH79F161A, the F is a package version). Used pins are TXD, RXD, P2.7 (generic PWM or INT) and a blank one (probably GND)
Thanks
IMG_20220127_181919
IMG_20220127_181931

Reversibility

Is this modification fully reversible? So can you easily switch back to the old setup?

Esphome

Hello,

First of all thanks for sharing this... Would this also works with EspHome? instead of the arduino libs?
Sorry if it's a dumb question... i'm just starting to look into this smart home stuff.

Thanks

MQTT doesn't work

I have the Comfee MDDF-20DEN7-WF which is supported and tested, but I can't get it to work. The only thing that functions properly is the "status" topic, if the dongle is plugged in it shows "online", if I hold reset on the usb adapter or detach it from the dehumidifier it says "offline". But in my case I don't get any states over the "state" topic and can't push anything over "command" :(

I've tested with homebridge, aedes broker and mqttthing, but also with home assistant (autodiscovery doesn't work either)

Edit: I don’t know what happened but now it’s sending the autoconf for home assistant, but home assistant tells me that all sensors are not connected anymore. Still can’t control it through mqtt

Is a connection to the dehumidifier needed to test and configure wifi?

I already tried to understand your arduino code files, but before I will open my dehumidifier, I would like to test and configure the ESP. So far, I managed to compile the source (see my small pull request for latest Arduino IDE compatibility) and upload it to the microcontroller with a generic FTDI.
Afterwards, I connected "EN" to 3.3V and removed IOzero from GND.
The serial console outputs some bytes, but the WIFI access point does not show up in my phone.
Am I doing something wrong?
Thank you for your help.

ION Mode implementation

The device has an ION mode available on the default factory firmware. Is it possible to implement that also?

Thanks

Cannot easily reset configuration

First off, thanks for putting this repo together; I love that people are exploring local control and I get to benefit and contribute to their work. Thanks!

I entered my ssid, password, mqtt server, mqtt username, mqtt password. However I didn't realize that port was hardcoded to 1883, so I entered ip:port.

I tried holding down the wifi button for 3 seconds (and did get a beep), but my config doesn't appear to be reset. I still see my esp01 on my network and I don't see the AP on my phone. Referencing the docs: "If for any reason you require to reconfigure everything, you can simply push and the WiFi button of your Dehumidifier for three seconds. This also deletes the config and opens up the initial configuration Access Point again."

Now I'm trying to reflash the esp01, but it also does not appear to be resetting my config.

Any suggestions of what to try? I just want to re-enter my mqtt server address.

https://www.midea.com/us/Air-Conditioners/Dehumidifiers/22-Pint-Smartdry-Dehumidifier-MAD22S1WWT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.