core: Xiaomi Mi Air Purifier 4 (zhimi.airpurifier.mp4) is not available in Xiaomi Miio Device integration

The problem

The Xiaomi Mi Air Purifier 4 is not available in Xiaomi Miio Device integration: The device model is not known, not able to setup the device using config flow.

What version of Home Assistant Core has the issue?

core-2022.3.1

What was the last working version of Home Assistant Core?

core-2022.3.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Xiaomi Miio

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_miio

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

In core release 3.0, I was able to setup my device(Xiaomi Mi Air Purifier 4) with zhimi.airpurifier.mb4 in the device model dropdown list and its works perfectly fine, however after upgrading core to 3.1, I’m getting these error messages

2022-03-05 18:38:06 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Xiaomi Smart Air Purifier 4 for xiaomi_miio
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 131, in async_setup_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 455, in async_setup_device_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 318, in async_create_miio_device_and_coordinator
2022-03-05 18:40:25 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Xiaomi Smart Air Purifier 4 for xiaomi_miio
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 131, in async_setup_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 455, in async_setup_device_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 318, in async_create_miio_device_and_coordinator
2022-03-05 18:44:42 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Xiaomi Smart Air Purifier 4 for xiaomi_miio
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 131, in async_setup_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 455, in async_setup_device_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 318, in async_create_miio_device_and_coordinator
2022-03-05 20:15:43 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry zhimi.airp.mp4 for xiaomi_miio
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 131, in async_setup_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 455, in async_setup_device_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 318, in async_create_miio_device_and_coordinator
2022-03-05 21:06:40 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry zhimi.airp.mp4 for xiaomi_miio
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 131, in async_setup_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 455, in async_setup_device_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 318, in async_create_miio_device_and_coordinator
2022-03-05 21:09:40 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry zhimi.airp.mp4 for xiaomi_miio
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 131, in async_setup_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 455, in async_setup_device_entry
File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/__init__.py", line 318, in async_create_miio_device_and_coordinator

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 6
  • Comments: 74 (5 by maintainers)

Most upvoted comments

Same for Purifier 4 Pro zhimi.airp.vb4

Any news on this? Still looking for zhimi.airp.rmb1 in home-assistant.

Hello everyone. I came here to kindly ask developers for improving the support for Xiaomi Smart Air Purifier 4 Lite (zhimi.airp.rmb1) model. As others have already reported, currently the integration lacks the support of fan favorite levels and LED brightness.

That being said, I can’t help much with coding, but I’m very happy to test workarounds, temporary fixes, etc. Thanks!

Reported separate bug within python-miio github: https://github.com/rytilahti/python-miio/issues/1752

Favorite level is missing too for zhimi.airp.rmb1 (Xiaomi Purifier 4 Lite) at latest 2022.11.5

zhimi.airpurifier.mp4 is still not supported in 2023.6.1

Hello, dear developers! Please add full support for Xiaomi Smart Air Purifier 4 Lite (zhimi.airp.rmb1). In the version of Home Assistant 2023.2.3 it is not possible to adjust the power level of Favorite, as well as the brightness of the screen. This topic has already been raised, but I still did not understand whether it would be solved or not …?

@glowtape you can follow https://github.com/rytilahti/python-miio/pull/1436 for the next upstream release. If @syssi is too busy to create that release, I’ll create a new release but it would be great to get some testing done pre-release as some refactoring related to the module hierarchy has been done since the last release.

If you know how to run your setup using a git version of that lib, it would be great if you could try the git master and report if you encounter any issues with your devices.

it’s the fan speed i want to change, which it appears I can’t do via home assistant.

On 2023-09-28 20:33, Wayne Khan wrote:

I get your point(ish), but I’d argue the PM2.5 setting is almost a constant. I think 50+ is red, so you’ll always want it to turn on, probably.

Set it once in Xiaomi Home, uninstall and continue in Home Assistant.

On Fri, Sep 29, 2023, at 11:24, Viss wrote:

I guess it sorta defeats the purpose - the whole reason i went through the trouble of buying this unit was so that I could hook it into home assistant and control the fan speeds basedon the pm2.5 measurement.

i can control it through its app - but ideally i’d like to control it entirely via home assistant and wrap its behavior up in automations.

On 2023-09-28 18:33, Wayne Khan wrote:

Oh, you have the va2 like me…

On Fri, Sep 29, 2023, at 09:28, Wayne Khan wrote:

What model do you have?

I’m lucky that it works for me, albeit my va2 has 5 fan speeds and more features (e.g., automatic turn on when the PM2.5 level is higher than n, anion or whatever that is).

On Fri, Sep 29, 2023, at 09:20, Viss wrote:

I can see it there in the states - but when i try to change it “nothing happens”

On 2023-09-28 18:13, Wayne Khan wrote:

Hey Viss,

Try searching for “fan_level”? I’m using the alternative “vb4” model ID I suggested, and I get a 3-speed selector. The official app has more (e.g., a night mode) where the RPM is really low, but 3 is better than none I guess.

On Fri, Sep 29, 2023, at 08:52, Viss wrote:

I ended up doing the cloud configuration one, and i can get pm2.5 out of it, but I can’t seem to figure out how to actually input commands. I want to stop using the built-in xiaomi automations because they dont work very well, and i’d rather control it through HA, but it seems I can’t actually control the fan speed.

and I’d love to do local control and not cloud.

On 2023-09-28 16:11, Wayne Khan wrote:

When I got the “mismatched model” prompt for my zhimi.airp.va2, I tried instead zhimi.airp.vb4, and it worked!

Probably not all the features of my va2 are supported, but I can get at least turn it on/off and get the temperature/humidity/PM2.5 readout, good enough.

For more details, see https://blog.waynekhan.net/posts/2023-09-27-home-assistant-xiaomi-miio-integration/.

– Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you commented.Message ID: @.***>

Links:

[1] https://github.com/home-assistant/core/issues/67694#issuecomment-1740110834 [2] https://github.com/notifications/unsubscribe-auth/AANMYXZWD6CMHXKHLZTZV2DX4X73BANCNFSM5P7VWUEQ

– Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/67694#issuecomment-1740169783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIQ42AYH3D5GOIPIXUOUTX4YLVXANCNFSM5P7VWUEQ. You are receiving this because you commented.Message ID: @.***>

– Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you commented.Message ID: @.***>

Links:

[1] https://github.com/home-assistant/core/issues/67694#issuecomment-1740181503 [2] https://github.com/notifications/unsubscribe-auth/AANMYX3ZHG47YYDLDW4ZSZTX4YOFJANCNFSM5P7VWUEQ

– Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/67694#issuecomment-1740184716, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIQ43QCCFRTSG67S6CEHTX4YO4DANCNFSM5P7VWUEQ. You are receiving this because you commented.Message ID: @.***>

– Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you commented.Message ID: @.***>

Links:

[1] https://github.com/home-assistant/core/issues/67694#issuecomment-1740194839 [2] https://github.com/notifications/unsubscribe-auth/AANMYX3OO2N4EGMW6EHBBO3X4YQQBANCNFSM5P7VWUEQ

– Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/67694#issuecomment-1740257626, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIQ47RRPZ5NHKSCSFV5L3X4Y5N5ANCNFSM5P7VWUEQ. You are receiving this because you commented.Message ID: @.***>

– Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you commented.Message ID: @.***>

Links:

[1] https://github.com/home-assistant/core/issues/67694#issuecomment-1740261743 [2] https://github.com/notifications/unsubscribe-auth/AANMYXYESIIFAII22LYYW3TX4Y6PZANCNFSM5P7VWUEQ

I got it working by installation the Xiaomi MIOT integration. You need to extract the token for the air purifier to add it to HA. Once added, it is quite stable. It shows up as a fan in HomeKit btw.

Can anyone explain, how he gets the air purifier 4 to work with HA. I have all updates, but when i try it, i still get the following message:

2023-01-12 13:26:13.293 ERROR (MainThread) [homeassistant.components.xiaomi_miio] Unsupported device found! Please create an issue at https://github.com/syssi/xiaomi_airpurifier/issues and provide the following data: zhimi.airp.mb5a

LED Brightness is not available on Purifier 4 Pro (zhimi.airp.vb4) Air Purifier 4 pro

I have something named Xiaomi Smart Air Purifier 4 (zhimi.airp.mb5a). In 2022.8.5 it was recognised as an “unknown device”. Although in 2022.9 it does not seem so, instead I have this message after adding the device:

Unsupported device found! Please create an issue at https://github.com/syssi/xiaomi_airpurifier/issues and provide the following data: zhimi.airp.mb5a

Do I have to submit a new issue or it is a part of this one?

@aherbjornsen Purifier 4 lite won’t work until https://github.com/rytilahti/python-miio/pull/1486 released on a next python-miio.

For support without favorite level, https://github.com/home-assistant/core/pull/75949 needs to be merged without enabling that feature and the integration updated later when the dependency is released.

Says device model not known. It seems the xiaomi_miio integration on the HA side implements specific device support, that needs updating.