Skip to content
Get started

Midea Air Conditioner

The midea component creates a Midea air conditioner climate device.

NOTE

This protocol also used by some vendors:

Control is possible with a custom dongle. Example of hardware implementation is IoT Uni Dongle or Midea SLWF-01pro (CloudFree, Tindie).

The Midea air conditioner requires the UART to be configured with baud_rate: 9600. The hardware requires 5V logic levels and does not appear to work with 3.3V logic levels. Use a logic level shifter if building your own dongle.

CAUTION

On some models, the indoor unit’s internal USB port shares its 5V rail with the unit’s display board. WiFi transmit current spikes can sag the rail enough to cause display flicker or dropout.

If you power the module from this port, add a 470-1000µF, 16V (or higher) electrolytic capacitor across 5V/GND at the module’s power input, placed as close to the module as possible. Observe polarity: the positive lead goes to 5V and the striped (negative) lead goes to GND. A reversed electrolytic can fail violently.

# Example configuration entry
# Main settings
climate:
- platform: midea
name: Midea Climate # Use a unique name.
period: 1s # Optional
timeout: 2s # Optional
num_attempts: 3 # Optional
autoconf: true # Autoconfigure most options.
beeper: true # Beep on commands.
visual: # Optional. Example of visual settings override.
min_temperature: 17 °C # min: 17
max_temperature: 30 °C # max: 30
temperature_step: 0.5 °C # min: 0.5
supported_modes: # Optional. All capabilities in this section may be detected by autoconf.
- FAN_ONLY
- HEAT_COOL
- COOL
- HEAT
- DRY
custom_fan_modes: # Optional
- SILENT
- TURBO
supported_presets: # Optional. All capabilities in this section may be detected by autoconf.
- ECO
- BOOST
- SLEEP
custom_presets: # Optional. All capabilities in this section may be detected by autoconf.
- FREEZE_PROTECTION
supported_swing_modes: # Optional
- VERTICAL
- HORIZONTAL
- BOTH
outdoor_temperature: # Optional. Outdoor temperature sensor (may display incorrect values after long inactivity).
name: Temp
power_usage: # Optional. Power usage sensor (only for devices that support this feature).
name: Power
humidity_setpoint: # Optional. Indoor humidity sensor (only for devices that support this feature).
name: Humidity
  • uart_id (Optional, ID): Manually specify the ID of the Uart if you want to use multiple UART buses.

  • transmitter_id (Optional, ID): Defined and used automatically when using Remote Transmitter component for IR commands transmit.

  • display_control (Optional, string): How midea_ac.display_toggle reaches the appliance. UART always sends the UART request. IR always uses the Remote Transmitter, so one has to be configured. AUTO sends the UART request when the appliance reports display control, or when no remote transmitter is configured, and uses IR otherwise. Defaults to AUTO.

  • period (Optional, Time): Minimal period between requests to the appliance. Defaults to 1s.

  • timeout (Optional, Time): Request response timeout until next request attempt. Defaults to 2s.

  • num_attempts (Optional, int): Number of request attempts between 1 and 5 inclusive. Defaults to 3.

  • autoconf (Optional, boolean): Get capabilities automatically. Allows you not to manually define most of the capabilities of the appliance. Defaults to True.

  • beeper (Optional, boolean): Beeper feedback on command. Defaults to False.

  • supported_modes (Optional, list): List of supported modes. Possible values are: HEAT_COOL, COOL, HEAT, DRY, FAN_ONLY.

  • custom_fan_modes (Optional, list): List of supported custom fan modes. Possible values are: SILENT, TURBO.

  • supported_presets (Optional, list): List of supported presets. Possible values are: ECO, BOOST, SLEEP.

  • custom_presets (Optional, list): List of supported custom presets. Possible values are: FREEZE_PROTECTION.

  • supported_swing_modes (Optional, list): List of supported swing modes. Possible values are: VERTICAL, HORIZONTAL, BOTH.

  • outdoor_temperature (Optional): The information for the outdoor temperature sensor.

  • power_usage (Optional): The information for the current power consumption sensor.

  • humidity_setpoint (Optional): The information for the humidity indoor sensor (experimental).

  • All other options from Climate.

This action turn on power. The mode and preset will be restored to the last state before turned off.

on_...:
then:
- midea_ac.power_on:

This action turn off power.

on_...:
then:
- midea_ac.power_off:

This action toggle the power state. Identical to pressing the power button on the remote control.

on_...:
then:
- midea_ac.power_toggle:

This action transmits an IR FollowMe command telling the air conditioner a more accurate room temperature value to be used instead of the internal indoor unit sensor.

on_...:
then:
- midea_ac.follow_me:
temperature: !lambda "return x;"
use_fahrenheit: false
beeper: false

Configuration variables:

  • temperature (Required, float, templatable): Sets the value of an internal temperature sensor. The value will be clamped to the range:

    • 0 °C to 37 °C when use_fahrenheit is false.
    • 32 °F to 99 °F when use_fahrenheit is true.
  • use_fahrenheit (Optional, boolean, templatable): Specifies if the temperature value is in Fahrenheit. When set to true, the temperature is parsed and sent in Fahrenheit. Defaults to false (Celsius).

  • beeper (Optional, boolean, templatable): Sets beep on update. Defaults to false.

This action toggles the display of the appliance over UART or the Remote Transmitter, as chosen by display_control. Many appliances, Mundoclima and Rotenso among them, accept the UART toggle without reporting display control, so in AUTO they get IR whenever a remote transmitter is configured. If such a unit ignores the toggle, set display_control: UART.

on_...:
then:
- midea_ac.display_toggle:

This action adjust the louver by one step. Remote Transmitter required.

on_...:
then:
- midea_ac.swing_step:

This action turn on beeper feedback.

on_...:
then:
- midea_ac.beeper_on:

This action turn off beeper feedback.

on_...:
then:
- midea_ac.beeper_off:

Additional control options using IR commands

Section titled “Additional control options using IR commands”

It is possible to use the FollowMe function and some other features available only through IR commands. Below is an example of how to send FollowMe commands with the values of your sensor using the Remote Transmitter component, as well as toggle the LED display over IR.

# Example configuration entry
remote_transmitter:
pin: GPIO13 # For iot-uni-stick.
carrier_duty_percent: 100% # 50% for IR LED, 100% for direct connect to TSOP IR receiver output.
sensor:
- platform: homeassistant
entity_id: sensor.room_sensor # Sensor from HASS
internal: true
filters:
- throttle: 10s
- heartbeat: 2min # Maximum interval between updates.
- debounce: 1s
on_value:
midea_ac.follow_me:
temperature: !lambda "return x;"
beeper: false # Optional. Beep on update.
# template buttons for sending display control command and swing step actions
button:
- platform: template
name: Display Toggle
icon: mdi:theme-light-dark
on_press:
midea_ac.display_toggle:
- platform: template
name: Swing Step
icon: mdi:tailwind
on_press:
midea_ac.swing_step:
switch:
- platform: template
name: Beeper
icon: mdi:volume-source
optimistic: true
turn_on_action:
midea_ac.beeper_on:
turn_off_action:
midea_ac.beeper_off:

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

Special thanks to the project IRremoteESP8266 for describing the IR protocol.