homebridge-miot icon indicating copy to clipboard operation
homebridge-miot copied to clipboard

Support for Smart Air Purifier 4 no longer works

Open sasojadrovski opened this issue 1 year ago • 12 comments

Describe the bug Since a few days ago, Homebridge continuously reports issues with the Smart Air Purifier 4. It looks like Homebridge cannot connect to the device. I did try with forcing Mi Cloud, but the issue persists.

Expected behavior Smart Air Purifier 4 should work as expected.

Your config.json

{
    "name": "Air Purifier",
    "ip": "192.168.2.44",
    "token": "XXX", // redacted for security reasons
    "deviceId": "YYY", // redacted for security reasons
    "model": "zhimi.airp.mb5a",
    "pollingInterval": 10,
    "deepDebugLog": false,
    "silentLog": false,
    "deviceEnabled": true,
    "micloud": {
        "country": "de",
        "forceMiCloud": false
    },
    "onlyMainService": false,
    "buzzerControl": false,
    "ledControl": false,
    "childLockControl": false,
    "modeControl": false,
    "suppressAutoServiceCreation": [
        "illumination"
    ],
    "fanLevelControl": false,
    "screenControl": false
}

Debug log

[9/13/2024, 3:46:00 PM] [homebridge-miot] [Air Purifier] Device found! Setting up miot device from local connection!
[9/13/2024, 3:46:00 PM] [homebridge-miot] [Air Purifier] Connected to device: zhimi.airp.mb5a
[9/13/2024, 3:46:00 PM] [homebridge-miot] [Air Purifier] Doing initial property fetch.
[9/13/2024, 3:46:12 PM] [homebridge-miot] [Air Purifier] Starting property polling.
[9/13/2024, 3:46:54 PM] [homebridge-miot] [Air Purifier] Poll failed 4 times in a row! Stopping polling and trying to reconnect! Reason: Error: Call to device timed out

Will enable deep debug logs if needed. Above is an output without.

Screenshots N/A

Additional context N/A

sasojadrovski avatar Sep 13 '24 13:09 sasojadrovski

That might be a strong indicator that the token changed. You would need to re-fetch the token. Also if you specify forceMiCloud then you also have to specify the account credentials for login.

merdok avatar Sep 14 '24 10:09 merdok

Thanks @merdok,

How do I re-fetch the token?

I know I have to add my credentials if I force using Mi Cloud.

sasojadrovski avatar Sep 14 '24 10:09 sasojadrovski

Please check the README for the credentials!

The token you can retrieve as usual

merdok avatar Sep 14 '24 11:09 merdok

Been having issues with the Xiaomi Air Purifier 4 Pro. Deleted and re-added and saw these lines.

Actually I woke up today and my two Air Purifiers in the Plugin disappeared. Had to add them back. After adding back, one of them, the 4 Pro showed that error.

Screenshot 2024-10-09 at 11 47 00

gnz-ori avatar Oct 09 '24 03:10 gnz-ori

So after a few tries I got it back. But there seems to be a bug with the "general device settings" where even when the controls are not selected, they still appear as part of the created device.

Please refer to the screenshots:

Screenshot 2024-10-09 at 11 58 56 Screenshot 2024-10-09 at 11 58 06

gnz-ori avatar Oct 09 '24 04:10 gnz-ori

What would you expect to disappear? From your screenshot it looks as it supposed to...

merdok avatar Oct 09 '24 08:10 merdok

What would you expect to disappear? From your screenshot it looks as it supposed to...

  1. If you noticed in the first screenshot, none of those are ticked (selected). And they all appear. What I'm trying to do is simplify what I see in Apple Home, which is without the screen toggle options, while maintaining the On/Off button, temperature, humidity, air quality and filter maintenance like my other air purifiers.

  2. Or was it the case the functions will be automatically created and cannot be removed or customised to which the user prefer?

  3. I forgot to mention another bug. So I set my air purifiers to turn on at certain time of the day e.g. 10am and 3am. So when they turn on by its automated instruction in Apple Home, 3/4 of the time the air purifiers will go into the max volume mode (volume 3) instead of going into auto mode by default when it's turn on (they are always on auto even before being automated to turn off).

arktiknova avatar Oct 09 '24 10:10 arktiknova

Screen is a device specific setting so you will not find it under the generic section, but I guess under the air purifier section.

merdok avatar Oct 09 '24 13:10 merdok

Oh yeah you are right. Just checked btw after you pointed it out but I don't have them ticked too. Basically everything automatically appeared even when they are not ticked (selected). Are those supports to appear despite not being selected?

Screenshot 2024-10-09 at 21 47 34

arktiknova avatar Oct 09 '24 13:10 arktiknova

You should try to tick it and save, and afterwards untick it, save again and re-check.

merdok avatar Oct 09 '24 14:10 merdok

Finally got the time to give it a try. I did as suggested and it finally worked after two reboots. Thank you!

Edit: However, I now noticed my second unit, the Xiaomi Air Purifier 2 now doesn't show the temperature and humidity data now after the two reboots (and a few more to make sure). Nothing was touched on that unit's settings.

Screenshot 2024-10-10 at 14 55 50

arktiknova avatar Oct 10 '24 06:10 arktiknova

Good to hear. About your other device you have to check what the log says, possibility it cannot connect to the device.

merdok avatar Oct 10 '24 08:10 merdok