Midea AC LAN

repository·main·Indexed 23 days ago

https://github.com/wuwentao/midea_ac_lan

A Home Assistant integration for local area network control of Midea M-Smart appliances. It supports automatic discovery and manual configuration for various devices, including air conditioners, smart lights, bath heaters, sink dishwashers, and integrated ceiling fans. The integration provides device-specific sensors, switches, and the midea_ac_lan.set_attribute service for advanced attribute control.

Tokens
34.4K
Snippets
68
Records
151
Agent score
82%

What's inside midea_ac_lan

  1. Features and Entities of MDV Wi-Fi Controller

    main

    The MDV Wi-Fi Controller supports target temperature, run mode, fan mode, swing mode, and auxiliary heating. It provides a primary climate entity and several extra sensor and switch entities for granular control.

    Supported Run-Modes

    • Sleep Mode
    • ECO Mode

    Available Entities

    Default Entity:

    • climate.{DEVICEID}_climate: Climate control entity.

    Extra Entities:

    • sensor.{DEVICEID}_indoor_temperature: Indoor temperature sensor.
    • switch.{DEVICEID}_aux_heating: Auxiliary heating switch.
    • switch.{DEVICEID}_eco_mode: ECO Mode switch.
    • switch.{DEVICEID}_night_light: Night Light switch.
    • switch.{DEVICEID}_power: Power switch.
    • switch.{DEVICEID}_sleep_mode: Sleep Mode switch.
    • switch.{DEVICEID}_swing: Swing switch.
  2. Supported features for Central AC Wi-Fi Controller

    main

    The Central AC Wi-Fi Controller supports the following control capabilities:

    • Target temperature setting
    • Operating mode setting
    • Fan mode setting
    • Swing mode setting
    • Auxiliary heating (电辅热)

    Supported modes include:

    • Sleep mode (睡眠模式)
    • Energy saving mode (节能模式)
  3. Install Midea AC LAN using a script

    main

    You can install the integration by running the following command in your Home Assistant Terminal or via an SSH add-on:

    wget -O - https://github.com/wuwentao/midea_ac_lan/raw/main/scripts/install.sh | ARCHIVE_TAG=latest bash -
  4. Add Midea appliances via manual configuration

    main

    If automatic discovery fails, you can add an appliance manually by providing the following details:

    • Appliance code
    • Appliance type (e.g., AC, FA, FC)
    • IP address
    • Port (default is 6444)
    • Protocol version
    • Token
    • Key
  5. Retrieve device JSON configuration

    main

    When a device is successfully added, midea_ac_lan saves its configuration to HA storage. This file prevents duplicate additions and allows for future re-addition via cloud login if the device is removed from the UI.

    To retrieve the JSON config:

    1. SSH into your HAOS device.
    2. Navigate to the storage directory: cd /config/.storage/midea_ac_lan.
    3. List files with ls and view a specific device config using cat <device_id>.json.
  6. Manually edit midea_ac_lan or midealocal source code

    main

    If you need to test changes from a GitHub PR or manual edits:

    Editing midea_ac_lan (Custom Component)

    1. SSH into HAOS.
    2. Navigate to the component directory: cd /config/custom_components/midea_ac_lan.
    3. Edit files using vi, scp, or wget. Example: Overwriting a file from a GitHub raw URL: wget https://github.com/.../light.py -O light.py
    4. Restart HA to load changes.

    Editing midealocal (Python Package)

    midealocal is installed in the HA Core Docker container.

    1. SSH into HAOS.
    2. Enter the container: docker exec -it homeassistant /bin/bash.
    3. Find the installation path: pip show midea-local (e.g., /usr/local/lib/python3.13/site-packages).
    4. Navigate to the midealocal directory within that path.
    5. Edit files using vi, scp, or wget.
    6. Restart HA to load changes.
    # Example: Overwriting midea_ac_lan source
    cd /config/custom_components/midea_ac_lan
    wget https://github.com/wuwentao/midea_ac_lan/raw/xxxx/custom_components/midea_ac_lan/light.py -O light.py
    
    # Example: Overwriting midealocal source
    docker exec -it homeassistant /bin/bash
    cd /usr/local/lib/python3.13/site-packages/midealocal/
    wget https://github.com/midea-lan/midea-local/raw/xxxx/midealocal/devices/cd/message.py -O devices/cd/message.py
  7. Upgrade from georgezhao2010/midea_ac_lan

    main

    To migrate from the old georgezhao2010/midea_ac_lan integration:

    1. Remove the old integration.
    2. Install the current midea_ac_lan integration and reboot HA.
    3. Your devices should persist. If they are not visible, go to Settings -> Devices & Services -> Midea AC LAN -> Devices -> CONFIGURE to re-enable them.
  8. Migrate from georgezhao2010/midea_ac_lan

    main

    If you are migrating from the older georgezhao2010/midea_ac_lan integration:

    1. Delete the old integration.
    2. Install the current integration (wuwentao/midea_ac_lan) and restart HA.
    3. Existing devices should remain; you do not need to re-discover them.
    4. If entities (switches/sensors) disappear, go to [Settings] -> [Device & services] -> [Midea AC LAN] -> [Device], select the device, and click [Options] to re-enable them.
  9. Use Midea AC as a Fresh Air System

    main

    Some Midea "Central Fresh Air" products use the standard AC protocol. If your fresh air machine is identified as an AC unit, you can control it by using the fan entities specifically marked for fresh air:

    • fan.{DEVICEID}_fresh_air (Fresh Air)
    • fan.{DEVICEID}_fresh_air_exhaust (Exhaust)