skillfed

midea-local

Control your Midea M-Smart appliances via local area network

midea-local v8.0.1 307.8K downloads/30d#7,773 on PyPI96
Permissive license MIT Active released

What it is and what it does

Midea-local is a Python library for controlling Midea M-Smart appliances directly over your local network without relying on cloud services. It discovers devices on the LAN, establishes authenticated connections using device tokens and keys, and exposes appliance attributes and control methods—such as setting temperature or swing mode on air conditioners—through a unified device interface.

The library handles the low-level protocol details (encryption via pycryptodome, async I/O via aiohttp and aiofiles) and provides both a programmatic API and a command-line tool. It targets Python 3.12+ and has been actively maintained with frequent releases; it's part of a larger ecosystem for Midea device automation.

Use it for:

  • Discover and list all Midea M-Smart appliances on your home network by IP and device type.
  • Build a home automation dashboard that reads and controls AC temperature, swing, and other attributes in real time.
  • Integrate Midea appliances into a broader smart-home system via local-only control without cloud dependency.
  • Automate appliance schedules or responses (e.g., turn off AC when leaving home) using the device control API.
  • Debug or inspect Midea device state and protocol details using the included CLI tool.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Control Midea M-Smart appliances over local network using their native protocol, with device discovery and attribute management.

Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive MIT license. Install it if you own Midea M-Smart appliances and want local-network control without cloud dependency. The main prerequisite is obtaining device tokens and keys from your Midea account, which the documentation does not fully detail—verify that step before committing.

Install

midea-local on PyPI

pip

pip install midea-local

uv

uv add midea-local

poetry

poetry add midea-local

Installing midea-local

Before you install

Low install friction with straightforward async-capable dependencies. Active maintenance with a release within the last day and 96 repository stars; requires Python 3.12 or later.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both personal and commercial projects.

Quickstart

from midealocal.discover import discover
from midealocal.devices import device_selector

# Discover devices on local network
devices = discover()
d = list(devices.values())[0]

# Connect to device with token and key
ac = device_selector(
    name="AC",
    device_id=d['device_id'],
    device_type=d['type'],
    ip_address=d['ip_address'],
    port=d['port'],
    token='...',
    key='...',
    device_protocol=d['protocol'],
    model=d['model'],
    subtype=0,
    customize=""
)
ac.connect()
ac.set_target_temperature(23.0, None)

Requires Python 3.12 or later; token and key credentials from Midea account needed for device authentication.

Verify before relying

  • Whether token and key acquisition process is documented or requires separate Midea account setup steps
  • Supported Midea device types and models beyond the AC examples shown
  • Whether the CLI tool provides a complete alternative to programmatic control

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.12)
Install friction low — pure-Python wheel
Runtime dependencies 8 — aiofiles, aiohttp, colorlog, defusedxml, ifaddr, pycryptodome, platformdirs, typing_extensions
Maintenance actively maintained — 1 days since the last release
Last repo commit
First released
Downloads 307,816/month — #7,773 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: midea_local-8.0.1-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

midea appliance control local networkmidea m-smart lan controllocal midea device discoverymidea ac temperature controlmidea appliance python librarymidea device protocolsmart home midea integration
home-automationlocal-controlappliance-integration

More Networking packages