msmart-ng
A Python library for local control of Midea (and associated brands) smart air conditioners.
What it is and what it does
msmart-ng is a Python library that lets you discover and control Midea air conditioners and devices from associated brands (Artic King, Toshiba, NetHome Plus, and others) on your local network. It provides both a command-line tool and a Python API with full async/await support, so you can integrate AC control into automation systems without blocking. The library works entirely locally once initialized—no internet connection needed for day-to-day operation, though V3 devices require a one-time cloud authentication to retrieve credentials.
The package depends on httpx for HTTP communication and pycryptodome for device authentication. It supports device discovery via broadcast, querying device state and capabilities, and sending control commands (temperature, mode, fan speed, etc.). A CLI tool is included for manual discovery and control, and Docker support is available for containerized deployments.
Use it for:
- Integrate Midea AC units into a home automation setup for centralized smart-home control.
- Build a custom automation script that adjusts AC temperature based on time of day or occupancy sensors.
- Discover and monitor all Midea devices on a local network without relying on cloud services.
- Control multiple air conditioners programmatically in a commercial or multi-unit residential setting.
- Create a CLI tool or web dashboard for manual AC control on a local network.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python library for discovering and controlling Midea brand air conditioners and associated devices over the local network using async/await, with support for both CLI and programmatic interfaces.
Yes. The library is actively maintained, has low install friction, carries a permissive MIT license, and solves a real problem for anyone with Midea AC units who wants local control without cloud dependency. No known vulnerabilities. Suitable for both personal automation and Home Assistant integration.
Install
msmart-ng on PyPI
pip
pip install msmart-nguv
uv add msmart-ngpoetry
poetry add msmart-ngInstalling msmart-ng
Before you install
Low install friction with only two runtime dependencies (httpx and pycryptodome). Actively maintained with a recent release and steady commit activity. Supports current Python versions (3.10 through 3.14).
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both personal and commercial projects.
Quickstart
pip install msmart-ng
from msmart.device import AirConditioner as AC
device = AC(ip='DEVICE_IP', port=6444, device_id=int(DEVICE_ID))
await device.refresh()
Requires Python 3.10 or later. For V3 devices, Midea Cloud authentication is needed once to retrieve token and key; local control then works offline.
Verify before relying
- Whether all Midea and associated-brand models are equally well-supported or if some device types have known limitations beyond V1.
- Performance characteristics when controlling multiple devices simultaneously or on networks with high latency.
- Whether the library handles device disconnections and reconnection gracefully in long-running applications.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — httpx, pycryptodome |
| Maintenance | actively maintained — 9 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 106,155/month — #12,664 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: msmart_ng-2026.8.0-py3-none-any.whl
Tags
More Home Automation packages
Represents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
homeassistantHome Assistant is an open-source home…
permissive · top 5,000 on PyPI
python-statemachineDefines finite state machines and statecharts…
permissive · top 5,000 on PyPI
btsocketA Python library for controlling BlueZ…
permissive · top 15,000 on PyPI
aiohomematicAn async Python library for controlling and…
permissive · top 15,000 on PyPI
hass-web-proxy-libProvides base classes and utilities for Home…
permissive · top 15,000 on PyPI
midea-localControl Midea M-Smart appliances over local…
permissive · top 15,000 on PyPI
py-ccm15Provides an async Python interface to…
permissive · top 15,000 on PyPI
advantage-airAsync Python wrapper for Advantage Air's MyAir…
permissive · top 15,000 on PyPI
greeclimateAsync Python library for discovering,…
copyleft · top 15,000 on PyPI
pydaikinPyDaikin provides a Python library and CLI for…
copyleft · top 15,000 on PyPI
pyaehw4a1Provides a Python interface to control Hisense…
permissive · top 15,000 on PyPI
python-izonePython library for controlling iZone air…
copyleft · top 15,000 on PyPI
pyvesyncAsynchronous Python library to discover,…
permissive · top 15,000 on PyPI
aioairzone-cloudAsync Python library for controlling Airzone…
permissive · top 15,000 on PyPI
librouteroslibrouteros is a Python client library for the…
copyleft · top 15,000 on PyPI