Skip to content

Add support for Xiaomi Smart Dehumidifier Lite (xiaomi.derh.lite) - #2083

Open
bramkragten wants to merge 4 commits into
rytilahti:masterfrom
bramkragten:add-xiaomi-derh-lite
Open

Add support for Xiaomi Smart Dehumidifier Lite (xiaomi.derh.lite)#2083
bramkragten wants to merge 4 commits into
rytilahti:masterfrom
bramkragten:add-xiaomi-derh-lite

Conversation

@bramkragten

@bramkragten bramkragten commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Adds a new MiotDevice implementation for the Xiaomi Smart Dehumidifier Lite (xiaomi.derh.lite), addressing #2059.

The device uses the MIoT protocol. The mapping follows the published spec (urn:miot-spec-v2:device:dehumidifier:0000A02D:xiaomi-lite:1) and every property has been verified against real hardware (firmware 1.0.3@BL602).

Supported functionality

  • Power on/off
  • Operation mode (Smart / Sleep / Clothes Drying)
  • Target humidity (40–70%)
  • Current relative humidity and temperature
  • Fault status (with a convenience tank_full property)
  • Buzzer
  • Indicator light (on/off + brightness: Off / Dim / Bright)
  • Child lock (physical controls locked)
  • Dry-after-off + remaining dry time + warming-up state
  • Delayed turn off (on/off, time, remaining time)

Notes

  • New device layout: miio/integrations/xiaomi/dehumidifier/.
  • Registration is automatic via _mappings; DeviceFactory.class_for_model("xiaomi.derh.lite") resolves to AirDehumidifierMiot.

Testing

  • Added tests/test_airdehumidifier_miot.py (status parsing + all setters + validation). All tests pass; ruff check/ruff format clean.
  • Verified against a real xiaomi.derh.lite: every mapped property returns code 0, status() parses correctly, and the write path (set_target_humidity) was confirmed. The Delay service (siid 8) is present on the device and is included.

Fixes #2059

Add a new MiotDevice implementation for the Xiaomi Smart Dehumidifier
Lite (xiaomi.derh.lite), covering power, operation mode, target
humidity, current humidity/temperature, buzzer, indicator light
(on/off + brightness), child lock and the dry-after-off feature, plus
fault reporting with a convenience tank-full property.

The MIoT mapping follows the published spec
(urn:miot-spec-v2:device:dehumidifier:0000A02D:xiaomi-lite:1). The
Delay service (siid 8) from the spec is intentionally omitted, since
the real device does not appear to expose it.

Fixes rytilahti#2059
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.54%. Comparing base (9a00e08) to head (e356719).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2083      +/-   ##
==========================================
+ Coverage   84.31%   84.54%   +0.22%     
==========================================
  Files         201      204       +3     
  Lines       20656    20953     +297     
  Branches     1121     1124       +3     
==========================================
+ Hits        17417    17714     +297     
  Misses       3047     3047              
  Partials      192      192              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Testing against a real xiaomi.derh.lite (firmware 1.0.3@BL602) shows the
Delay service (siid 8: delay, delay_time, delay_remain_time) responds with
code 0 for all properties, so it is part of the device after all. The
earlier omission was based on a community integration that simply did not
map it; the published spec was correct.

All mapped properties confirmed against real hardware via status().
@bramkragten
bramkragten marked this pull request as ready for review July 17, 2026 13:21
bramkragten and others added 2 commits July 28, 2026 13:40
Wrap an over-length ValueError message (ruff-format) and add tests for
the power-off state and the invalid-value fallbacks (fault, mode,
led_brightness), bringing the new module to 100% coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Xiaomi Smart Dehumidifier Lite

1 participant