skillfed

msmart-ng

A Python library for local control of Midea (and associated brands) smart air conditioners.

msmart-ng v2026.8.0 106.2K downloads/30d#12,664 on PyPI135
Permissive license MIT Active released

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-ng

uv

uv add msmart-ng

poetry

poetry add msmart-ng

Installing 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

Operating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Home Automation

Tags

midea air conditioner controllocal smart ac devicemidea device discoveryasync air conditioner apihome automation acmidea branded applianceslocal network device control
home-automationlocal-controlasync-io

More Home Automation packages