midea-dishwasher-api
Python client for Midea dishwashers (device_type 0xE1, plugin v5).
Implements the AA … E1 application protocol and the LAN V3 transport (8370
handshake + AES-128-CBC + SHA-256, with the inner V2 5A5A framing).
Installation
pip install midea-dishwasher-api
Quick start
from midea_dishwasher_api import BrightLevel, Client, Mode, V3Transport
with V3Transport(
host="192.168.5.100",
device_id=151732606394621,
token=bytes.fromhex("..."), # 64 bytes
key=bytes.fromhex("..."), # 32 bytes
) as transport:
client = Client(send=transport)
status = client.query_status()
print(status.machine_state) # MachineState.POWER_ON / POWER_OFF
print(status.cycle_state) # CycleState.IDLE / WORK / ORDER / ...
print(status.left_time) # minutes remaining (only while WORK)
print(status.door_closed)
print(status.bright_lack) # is the rinse aid empty?
client.power_on()
client.start_to_work(mode=Mode.ECO, extra_drying=True)
client.set_bright(BrightLevel.L3)
client.cancel_work()
client.power_off()
Control methods return nothing: the machine takes a few seconds to reflect a
change. Call query_status() whenever fresh state is needed.
API
Client
| Method | Effect |
|---|---|
query_status() -> DishwasherStatus |
Read the current state |
power_on() |
Power the machine on |
power_off() |
Power it off |
cancel_work() |
Cancel the cycle / return to idle |
start_to_work(mode, extra_drying=False) |
Start a cycle |
set_bright(level: BrightLevel) |
Set the rinse-aid level (1–5) |
extra_drying is keyword-only.
DishwasherStatus
Fields decoded from a response:
machine_state: MachineState | None—POWER_ON/POWER_OFFcycle_state: CycleState | None—idle,order,work,error, ...mode: Mode | int | None— the running program;Nonewhen there is none (0x00),intfor program bytes not yet catalogued in the enumextra_drying: bool— "extra drying" flag of the current programwash_stage: WashStage | int | None—IDLE,PRE_WASH,MAIN_WASH,RINSE,DRY,FINISHerror_code: ErrorCode | int—NONE,WATER_SUPPLY,HEATING,OVERFLOW,WATER_VALVEleft_time: int | None— minutes remaining (only set whencycle_state == WORK)door_closed: boolbright_lack: bool— the rinse aid ran outbright: BrightLevel | int | None— current rinse-aid level (1–5)softwater_lack: bool— the salt for water softening ran outtemperature: int | None— tub water temperature in °C
Available programs (Mode)
AUTO, INTENSIVE, NORMAL, ECO, GLASS, NINETY_MIN, ONE_HOUR,
RAPID, SOAK, THREE_IN_ONE, HYGIENE, QUIET, PARTY, FRUIT.
Custom transport
Client accepts any Callable[[bytes], bytes] as send. Useful for tests
with a mock transport, for a cloud integration, or for a pipeline of your own:
from midea_dishwasher_api.protocol import assemble_frame
def fake_send(frame: bytes) -> bytes:
return assemble_frame(b"...", 0x02)
client = Client(send=fake_send)
The low-level codec (assemble_frame, parse_frame, build_query,
build_control, make_sum) and the status decoder (decode_response) live in
midea_dishwasher_api.protocol and midea_dishwasher_api.state respectively —
outside the public __init__.py.
Obtaining token and key
They are per-device credentials issued by the Midea cloud. Use one of the
existing tools (midea-msmart, midea-beautiful-air, midea-discover) to
extract them from your app account.
Support
This SDK is built and maintained on personal time, on hardware bought for the purpose. If it is useful to you, consider sponsoring the work — it keeps the devices, the testing and the releases coming.
License
MIT — see LICENSE.
Metadata
Release files for midea-dishwasher-api 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| midea_dishwasher_api-2.0.1.tar.gz | 24.9 kB | Without provenance | Details for midea_dishwasher_api-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| midea_dishwasher_api-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for midea_dishwasher_api-2.0.1-py3-none-any.whl |
Total release size: 49.1 kB
Release files / midea_dishwasher_api-2.0.1.tar.gz
| Download URL | midea_dishwasher_api-2.0.1.tar.gz |
|---|---|
| Size | 24.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f608bb0d4401e2ceb23621cb5b2aa4849d8e4d5df28e49dfeab98c701869dcb0
|
|
BLAKE2b-256 checksum How to use checksums |
805e677db635804f9bfe6273a2f251094edc3c865f56cdd36a23a90b23ca5aec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / midea_dishwasher_api-2.0.1-py3-none-any.whl
| Download URL | midea_dishwasher_api-2.0.1-py3-none-any.whl |
|---|---|
| Size | 24.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b9a5219f05cd83e29646839e7aa617dc35808171dc21867a0924fc799ac3c48
|
|
BLAKE2b-256 checksum How to use checksums |
f23545a925d6aa53c6e3a9991af4885ce11dce77a2d47da05a834e83ea9fd3ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for midea-dishwasher-api 2.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.