Skip to content

lumi.acpartner.v2/v3 HVAC modes only show off due to case-sensitive mode mapping #1748

Description

@FelixHuoEZ

Describe the Bug / 描述问题

旧款 Aqara 空调伴侣在 Xiaomi Home 集成中只暴露 off 一个 HVAC mode,导致 Home Assistant 的空调实体无法选择制冷、制热、除湿、送风或自动模式。

受影响设备:

  • lumi.acpartner.v3, firmware 1.4.1_164
  • lumi.acpartner.v2, firmware 1.4.1_156

当前集成版本 v0.4.7 中,这两个设备初始注册出的实体能力是:

climate.lumi_cn_315216429_v3  hvac_modes: off
climate.lumi_cn_56586283_v2   hvac_modes: off

同环境下新款 lumi.acpartner.mcn02 正常:

climate.lumi_cn_977056164_mcn02  hvac_modes: auto,cool,dry,heat,fan_only,off

排查后发现,lumi.acpartner.v2/v3 的 MIoT spec 中 air-conditioner service 的 mode property 有完整枚举,但 name 是首字母大写:

0 Auto
1 Cool
2 Dry
3 Heat
4 Fan

lumi.acpartner.mcn02 的同类枚举是小写:

0 auto
1 cool
2 dry
3 heat
4 fan

climate.py 当前 HVAC mode 映射只匹配小写的 auto/cool/heat/dry/fan/heat_cool,所以旧款 Auto/Cool/Dry/Heat/Fan 没有被映射,最终只剩 off

我在本地做了一个最小验证补丁:对 item.name 做 lower-case 规范化,并在需要时 fallback 到 item.description 识别中文描述。重启 Home Assistant Core 后,两个旧款实体恢复为:

climate.lumi_cn_315216429_v3  hvac_modes: auto,cool,dry,heat,fan_only,off
climate.lumi_cn_56586283_v2   hvac_modes: auto,cool,dry,heat,fan_only,off

How to Reproduce / 复现步骤

  1. 在 Home Assistant 中通过 Xiaomi Home 集成添加 lumi.acpartner.v2lumi.acpartner.v3
  2. 查看对应 climate.* entity 的 capabilities
  3. HVAC modes 只有 off
  4. 对比 MIoT spec,可以看到设备实际有 Auto/Cool/Dry/Heat/Fan mode 枚举

Expected Behavior / 预期结果

lumi.acpartner.v2/v3 应该和 lumi.acpartner.mcn02 一样暴露完整 HVAC mode:

auto,cool,dry,heat,fan_only,off

建议修复方向:

  • HVAC mode 映射时对 item.name 做 case-insensitive 处理
  • 或者在 MIoT spec 解析阶段统一把 value-list item name slugify/lower-case
  • 如果缓存/翻译路径下 item.name 可能变成中文描述,也可以 fallback 到 item.description 识别 自动/制冷/制热/除湿/送风

Reproduce Time / 问题复现的时间点

2026-07-04 17:30 Asia/Shanghai

Home Assistant Logs / 系统日志

No related error log. The integration loads successfully; the issue is that HVAC mode capabilities are under-mapped.

Log Timezone / 日志时区

Asia/Shanghai

Home Assistant Core Version / Home Assistant Core 版本

2026.7.0

Home Assistant Operation System Version / Home Assistant Operation System 版本

18.1

Xiaomi Home Integration Version / 米家集成版本

v0.4.7

Additional Context / 其他说明

This looks like a compatibility issue for older MIoT specs whose value-list names use Auto/Cool/Dry/Heat/Fan instead of lower-case names. A local patch that normalizes the mode key verified the diagnosis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions