Skip to content

A library for controlling Midea home appliances using the UART protocol.

Notifications You must be signed in to change notification settings

rrelande/MideaUART

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MideaUART

Arduino framework library for controlling Midea home appliances using the UART protocol.

Control is possible with a custom dongle. You can make it yourself according to numerous instructions on the Internet, or you can buy a ready-made one in Tindie Shop, thereby supporting me and my work.

A far from complete list of supported brands:

  1. Midea
  2. Electrolux
  3. Qlima
  4. Artel
  5. Carrier
  6. Comfee
  7. Inventor
  8. Dimstal/Simando

Using

It's simple.

  1. Create appliance instance of dudanov::midea::ac::AirConditioner.
  2. Set serial stream interface and communication mode to 9600 8N1.
  3. Add setup() and loop() methods to the same-named global functions of the project.
  4. Control device via void control(const Control &control) with optional parameters.
  5. You may optionally add your callback function for receive state changes notifications.
#include <Arduino.h>
#include <Appliance/AirConditioner/AirConditioner.h>

using namespace dudanov::midea::ac;

AirConditioner ac;

// Example how can change work mode easily
static inline void switchMode(Mode mode) {
  Control control;
  control.mode = mode;
  ac.control(control);
}

// Example how can change mode and temp in same time
static inline void changeState(Mode mode, float targetTemp) {
  Control control;
  control.mode = mode;
  control.targetTemp = targetTemp;
  ac.control(control);
}

// Example how can change power state
static inline void setPowerState(bool state) {
  ac.setPowerState(state);
}

// Example how can change mode to AUTO and set target temp to 25C
static inline void changeAuto25() {
  Control control;
  control.mode = Mode::MODE_AUTO;
  control.targetTemp = 25.0f;
  ac.control(control);
}

// Here you may get new properties states
void onStateChange() {
  ac.getTargetTemp();
  ac.getIndoorTemp();
  ac.getMode();
  ac.getPreset();
  ac.getSwingMode();
  ac.getFanMode();
}

void setup() {
  Serial.begin(9600);     // set serial baudrate to 9600 8N1
  ac.setStream(&Serial);  // set stream serial interface
  ac.addOnStateCallback(onStateChange); // add callback
  ac.setup();
}

void loop() {
  ac.loop();
}

My thanks

to the following people for their contributions to reverse engineering the UART protocol and source code in the following repositories:

Your thanks

If this project was useful to you, you can buy me a Cup of coffee :)

About

A library for controlling Midea home appliances using the UART protocol.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%