--- id: midea-local version: "8.0.1" license: MIT license_treatment: permissive maintenance: active --- # midea-local — Control your Midea M-Smart appliances via local area network License: permissive · Maintenance: active · Downloads: 307.8K/mo ## 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 above — 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 pip install midea-local uv add midea-local 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_current - Install friction: low - Maintenance: active - Downloads: 307.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags midea appliance control local network, midea m-smart lan control, local midea device discovery, midea ac temperature control, midea appliance python library, midea device protocol, smart home midea integration, home-automation, local-control, appliance-integration [View on SkillFed](https://skillfed.io/packages/midea-local) · [View on PyPI](https://pypi.org/project/midea-local/)