Skip to main content

midea-dishwasher-api

CI PyPI

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 | NonePOWER_ON / POWER_OFF
  • cycle_state: CycleState | Noneidle, order, work, error, ...
  • mode: Mode | int | None — the running program; None when there is none (0x00), int for program bytes not yet catalogued in the enum
  • extra_drying: bool — "extra drying" flag of the current program
  • wash_stage: WashStage | int | NoneIDLE, PRE_WASH, MAIN_WASH, RINSE, DRY, FINISH
  • error_code: ErrorCode | intNONE, WATER_SUPPLY, HEATING, OVERFLOW, WATER_VALVE
  • left_time: int | None — minutes remaining (only set when cycle_state == WORK)
  • door_closed: bool
  • bright_lack: bool — the rinse aid ran out
  • bright: BrightLevel | int | None — current rinse-aid level (1–5)

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.

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

midea_dishwasher_api-1.3.6.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

midea_dishwasher_api-1.3.6-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file midea_dishwasher_api-1.3.6.tar.gz.

File metadata

  • Download URL: midea_dishwasher_api-1.3.6.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for midea_dishwasher_api-1.3.6.tar.gz
Algorithm Hash digest
SHA256 632ae8b3ec3130839de308dd3ba813831231b2cdcb18cbac0407556cf05bdaed
MD5 a93324184818356eecbdb5e757ba9ac7
BLAKE2b-256 692a1be9a3bd8bfa8f7efa57e2798b9cb52d0fb20ed77f4c5aacf4d9e7950867

See more details on using hashes here.

File details

Details for the file midea_dishwasher_api-1.3.6-py3-none-any.whl.

File metadata

File hashes

Hashes for midea_dishwasher_api-1.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2db4ef0d5aeb1b75d34148760c04a486dbb3213fa9302b01a22df34a164fc8f8
MD5 2db11936c5981ea28c9c758e7493a1fe
BLAKE2b-256 eda7bb97eee22a760a48f3130a35d11d895831c205f1850e4f04c4b98a3f8331

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.3.6 This release

2 files

1.3.5

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page