Xiaomi Mi Air Purifier (Xiaomi Mi IO)

I’ve tested Air Humidifier too.
Working channels:

miio:basic:047D4BE6:power
miio:basic:047D4BE6:mode
miio:basic:047D4BE6:setHumidity
miio:basic:047D4BE6:humidity
miio:basic:047D4BE6:temperature
miio:basic:047D4BE6:translevel
miio:basic:047D4BE6:bright
miio:basic:047D4BE6:buzzer
miio:basic:047D4BE6:usedhours
miio:basic:047D4BE6:childlock

Has someone found a channel with a "no water"warning??

Hi,

I’m still getting error:

2018-04-07 13:39:14.287 [WARN ] [nal.transport.MiIoAsyncCommunication] - Could not parse '{"result":{"life":706814,"cfg_time":0,"token":"xxxx","mac":"xxxxx","fw_ver":"1.2.4_60","hw_ver":"MC200","model":"zhimi.airpurifier.m1","wifi_fw_ver":"SD878x-14.76.36.p79-702.1.0-WM","ap":{"rssi":-66,"ssid":"xxxxx","bssid":"xx:xx:xx:xx:xx:xx"},"netif":{"localIp":"xx.xx.xx.xx","mask":"255.255.255.0","gw":"xx.xx.xx.xx"},"mmfree":27480,,"otu_stat":[0,0,0,0,0,0],"ott_stat":[227655, 0, 32, 11]},"id":416}' <- {"id":416,"method":"miIO.info","params":[]} (Device: 033DE0FB) gave error com.google.gson.stream.MalformedJsonException: Expected name at line 1 column 382 path $.result.mmfree

Anyone has similar problem?

The device is sending invalid json (double comma after mmfree) .
I think I made a hack to avoid this error some time ago. Are you sure you have latest version?

It’s the latest version:
ii openhab2 2.3.0~20180421001534-1 all openhab2
ii openhab2-addons 2.3.0~20180421001534-1 all openhab2-addons

Maybe your update wasn’t submitted? Issue still occurs.

@orzechszek this is in from Feb… it is highly unlikely.
Anyway, let’s track this in the github tracker, hopefully we find a fix for your issue.
Note, the binding needs to update separately from the overall openhab, by uninstalling & re-installing.
I thin you can see the version of the miio binding with bundle:list command

Hi,

I’ve updated my openhab2 and unistall and reinstall bindning. Error still occurs.
My binding version:
248 │ Active │ 80 │ 2.3.0.201803300959 │ https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.miio/2.3.0-SNAPSHOT/org.openhab.binding.miio-2.3.0-SNAPSHOT.jar │ org.openhab.binding.miio

Hi @orzechszek can you update the binding. I expect the issue is resolved

Hi,
Yes, for now everything works fine. Thanks!

Hello Chris69, I am also interested to get the zhimi.humidifier. I am curious, what do you have working with this humidifier?

Hello! Thank you for your wonderful binding!
I have a small problem: I cannot create an item for the led brightness channel for zhimi.humidifier.ca1. Can you look at the database of the binding if there is a problem with this piece of equipment. BTW I can create items for all other chanels even not supported by the humidifier…

@marcel_verpaalen
I have bought a Mi Air Purifier Pro (v7 as I saw it in openHab when I have added it). Do you know anything about this? The binding says that this is an unsupported device… Can I somehow help testing it how it works? Now I can only send Power On/Off and some basic control…

More info on my Air Purifier:

hardwareVersion MW300
modelId zhimi.airpurifier.v7
vendor Xiaomi
wifiFirmware SD878x-14.76.36.p84-702.1.0-WM

No, I don’t have any airpurifier, all the support is based on input from others.

@rkrisi pls try to add it manually as basic device. Than change the thing config the model to zhimi.airpurifier.v6

Than you can try the functions. You can also try the other zhimi.airpurifier.v… models if not all work.
Let me know which one is most equal and I add it to the database.

Thanks @marcel_verpaalen, I’ve added it manually with the v6 config and it works!
Only the Network details not reported, I didn’t had time yet to try other configs, but I can live with that… or maybe you know why this is not working… Update: Somehow the Network details also get reported… I didn’t do anything, it just showed up…

Anyway v6 seems a good config for the v7 as well!

Ps.: Filter Hours used returns 0 for me and motor speed seems not so accurate (?) for me. It shows almost every time 300 rpm. Even when I change it to max, it only changes a little (for 350 or something like this)

Also, I couldn’t find here an .items file posted with all of the items added, so I have made something similar like the mi Robot Vacuum has. (Sorry for the labels, it may not be appropriate… )

.items:

Group gAirPurifier "Xiaomi Air Purifier" <fan>
Group gAirStat "Status details" <status> (gAirPurifier)
Group gAirCons "Consumables Usage" <line-increase> (gAirPurifier)
Group gAirPurifierNetwork "Network Details" <network> (gAirPurifier)

// Network
String miAirSSID "Network SSID [%s]" <network> (gAirPurifier, gAirPurifierNetwork) { channel="miio:basic:7c9a958e:network#ssid" }
String miAirBSSID "Network BSSID [%s]" <network> (gAirPurifier, gAirPurifierNetwork) { channel="miio:basic:7c9a958e:network#bssid" }
Number miAirRSSI "Network RSSI [%1.0f]" <network> (gAirPurifier, gAirPurifierNetwork) { channel="miio:basic:7c9a958e:network#rssi" }
Number miAirLife "Uptime [%1.0f]" <network> (gAirPurifier, gAirPurifierNetwork) { channel="miio:basic:7c9a958e:network#life" }

// Status
Switch miAirPower "Power" (gAirPurifier, gAirStat) { channel="miio:basic:7c9a958e:power" }
String miAirMode "Mode" <mirobot> (gAirPurifier, gAirStat) { channel="miio:basic:7c9a958e:mode" }
Number miAirMotorSpeed "Motor Speed [%d rpm]" <fan> (gAirPurifier, gAirStat) { channel="miio:basic:7c9a958e:motorspeed" }
Switch miAirChildLock "Child lock" (gAirPurifier, gAirStat) { channel="miio:basic:7c9a958e:childlock" }
Switch miAirScreenStatus "Screen status" (gAirPurifier, gAirStat) { channel="miio:basic:7c9a958e:led" }
Number miAirScreenBrightness "Screen Brightness [%d]" (gAirPurifier, gAirStat) { channel="miio:basic:7c9a958e:bright" }
Number miAirFavLevel "Favorite Level" (gAirPurifier, gAirStat) { channel="miio:basic:7c9a958e:favoritelevel" }
Number miAirRunTime "Runtime [%d h]" (gAirPurifier, gAirStat) { channel="miio:basic:7c9a958e:usedhours" }

// Air details
Number miAirTemperature "Inside Temperature [%.1f °C]" <temperature> (gAirPurifier, cTemp) { channel="miio:basic:7c9a958e:temperature" }
Number miAirHumidity "Inside Humidity [%d %%]" <humidity> (gAirPurifier, gHumidity) { channel="miio:basic:7c9a958e:humidity" }
Number miAirQuality "PPM 2.5" <flow> (gAirPurifier) { channel="miio:basic:7c9a958e:aqi" }
Number miAirAvgQuality "Average PPM 2.5" <flow> (gAirPurifier) { channel="miio:basic:7c9a958e:averageaqi" }
Number miAirPuriviedVol "Purivied Volume" (gAirPurifier) { channel="miio:basic:7c9a958e:purifyvolume" }

// Consumables
Number miAirFilterLife "Filter Life [%d %%]" (gAirPurifier, gAirCons) { channel="miio:basic:7c9a958e:filterlife" }
Number miAirFilterMaxLife "Filter Max Life" (gAirPurifier, gAirCons) { channel="miio:basic:7c9a958e:filtermaxlife" }
Number miAirFilterHours "Filter Hours used" (gAirPurifier, gAirCons) { channel="miio:basic:7c9a958e:filterhours" }

.sitemap:

Switch item=miAirMode label="Air Purifier []" mappings=[auto=Auto, silent=Silent, favorite=Manual, idle=Off]
		Group item=gAirPurifier {
			Switch item=miAirMode label="Air Purifier []" mappings=[auto=Auto, silent=Silent, favorite=Manual, idle=Off]
			Default item=miAirPower
			Default item=miAirQuality
			Default item=miAirAvgQuality
			Default item=miAirTemperature
			Default item=miAirHumidity
			Default item=miAirPuriviedVol
			Group item=gAirStat
			Group item=gAirCons
			Group item=gAirPurifierNetwork
		}
1 Like

Could you please add example items/sitemap for xiaomi humidifier. I just bought one from xiaomi called “Xiaomi Smartmi Pure Evaporative Air Humidifier”. Hopefully, it will work with openhab.

Please check the doc for your device.
You will need to know the model string to lookup the device

Thank you. According to Mitoolkit it is: zhimi.humidifier.ca1
I have to downgrade Mi Home app to be able to retrieve token…
I didn’t know that so many devices are supported and well described. Really great job.
Should I upgrade Mi IO binding? I have a version from beginning o the year which I use continuously for a vacuum cleaner and air purifier. OH2.2 here.

Edit:
I have the token and thing is “online” in Paper UI. It was found as “miio Generic” not “miio Basic”.
I set manually Device Model String to: “zhimi.humidifier.ca1” in Paper UI
But I can see only 2 channels and Humidifier is not present in Control part of Paper UI.

Edit 2.
I did upgrade to OH 2.3 but now Xiaomi MI IO Binding is gone and I can’t find it in the add-ons part of Paper UI. Marketplace is installed and configured “include bindings” and “alpha”.
Where I can find the binding?
Edit 3.
Marketplace was corrupted. It is well known bug for 2.2 to 2.3 upgrade. Solution is on this forum.
After fix Binding changed type to “Basic device” and now I can see all data in Control part of Paper UI.

Edit 4
Almost everything works. I can share my sitemap with colors.
To do:
1.mapping works except “medium” I can’t find the correct text.
2. motorspeed works in Paper UI but doesn’t in the app. There have to be something with numbers.
3. usedhours shows strange numbers like -596523. No idea how to fix this right now.

		Group item=G_humidifier icon="my_humidifier"{
		Switch item=mode label="[]" icon="none" mappings=[auto=Auto, silent=Silent, medium=Medium, high=High]
		Switch item=power
		Text item=humidity valuecolor=[<=40="#cc0033",>40="#1cac78",>60="#7cb9e8"]
		Text item=setHumidity valuecolor=[<=40="#cc0033",>40="#1cac78",>60="#7cb9e8"]
		Text item=temperature valuecolor=[<=18="#7cb9e8",>18="#1cac78",>23="#cc0033"]
		Text item=depth valuecolor=[<=10="#FF0000",10="#FFFF00",>30="#1cac78"]
		Switch item=buzzer
		Switch item=dry
		Text item=usedhours
		Text item=motorspeed
		Switch item=childlock
		}

Please add european Air Purifier 2s - zhimi.airpurifier.mc1