00Three steps
The whole install, if nothing goes wrong.
custom_components by hand.Even in LAN-only mode the flow asks for the Meiju account. That is how it obtains the device list, the token/key used by V3 encryption, and the Lua protocol file. After setup, control traffic stays on the LAN; the account is not used as a relay.
01How it connects
One integration, three channels. Setup probes them in a fixed order and records the winner in the config entry.
| Channel | State comes from | Control goes through | Used when |
|---|---|---|---|
| ☁️ Cloud V2 | Meiju Thing Model V2 polling | Cloud property writes | The appliance is not on the LAN, or its local protocol is unsupported |
| 🖥️ LAN | Device push + periodic polling | Direct TCP to the appliance | Preferred: lowest latency, works without internet |
| ☁️ Cloud V1 | Meiju Lua state query | Meiju Lua control API | Last resort when both above fail |
The probe order is Cloud V2 → LAN → Cloud V1. The chosen channel is written into the
config entry and shown as a badge next to the model on the device page, so you can tell at a
glance whether a device is being polled locally or through the cloud. Cloud-only appliances
exist: the smart fish tank 0x58 is Cloud V2 only and has no local TCP control.
Cloud is used at setup time and for the optional statistics sensors. Day-to-day switch, climate and sensor traffic for a LAN device goes straight to the appliance over TCP — port 6444 by default.
02Before you start
- Home Assistant 2025.12.4 or newer. That is the integration's stated requirement; this box runs Core
2026.11.1on HAOS19.0.dev0. - A Meiju (美的美居) account with the appliances already bound in the phone app. The integration reads the same account; it does not pair appliances itself.
- Same L2 network. Discovery uses a broadcast; HA and the appliances must be on the same subnet unless you scan by IP (see below).
- An owner/admin account in Home Assistant. Adding an integration is an admin action.
- Internet access from Home Assistant for the first setup: Python requirements (
lupa,pycryptodome) install from PyPI, and the Meiju API is used for login and token retrieval. - A GitHub account only for the Marketplace route. The manual route needs no GitHub login, but it does need a way into
/config— Samba, File editor, or SSH.
03Install
Two routes to the same folder: the native Marketplace, or a manual copy for when a GitHub device code is not available.
Method A: Marketplace (recommended)
-
Open Settings → Marketplace
Go to Settings → Marketplace. This is the built-in community store in 2026.11; it is
not under Devices & services. Search for Midea.
Live capture · Settings → Marketplace, filtered on Midea. The catalog has several Midea integrations, but not Cyborg2017/midea_smart_home -
Add the repository from its GitHub link
This repository is not in the catalog, so use Add from link in the top right and paste
https://github.com/Cyborg2017/midea_smart_home, then choose Add.
Live capture · Add from a GitHub link, the route for a repository that is not in the catalog - Connect GitHub when asked Adding a repository needs a GitHub connection. Home Assistant shows a URL and a one-time code: open the URL, enter the code, and the flow continues on its own. No GitHub password is entered in Home Assistant, and the connection can be revoked later in GitHub.
-
Install, then restart
Install the repository in the Marketplace. It writes the integration into
custom_componentsand leaves a restart required repair; restart Core to finish. The integration does not appear in Add integration until that restart.
Method B: manual copy (no GitHub device code)
Use this when the customer has no GitHub account, cannot complete the device-code step, or needs a specific branch or tag. The repository is public, so the ZIP downloads in a browser without signing in.
-
Get the component folder
Download the repository ZIP from GitHub and unzip it — the folder you need is
custom_components/midea_smart_home. The release page also publishes amidea_smart_home.zipasset. This box was installed fromfeat/cloud-hybrid26.11.1; a release ZIP gives the current version. -
Put it inside custom_components
On HAOS the config folder is exposed in three ways: the Samba share
config, the File editor add-on, or SSH. Dropmidea_smart_homeintocustom_components/. Over SSH from a workstation:# from the unzipped repository root; create the parent if it does not exist yet scp -r custom_components/midea_smart_home \ root@<HA-IP>:/mnt/data/supervisor/homeassistant/custom_components/
The host path
/mnt/data/supervisor/homeassistant/is the Core container's/config; Samba and File editor show the same folder as/config. -
Restart Core
Use Settings → System → Restart, or from an SSH session:
ha core restart
-
Confirm the layout
The only path that matters is
custom_components/midea_smart_home/manifest.json. If that file is one level deeper, the integration will not load.
The destination must be custom_components/midea_smart_home/manifest.json. A common mistake is copying the whole cloned repository, which produces custom_components/midea_smart_home/midea_smart_home/… and a “cannot find integration” error.
Manual copies are not tracked by the Marketplace. To update one, replace the folder with a newer ZIP and restart.
Check that Home Assistant found it
Open Settings → Devices & services → Add integration and search for Midea. The custom integration is listed as Midea Smart Home with a puzzle-piece icon (the other, plain “Midea” entry is a different, built-in integration).
The config flow imports lupa, which Home Assistant installs the first time the
flow starts. On this box that meant a “Starting the Midea Smart Home configuration wizard”
spinner for roughly two minutes while lupa 2.8 downloaded. Later attempts are instant.
04Add devices
The integration offers three entry modes. Hybrid is the right default; the other two exist for a reason.
Hybrid mode (recommended)
- Open the sign-in form In Settings → Devices & services, choose Add integration, search Midea Smart Home, then pick ☁️ Hybrid Mode.
-
Enter the Meiju account and scan settings
Same phone number or email as the Meiju app. Scan Address defaults to
auto; Scan Mode defaults toBroadcast. Leave both alone for a normal flat LAN.
Live capture · hybrid sign-in. The password is only used to obtain tokens and the device list - Let it scan, then pick appliances After login the flow probes every appliance and prefilters the ones already configured. The picker lists each candidate with its type and protocol, and starts with all of them ticked.
-
Let it fetch token and key
V3 devices are encrypted with a per-device
tokenandkey. The flow retrieves them from the Meiju API while it adds the appliance. V1/V2 devices skip this step. -
Finish
The config entry is named
Midea | {account} | {home name}. The appliances appear as devices, with their entities grouped underneath.
| Scan Address | What it does | When to use it |
|---|---|---|
auto | Detects the interface and scans its subnet | Default; flat LAN |
Router IP, e.g. 192.168.3.1 | Scans the whole /24 | Broadcast is filtered or devices are on Wi-Fi |
Device IP, e.g. 192.168.3.153 | Probes a single appliance | One stubborn device; also the fastest retry |
Broadcast is quick but relies on the appliance answering a UDP broadcast. If the list is repeatedly incomplete, switch Scan Mode to Unicast and expect the scan to take longer.
LAN mode
The same form and the same account, but only the local probe runs: no Cloud V2, no Cloud V1 fallback. Choose it when you want to be certain that nothing is added through the cloud and are willing to lose the appliances that only speak cloud.
Manual mode (no account)
Manual mode never logs in. It scans the LAN for the device ID, IP, type and protocol, then asks you for the missing pieces: token, key and the full path to the Lua protocol file. Useful for an isolated network, for a device already documented elsewhere, or when the Meiju account cannot be used.
Some appliances answer locally but have no entity mapping yet. They are added over LAN and
tagged ⏳ Pending support in the device list instead of falling back to Cloud V1. The
repository's docs/guides/AI_DEVICE_GUIDE.md explains how to collect diagnostics and
contribute a mapping.
05Entities and badges
What a device turns into, and how to read the channel it is using.
The integration ships these platforms. Which of them a given appliance exposes depends on its mapping:
binary_sensor button climate cover fan humidifier light lock number select sensor switch text time update vacuum water_heater
| Badge | Meaning | Latency / dependency |
|---|---|---|
| 🖥️ Lan | Direct TCP to the appliance; state pushed by the device, plus polling where the protocol needs it | Fastest; works if the internet is down |
| ☁️ Cloud V2 | Thing Model properties through Meiju | Polling interval; needs the cloud |
| ☁️ Cloud V1 | Lua state through Meiju | Polling interval; needs the cloud |
| ⏳ Pending support | LAN reachable, no mapping yet | Entities are limited until a mapping lands |
The badge follows the model name on the device page. A twin-drum washer (0xD9)
is a special case: its two drums are polled alternately, which is why it has its own polling
interval in the options. The full 38-family matrix is maintained in the
upstream README;
the common ones are lights and fan lights, curtains, air conditioners, washers and dryers,
dishwashers, water heaters, hoods, ovens, fridges and robot vacuums.
| Entity | What it is for |
|---|---|
update | Integration version check against GitHub Releases; can download and install from inside HA |
sensor | State, plus the cloud statistics sensors described below |
climate, water_heater | Air conditioners, heat pumps, gas and electric water heaters |
vacuum, lock, cover | Robot vacuums, smart locks, curtains and drying racks |
06Cloud statistics
Separate from live state, and available for both LAN and cloud devices.
The integration creates additional sensor entities from the Meiju statistics API.
They refresh on their own schedule (default: every 6 hours) and are not driven by the device's
live connection. Only the appliance families below expose them:
| Code | Appliance | Metrics | Unit |
|---|---|---|---|
0xB6 | Range hood | Fan / oil cup / filter cleanliness | % |
0xAC | Air conditioner | Yesterday / month / year energy | kWh |
0xDB | Front-load washer | Today / week / month energy and water | kWh, L |
0xE1 | Dishwasher | Today / week / month / year energy and water | kWh, L |
0xE3 | Gas water heater | Today / month water and gas | L, m³ |
The numbers are calculated by Meiju, not by Home Assistant. Some values only appear after the cloud settles the day, which is why air conditioners report yesterday's energy rather than today's. A hood exposes cleanliness only — the cloud has no energy API for that family.
07Options
Open the integration entry → Configure. Everything below lives there.
| Option | What it does |
|---|---|
| Add device (LAN / auto / manual) | Adds more appliances later. LAN scans locally, auto logs in and probes in priority order, manual takes the details by hand. |
| Update account | Changes the Meiju credentials and re-reads the device list. |
| Sync cloud | Refreshes names, rooms and model numbers from Meiju, then reloads the entry. |
| Backup configuration | Exports the integration config and device mappings. |
| Fetch diagnostics | Downloads a diagnostics file for an issue report. |
| Clear cache | Removes the Lua and JSON caches; they are downloaded again. Current files are backed up to .storage/midea_smart_home-backup. |
| Configure polling | Per-device intervals: local polling (off, 1–30 s), cloud query (3–30 s), and the 0xD9 twin-drum interval (1–5 s). |
| Configure notifications | Whether to send a persistent notification when an appliance goes offline or comes back. |
| Configure update check | Off / 12 h / 24 h GitHub release check. A check also runs on every restart regardless of this setting. |
It removes downloaded protocol files, not the config entry. If you are chasing a broken entry, delete the entry and add it again — then clear the cache if you also want a fresh Lua download.
08Verify
Three checks that separate “installed” from “working”.
| Check | Where | Expected |
|---|---|---|
| Entry exists | Settings → Devices & services | Midea Smart Home entry named Midea | …, no “Failed setup” badge |
| Channel is correct | Device page → model line | 🖥️ Lan for a same-subnet appliance; ☁️ if it only speaks cloud |
| State moves | Device page or Overview | Toggling a switch or changing a setpoint is reflected within the polling interval |
| No import errors | Settings → System → Logs | No No module named 'lupa', no repeated reconnect tracebacks |
To see the integration's own reasoning, raise its log level:
logger:
default: warning
logs:
custom_components.midea_smart_home: debug
Log lines carry a module prefix ([cloud], [device], [coord], [config_flow]) and, for device traffic, the appliance name in brackets — filter on those rather than scrolling the whole file.
09Troubleshooting
Match the symptom. Most failures are network reachability, not the integration.
| Symptom | Likely cause | Fix |
|---|---|---|
| No appliances found | Broadcast blocked, different subnet, appliance powered off or not bound to the account | Set Scan Address to the router IP or the appliance IP; switch to Unicast; confirm the device is in the Meiju app and on the same VLAN |
| V3 token/key comes back empty | Meiju API unreachable from HA | From the HA container, resolve and reach mapp.appsmb.com; check DNS and outbound 443, then retry the flow |
Device is V2 0x0110 and “TCP communication is not supported” |
The newer V2 broadcast carries no usable local control | Use hybrid mode so the appliance is added as Cloud V2; do not force LAN |
| “Add integration” spins and then errors | lupa could not install (PyPI/DNS) |
Check Settings → System → Logs for uv pip install; fix DNS or retry when the network is back. The component stays installed |
| Added, then offline | DHCP handed the appliance a new IP, or port 6444 is filtered | Pin a lease/static IP for the appliance; verify nc -z <ip> 6444 from the HA host |
| Duplicate or ghost devices | An earlier entry still holds the same device ID | Remove the old config entry, run Clear cache, then add again |
| Cloud statistics stay empty | The model has no statistics API, or the day has not settled yet | Wait for the 6-hour refresh; confirm the appliance family is in the table above |
| No “Midea Smart Home” in the add dialog | Folder nesting, wrong Core version, or Home Assistant not restarted | Confirm /config/custom_components/midea_smart_home/manifest.json exists; restart Core; check the startup warning line |
Before opening an issue, use Fetch diagnostics in the options, then attach the file plus a log excerpt covering the same timestamp. Strip tokens, keys, account names and LAN IPs before posting publicly.
10References
- Cyborg2017/midea_smart_home — source, issues, releases and the supported-device matrix.
- Home Assistant · Marketplace — the native store, Add from link and the GitHub connection used on this page.
- Home Assistant · Integration manifest — requirements, version and config-flow rules.
- Prior art: midea_auto_cloud, midea_ac_lan, midea-local.