Xiaomi Mi Air Purifier (Xiaomi Mi IO)

yes, power in the device description it is called “Air Purifier-Switch Status” I think
I created the database file in an automated way from the device description, instead of manually trying to make the entries. That’s why the the descriptions is different from what you may be used to.
Once the functionality is working fine and the format is stable, we can always rename the channels to be more descriptive, like in this case change it to something like “Power”

it should send these if changed
set_properties [{“did”:“On”,“piid”:2,“siid”:2,“value”:true}] #ON
set_properties [{“did”:“On”,“piid”:2,“siid”:2,“value”:false}] #OFF

Tried to set the mode and then an ON & OFF. Here is what I got:

17:43:18.548 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Sending command set_properties[2]
17:43:18.588 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:10793,“method”:“set_properties”,“params”:[2]} -> 192.xxx.xxx.218 (Device: 10212739 token: XXXXXXXXXXXXXXXX Queue: 13)
17:43:18.596 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Periodic update for ‘miio:generic:10212739’ (miio:basic)
17:43:18.645 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Skipping periodic update for ‘miio:generic:10212739’. 13 elements in queue.

17:43:30.827 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for 10212739 type: SET_PROPERTIES, result: {}, fullresponse: {“id”:10793,“error”:{“code”:-9999,“message”:“user ack timeout”}}
17:43:30.833 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Error received: {“code”:-9999,“message”:“user ack timeout”}


19:38:54.318 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Sending command set_properties[“false”]
19:38:54.330 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:2149,“method”:“set_properties”,“params”:[“false”]} -> 192.xxx.xxx.218 (Device: 10212739 token: XXXXXXXXXXXXXXXX Queue: 1)

19:38:58.480 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for 10212739 type: SET_PROPERTIES, result: {}, fullresponse: {“id”:2149,“error”:{“code”:-9999,“message”:“user ack timeout”}}
19:38:58.486 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Error received: {“code”:-9999,“message”:“user ack timeout”}

19:39:00.223 [DEBUG] [iio.internal.handler.MiIoBasicHandler] - Sending command set_properties[“false”]
19:39:00.251 [DEBUG] [rnal.transport.MiIoAsyncCommunication] - Command added to Queue {“id”:2178,“method”:“set_properties”,“params”:[“false”]} -> 192.xxx.xxx.218 (Device: 10212739 token: XXXXXXXXXXXXXXXX Queue: 24)

19:39:16.090 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Received response for 10212739 type: SET_PROPERTIES, result: {}, fullresponse: {“id”:2178,“error”:{“code”:-9999,“message”:“user ack timeout”}}
19:39:16.097 [DEBUG] [.internal.handler.MiIoAbstractHandler] - Error received: {“code”:-9999,“message”:“user ack timeout”}

Should I remove the binding and the thing again and reinstall?

yes, I think that is best. Download the latest once more, I’ve uploaded it once more just to be sure there was no old version on my side.

also with those command highlighted earlier, make sure no old version of the binding is still running/installed.

OK, removed everything and in the process I discovered a jar in the add-ons directory. Removed it but now I’m having difficulties activating your binding. Here is what I get:

openhab> bundle:list | grep “Xiaomi Mi IO”
329 │ Active │ 80 │ 2.5.4.202004180412 │ openHAB Add-ons :: Bundles :: Xiaomi Mi IO Binding
330 │ Installed │ 80 │ 2.5.4.202004171947 │ openHAB Add-ons :: Bundles :: Xiaomi Mi IO Binding

I tried all combinations, installing it before and after the binding. If I remove the one installed by the binding it looks like there is no binding. I’m thinking the other one gets “Active” because of the version? Perhaps you need to increase your version?
With this setup I get back to square one, the device gets discovered as unsupported with only 2 channels.

Soooo, I manually stopped 329 and started 330 (yours), rediscovered the thing and all works like a charm! Thanks a lot!

Great.
Do all the properties have value?

All of them except:

  • Device Information-Current Firmware Version
  • Device Information-Device Manufacturer
  • Device Information-Device Model
  • Device Information-Device Serial Number

All the rest are populated and apparently valid values.

The support for these devices has been merged into the regular snapshot version of openhab now.

I have just installed my purifier with the following miio version 2.5.4.202004171947.

Some of the values seem to not show up.

Mode is blank in sitemap gui.
Humidity is blank
Air quality index is blank but Average air quality index shows a value.
Led status/buzzer status works OK.
Filter max life, blank.
Filter hours used, blank.
Run time, blank.
Motor speed, shows correct value.
Filter life, blank.
Favorite level, ok.
Temperature, blank.
Purified volume, blank.

Is this how it should be for this model/current state of binding or have something gone wrong? Ideas?

EDIT: Nevermind. For some reason the items configuration suggested on the Xiaomi Wifi devices (Mi IO) - Bindings | openHAB page does not include units etc. For example [%.0f].

I don’t know why it worked on some values but not others.

However “Run time” and “Purified volume” still seems to only return me “-” (i.e blank). Filter hours used seems to give me back “0”, but filter life indicates 45 so it most definitely have been on for more than 0 hours.

X-ray mind reading mode on… initiating search for unknown model…failing… 15+ models possible

I have a Air Purifier Pro which has the same problems.
But I think this is not some problem with the binding. Previously these Items showed correct values for me, but now I also have “Purified Volume” - “-” etc… However if I look into the Mi Home app, these were also removed from there, in earlier versions these info could be seen there also. So maybe they removed these attributes completely…

Haha, sorry, I have the 2S model. But as @rkrisi mentions it is possible that these have been removed. Makes sense as there would otherwise be no point to have added these channels/items in the first place.

What you could try is to go to the debug mode and see what is the response from the device.
If it is having in the log a line like “propery xx returning null is it supported?” than indeed it is most likely no longer supported.

What you can do is find the database file (json) for your device here download it.

Put it into your conf/misc/miio folder (the miio part you probably need to make) You can than remove the non-functional channels. If it works well, please share the new file

Hi Marcel, I’ve upgraded my main instance to latest SNAPSHOT. The problem is the purifier and the Roborock get discovered but without channels. WHat could be the cause? Reinstalled the binding several times, rediscovered the things but with no change.
Am I getting the wrong version of the binding?

343 │ Active │ 80 │ 2.5.4 │ openHAB Add-ons :: Bundles :: Xiaomi Mi IO Binding

Thanks

Are you using text config? if so, add to your thing config a model="your model like rockrobo.vacuum.xx.v" entry. I think something changed in the framework that this is now required…

for this binding specifically, I don’t use text. On the other instance it worked fine after the upgrade. I was able to see and control both Mi AirPurifier 3 and the roborock.

Hi Everyone,

First of all, thanks you so much to all these people who is part of this great community.

I’m using openhab for few month and i’m very interested to include my Xiaomi air purifier 3h. In my case, I always create all “things” using config files instead of PapperUI because from my point of view is easier restore all configurations if I need to make a clean installation.

Using this config files I have a lot of Xiaomi things working but when I include the airpurifier, the state changes to online but there aren’t channels aviable:

Let me share the current configuration

Bundle version:

openhab> bundle:list | grep Xiaomi
212 │ Active │  80 │ 2.5.4                   │ openHAB Add-ons :: Bundles :: Xiaomi Mi Smart Home Binding
213 │ Active │  80 │ 2.5.4                   │ openHAB Add-ons :: Bundles :: Xiaomi Mi IO Binding   

airpurifier.things

Thing miio:basic:airpurifier "Airpurifier" [ host="*ip*", token="*token*", deviceId="*DEVICEID*"] 

I also tried to change from miio:basic to generic with the same result

airpurifier.items

Group G_airpurifier "Mi Air Purifier 3" <status>
Switch power "Power" (G_airpurifier) {channel="miio:basic:airpurifier:On"}
String mode "Mode" (G_airpurifier) {channel="miio:basic:airpurifier:Mode"}
...

I can’t find any error o event log about this device.

I have tried import this device using paperUI with xiaomi cloud connect and all channels works without troubles.

Openhab version 2.5.4 – docker image e2193568a5fc

suggest to include your model=“xxx” in your thing file

Do you mean it is working if you configure with paperUI? If so, see above wrt to the model and as well check if the token in paperUI matches the token in your thing config.

If not, share a debug log file of the binding output to see what is going on.
log:set debug org.openhab.binding.miio
log:tail org.openhab.binding.miio

Hi @marcel_verpaalen including model=“XX” solves the problem! Now it’s working.

Thanks so much!

for the humidifier

any clues what SET HUMIDITY is for?
I thought it might be like when this value is reached by current humidity it stop.s
but its not … so I have not found what it is for actually.

Also for Depth I am not certain… the waterlevel in millimeter?

cheers