External integration - Midea (air conditioners, local)

Hi everyone! :waving_hand:

Another climate giant: Midea. You can find it under its own brand, but also at Comfee, Carrier, some Toshiba ranges… If your air conditioner is configured in the SmartHome / MSmartHome or NetHome Plus app, there’s a good chance it will work with this integration, locally.

What it does

  • One air conditioning unit per unit, with only what it claims to know how to do:
    • on/off, mode, setpoint to the half-degree, ventilation, oscillation;
    • indoor and outdoor temperatures;
    • eco, turbo, night modes;
    • consumption and humidity, when the unit provides them.
  • Automatic search for units on the network, or their IP address.
  • Two triggers: « clean filter » and « unit error » (with its code).
  • A scene action: set the air conditioner (mode, setpoint, and ventilation all at once).
  • A « Air Conditioner » widget: temperatures, on/off, setpoint +/− and a « Mode and Ventilation » button.
  • In French, English, German, and Spanish.

The cool thing

30 °C outside and no one at home → pre-cool the room one hour before returning
Filter to clean → small reminder on Saturday morning
Unit error → notification with the code

Installation

:warning: Gladys 5.2 minimum (for the « Mode and Ventilation » button of the widget).

It will arrive in the store at the next indexer pass. In the meantime: Integrations → Install from GitHub, with GitHub - guim31/gladys-midea: Midea air conditioners and rebrands for Gladys Assistant, over the local network · GitHub

  1. Start the search, or enter the IP address of your units.
  2. Discovery tab: add them.

Recent air conditioners (« V3 ») need a key that Midea keeps in its cloud. The integration retrieves it only once, like the free libraries that inspire it, then everything happens locally.

Honest small reservations

  • Developed without the hardware: the protocol was verified frame by frame against the reference library (msmart-ng), but nothing ran on a real air conditioner. Your feedback is welcome :folded_hands:
  • Dehumidifiers and other Midea devices are not managed: only air conditioners.

It relies on msmart-ng and midea-local (MIT): thanks to their authors! Like the previous ones, developed with Claude Code. Independent project, not affiliated with Midea.

Repository: GitHub - guim31/gladys-midea: Midea air conditioners and rebrands for Gladys Assistant, over the local network · GitHub

Hello @guim31

Incredible development pace! Thanks for everything.

I have a Comfee dehumidifier at home that I use with the SmartHome app.

So I got curious and your integration detects the device, but flags it as unsupported.

[midea-hub] Midea appliance of type 0xa1 at 192.168.1.xx: not supported

Not surprising since it’s not an air conditioner.

For reference, I have this model COMFEE' Déshumidificateur Easy Dry 20L/jour, 4 Modes, Deshumidificateur d'air Connecté, Réservoire 3L, Sèche-Linge, Fonction Swing, Pour pièce de 40㎡/100m : Amazon.fr: Cuisine et Maison.

How complicated would it be to extend support for this type of device?

In any case, thanks again for everything.

David.

I’m adding a screenshot of the app with the different options available on this product

Hi @guim31 and everyone!

I have a Midea air/water heat pump (Wi-Fi « Heat Pump Wi-Fi Controller » 171H120F, device type 0xC3, protocol V3). The search found it but declared it « not supported », even though the HACS Midea AC LAN integration controls it very well locally. I opened issue #5, then prepared (with Claude Code, like the rest) what’s needed to add it:

1. Heat Pumps 0xC3 – PR #6
Protocol ported from midea-local, with test vectors generated by running midea-local itself. A « Heat Pump » device with:

  • per zone (1 or 2): mode (Off / Heat / Cold / Auto), setpoint, operating state, water law;
  • hot water: on/off, setpoint, tank temperature, heating in progress;
  • outdoor, water flow, and return temperatures, water flow rate and pressure;
  • eco, silent, and super silent modes;
  • compressor, defrosting, electric backup, compressor hours, error code as displayed by the command (E8, P1…);
  • power, energy consumed, and heat produced (for COP).

Setpoints remain within the limits announced by the device. The tank backup, quick hot water, and disinfection are not controllable, for safety. New setting: manually enter the V3 token and key (those kept by Midea AC LAN), if the cloud doesn’t provide them.

2. Diagnostics – Next PR
Like on Shelly, Tuya, Zendure, or Netatmo: « Device Diagnostics » and « Test a Device » in the Configuration tab. They produce a report ready to paste into an issue: no secrets, masked credentials, raw frames decoded. « Test a Device » on an IP address also says which Midea device responds, which will help with new types.

3. Widget – Next PR
The widget becomes « Midea Device » and adapts to the device type. For a heat pump, it displays:

  • the setpoint, the tank, and the outdoor temperature;
  • what’s running (zones, hot water, compressor);
  • the power and COP;
  • the zone 1 on/off buttons, setpoint ±1 °C, and « Settings ».

4. Gladys Core Side – PR #3243
Gladys didn’t have a category for thermal energy. I proposed thermal-energy-sensor (heat supplied: power and index in kWh), also useful for heat meters and boilers, and which doesn’t mix with electricity in energy views.

Everything is tested (unit tests, lint, store validator), but not yet on the real device: I’ll give you feedback as soon as I’ve tried it at home.

@davidm50: I’ll look at your Comfee dehumidifier (type 0xA1) next. midea-local already manages it, so it should be able to follow the same path. I’ll keep you posted here.

@guim31, @davidm50, it’s on the way: support for Midea/Comfee dehumidifiers (type 0xA1) is in a PR at guim31 (list of PRs).

Your device becomes a « Dehumidifier » with:

  • on/off;
  • mode (Setpoint, Continuous, Auto, Clothes Drying, Shoe Drying), fan speed, and target humidity (35 to 85 %);
  • humidity, temperature;
  • tank level and « full tank »;
  • child lock, ionizer, oscillation, and drain pump if your model has one.

The « Clean Filter » trigger also works.

It’s written according to midea-local, but without the device: if you want to test before publication, from a machine on your network:
git clone -b claude/dazzling-meitner-w2m3gq-dehumidifier https://github.com/Terdious/gladys-midea && cd gladys-midea && npm ci && node scripts/probe.mjs --host 192.168.1.xx
The script only reads the device. If it’s in V3, it retrieves its key from the Midea cloud. Paste the output here (it contains neither the key nor the full identifier), which will allow us to verify the decoding.

Hi @Terdious, thanks so much for all your hard work! :slightly_smiling_face:

Everything is merged and published in 1.2.0:

  • air/water heat pumps (0xC3), with their view in the widget, now called « Midea Device »;
  • dehumidifiers Midea/Comfee (0xA1);
  • the two diagnostic actions, very useful for the next « my device is not recognized ».

While reviewing, I added two safeguards for the heat pumps: when switching from hot to cold, the setpoint is brought back within the limits of the new mode (no more 45 °C sent with the cold mode), and in auto, it’s the limits of the mode that the heat pump actually applies. A lost response on first contact no longer freezes the heat pump protocol either.

As your PRs were stacked, I replayed them on the main branch (#11, #12, #13): your code is taken up, I just resolved the conflicts between them.

@davidm50: your dehumidifier should be recognized with 1.2.0 (update from Gladys, then « Search »). Let us know if it works!

Hello @guim31 and @Terdious,

Thank you both for these updates. Here is the result with 1.2.0 on my end.

The search:

1 device(s) Midea, 0 respond:
- Dehumidifier 5552 (192.168.1.XX, V3): no Midea cloud key

And the test result, using the IP:

Midea unit test
Generated: 2026-10-20T19:05:16.280Z
Integration version: 1.2.0 (Node v24.22.0)
Identifiers: masked (ids and serial numbers shortened, local addresses hidden). No token, key nor password.

Dehumidifier 5552 (dehumidifier 0xA1, V3, model 00000Q13)
id 15…44, serial 00…00, address <local-ip>:6444
added to Gladys: no, keys: missing (cloud)
answering: not yet, last read never, failures in a row: 0
last error: no key for Dehumidifier 5552
capabilities answered: no, summary: -
state: -
energy: -, humidity: -

Reading the unit now (queries only, no command)
skipped: this V3 unit has no token and key yet (see "keys" above)

Hope this helps :slight_smile: .

Have a good evening.

David.

Thanks @davidm50, the report helps a lot :slightly_smiling_face:

Your dehumidifier is well recognized (0xA1, V3). What’s blocking it is the key: a V3 device needs a token and a key that the integration fetches from the Midea cloud, and the public account it uses didn’t find any for yours. Three things to try, in the integration settings:

  1. Cloud region: change it (DE, US, KR), save, then relaunch « Search ».
  2. If your device is in the NetHome Plus app, put that account and its password in « NetHome Plus Account ».
  3. If you have Home Assistant with Midea AC LAN, the token:key pair it keeps goes into « Manually Entered Token and Key ».

Let me know how it goes, and send the test report again if it still doesn’t work.

Thanks for your quick reply @guim31

For the integration, I have Asia, Europe, and the Americas. All tested, same result.

The field descriptions do indeed show NetHome Plus, but since I have a Comfee, it’s the « SmartHome » app that I use.

On HA, I use the « Midea » integration (this one Midea - Home Assistant ). In this integration, I have clearly specified the name of the application used (SmartHome) and a connection with email/password.

On HA:

  • Choose how you want to authenticate → Login mode = « Your account credentials »
  • Account = email / Password = password / Server = SmartHome

When I validate, I get a notification on the app telling me that a new device has connected.

Thanks @davidm50, that was it: the integration was only looking for the key on the NetHome Plus cloud, not on the SmartHome app cloud.

This is fixed in 1.3.0 (update from Gladys). In the configuration:

  • Cloud Application: choose « SmartHome (MSmartHome, Comfee…) »;
  • Cloud Account and its password: your SmartHome account, like in Home Assistant.

Save, then restart « Search ». Even without your account, the integration now tries both clouds. Let me know if your dehumidifier responds :slightly_smiling_face:

Hello @guim31,

Too strong!

Midea unit test Generated: 2026-10-21T06:42:32.920Z Integration version: 1.3.0 (Node v24.22.0) Identifiers: masked (ids and serial numbers shortened, local addresses hidden). No token, key nor password. Dehumidifier 5552 (dehumidifier 0xA1, V3, model 00000Q13) id 15…44, serial 00…00, address <local-ip>:6444 added to Gladys: yes, keys: present (cloud SmartHome) answering: yes, last read 1 s ago, failures in a row: 0 last error: - capabilities answered: yes, summary: {"known":true,"pump":false} state: {"power":false,"mode":3,"fanSpeed":60,"targetHumidity":35,"childLock":false,"anion":false,"pump":false,"pumpEnabled":false,"filterAlert":false,"tank":0,"waterLevelSet":0,"tankFull":false,"humidity":72,"temperature":22,"swing":false} energy: -, humidity: - Reading the unit now (queries only, no command) capabilities (0xB5): sent aa0fac00000000000003b50100c0715b no answer within the timeout capabilities, second page: sent aa10ac00000000000003b5010101c1e9df no answer within the timeout state (0x41): sent aa21ac00000000000003418100ff03ff000200000000000000000000000003c24165 no answer within the timeout energy (group 4): sent aa20ac000000000000034121014400000000000000000000000000000000c34087 no answer within the timeout humidity (group 5): sent aa20ac000000000000034121014500000000000000000000000000000000c4a124 no answer within the timeout

All actions and information feedback are good! :ok_hand:

We just need a small widget for this type of device :smiley:

Midea device
This widget does not yet have a view for this type of device: use its device box.

Super, thanks for the test @davidm50! :slightly_smiling_face: Glad the SmartHome cloud unlocked your dehumidifier.

For the widget, noted: a “dehumidifier” view (humidity, setpoint, mode, tank, on/off) in the Midea Device widget. I’ll look into it.