Skip to content

This is a custom component for Home Assistant to integrate the Midea Air Conditioners via the Local area network.

License

Notifications You must be signed in to change notification settings

nesror/midea-ac-py

 
 

Repository files navigation

This is a custom component for Home Assistant to integrate the Midea Air Conditioners via the Local area network.

Tested with hass version 0.110.2

Attention!!!

Version >= 0.1.27, the device naming rules have changed.

Installation

Install from HACS

Type hacs_badge

Search the HACS Store for midea_ac

Install manually

  1. Clone this repo
  2. Place the custom_components/midea_ac folder into your custom_components folder

Configuration

Configuration variables:

key description example
platform (Required) The platform name. midea_ac
host (Required) Midea AC Device's IP Address. 192.168.1.100
id (Required) Midea AC Device's applianceId. 123456789012345
token (Optional) Midea AC Device's token, V3 is required. ACEDDA53831AE5DC...(Length 128)
k1 (Optional) Midea AC Device's k1, V3 is required. CFFA10FC...(Length 64)
temp_step (Optional) Step size for temperature set point, default is 1.0 0.5
prompt_tone (Optional) Prompt Tone, default is true. false
keep_last_known_online_state (Optional) Set this to true if you see too many unavailable in log. true
use_fan_only_workaround (Optional) Set this to true if you need to turn off device updates because they turn device on and to fan_only true

Example configuration.yaml:

climate:
  - platform: midea_ac
    host: 192.168.1.100
    id: 123456789012345
    # v3 need token and id
    # token: ACEDDA53831AE5DC...(Length 128)
    # k1: CFFA10FC...(Length 64)

How to Get ApplianceId:

  • Use command midea-discover to discover midea devices on the host in the same LAN. Note: This component only supports devices with model 0xac (air conditioner) and words supported in the output. V3(8370) need to get token and k1.
    pip3 install msmart
    midea-discover

How to Get Token and K1:

  • If your device's version is V2, please ignore.
  • Use Android phone or emulator (which can use bridge, such as LDPlayer) must be in the same LAN as the device.
  • If you are in China, please install meiju-gettoken-only-china.apk.
  • If you are OverSea(Outside China), please install Midea-Air-gettoken-only-oversea.apk.
  • I just changed the log level of APP, you can modify it yourself.
  • You may need to be patient, it may take 5-30 minutes, you can reopen or relogin APP.
  • Use adb,filter from logcat: shell:
    adb logcat | grep doKeyAgree
    cmd:
    adb logcat | findstr doKeyAgree

Buy me a cup of coffee

Your donation will make me work better for this project.

About

This is a custom component for Home Assistant to integrate the Midea Air Conditioners via the Local area network.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 97.3%
  • Shell 2.7%