I’ve been asked to secure this info from Any Support for Midea A/C
I’ve put here all relevant info from that topic:
Looks like it is finally working!
Thanks Mac-Zhou, ReneKlootwijk, SergeyDudanov, Fraschi for awesome collaboration.
(it already works, but development still ongoing to support more models and functions)
See this post for supported models (list is updated regularly) Thanks @paddy0174 !!
Hardware:
You can either order them online (pre-assembled, have a look here Thanks @dudanov for making this available for free!!)
Or make your own:
Requirements:
1x
and to program it
1x
or with soldered links to put it into programming mode
(Check this link for more options flashing esp-01’s)
I used this to flash the esp-01: USB Serial Adapter CH340G 5V/3.3V USB to TTL-UART.
As the AC itself doesn’t use USB (even though it uses an USB connector), you cannot use the programmer adapter there, you need the 5V/3.3V Adapter.
Mine looks like this (my A/C was both equipped with USB as well as header plug, so I could choose)
Software:
Normally ‘programming’ would be done from the ESPHome add-on
example of my mideahvac.yaml:
# Example configuration entry
substitutions:
node_name: mideahvac # Use a unique name.
node_id: midea_ac # Use a unique id.
friendly_node_name: "Midea AC"
esphome:
name: ${node_name}
comment: ${friendly_node_name}
platform: ESP8266
board: esp01_1m
wifi:
ssid: <mywifissid>
password: <mywifipassword>
domain: <my own domain name> # Optional in case mdns .local doesn't work
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: ${node_name} " FB"
password: "fallback"
captive_portal:
# Enable Home Assistant API
api:
password: <myapipassword> # Optional in case set on HA esphome addon
# Enable Over The Air updates
ota:
# Disable logging
logger:
baud_rate: 0
logs:
sensor: ERROR
duty_cycle: ERROR
binary_sensor: ERROR
light: ERROR
# Optional, Enable Web server; start internal webserver so it can be used stand-alone
web_server:
port: 80
# Optional, Sync time with Home Assistant.
time:
- platform: homeassistant
id: ${node_id}_homeassistant_time
# Binary Sensors.
binary_sensor:
- platform: status
name: ${friendly_node_name} Connection Status
id: ${node_id}_connection_status
# Sensors.
sensor:
- platform: uptime
name: Uptime Sensor
id: ${node_id}_uptime_sensor
icon: mdi:clock-start
update_interval: 60s
- platform: wifi_signal
name: ${friendly_node_name} WiFi Signal
id: ${node_id}_wifi_signal
update_interval: 60s
- platform: template
name: ${friendly_node_name} fan mode
id: ${node_id}_fan_mode
internal: true
update_interval: 10s
lambda: !lambda |-
if (id(${node_id}_my_climate).fan_mode == 2)
{
if (id(${node_id}_select_fan_mode).state != "Auto")
{
auto call = id(${node_id}_select_fan_mode).make_call();
call.set_option("Auto");
call.perform();
}
}
else if (id(${node_id}_my_climate).fan_mode == 3)
{
if (id(${node_id}_select_fan_mode).state != "Low")
{
auto call = id(${node_id}_select_fan_mode).make_call();
call.set_option("Low");
call.perform();
}
}
else if (id(${node_id}_my_climate).fan_mode == 4)
{
if (id(${node_id}_select_fan_mode).state != "Medium")
{
auto call = id(${node_id}_select_fan_mode).make_call();
call.set_option("Medium");
call.perform();
}
}
else if (id(${node_id}_my_climate).fan_mode == 5)
{
if (id(${node_id}_select_fan_mode).state != "High")
{
auto call = id(${node_id}_select_fan_mode).make_call();
call.set_option("High");
call.perform();
}
}
return id(${node_id}_my_climate).fan_mode;
# Text Sensors.
text_sensor:
- platform: version
name: ${friendly_node_name} ESPHome Version
id: ${node_id}_esphome_version
- platform: wifi_info
ip_address:
name: ${friendly_node_name} IP Address
id: ${node_id}_ip_address
icon: mdi:ip-network
# Select.
select:
- platform: template
name: "Fan mode"
id: ${node_id}_select_fan_mode
icon: mdi:fan
optimistic: true
options:
- Auto
- Low
- Medium
- High
on_value:
then:
- lambda: |-
auto call = id(${node_id}_my_climate).make_call();
call.set_fan_mode(x.c_str());
call.perform();
# Switches.
switch:
- platform: restart
name: ${friendly_node_name} Restart
id: ${node_id}_restart
icon: "mdi:restart"
- platform: shutdown
name: ${friendly_node_name} Shutdown
id: ${node_id}_shutdown
- platform: safe_mode
name: ${friendly_node_name} Restart (Safe Mode)"
id: ${node_id}_safe_mode
- platform: template
name: ${friendly_node_name} Beeper
icon: mdi:volume-source
id: ${node_id}_beeper
restore_state: true
optimistic: true
turn_on_action:
midea_ac.beeper_on:
turn_off_action:
midea_ac.beeper_off:
# Define UART pinout
uart:
tx_pin: 1
rx_pin: 3
baud_rate: 9600
climate:
- platform: midea
id: ${node_id}_my_climate # Use a unique id
name: ${node_name} # Use a unique name
# Optional settings overrides.
period: 2s # Optional
timeout: 4s # Optional
num_attempts: 3 # Optional
visual: # Optional
min_temperature: 17 °C # min: 17
max_temperature: 30 °C # max: 30
temperature_step: 0.5 °C # min: 0.5
autoconf = true # Optional
# All capabilities in the section below are detected when autoconf = true:
supported_modes:
- FAN_ONLY
- HEAT_COOL
- COOL
- HEAT
- DRY
custom_fan_modes:
- SILENT
- TURBO
supported_presets: # All capabilities in this section detected by autoconf.
- ECO
- BOOST
- SLEEP
custom_presets: # All capabilities in this section detected by autoconf.
- FREEZE_PROTECTION
supported_swing_modes:
- VERTICAL
- HORIZONTAL
- BOTH
outdoor_temperature: # Optional. Create outdoor unit temperature sensor (may display incorrect values after long inactivity).
name: "Temp"
power_usage: # Optional. Create power usage sensor (only for devices that support this feature).
name: "Power"
humidity_setpoint: # Optional. Create indoor humidity sensor.
name: "Humidity"
A full overview of parameters can be found here
Checking size /data/mideahvac/.pioenvs/mideahvac/firmware.elf
RAM: [===== ] 45.2% (used 37064 bytes from 81920 bytes)
Flash: [==== ] 40.1% (used 411128 bytes from 1023984 bytes)
Creating BIN file "/data/mideahvac/.pioenvs/mideahvac/firmware.bin" using "/root/.platformio/packages/framework-arduinoespressif8266/bootloaders/eboot/eboot.elf" and "/data/mideahvac/.pioenvs/mideahvac/firmware.elf"
========================= [SUCCESS] Took 8.98 seconds =========================
INFO Successfully compiled program.
OTA works for me nowadays(which was not the case when i used the dev repository).
But, if it fails, you can also compile it on HA, and then download and flash it over ser2usb,
Or compile the bins on W10 and flash it using the serial2usb com-port.
Below my command lines used to compile on W10:
cd c:\workshop\esphome
pip install esphome
pip install esphomeflasher
pip install --upgrade git+ https://github.com/esphome/esphome
esphome mideahvac.yaml wizard
esphome mideahvac.yaml compile
esphomeflasher
using the compiled C:\_workshop\esphome\mideahvac\.pioenvs\mideahvac\firmware.bin
Assuming you already installed python
More info here:
PS: If you have a Midea branded AC which uses an osk102/103 wifi module, and it doesn’t work (or works partially), please contact the Midea-msmart development team on Telegram and they will try to fix it😉