Hi there,
i´m currently trying to get everything back running after moving into a new flat and upgrading to oH 3.
I already had one Xiaomi Air Purifier in my old flat and now a second one.
The old one working fine in oH 2 with text based config.
Now i tried to get them both running in oH 3.0.2 but no matter they way i´m not able to add them as a thing.
-
UI based local
I added the binding (3.0.2 │ org.openhab.binding.miio) and watched the log for discovery results.
The binding found three things but only one of them was a Air Purifier (the 2S).
The two other results showed as generic without further information.
I tried to add the one that showed up as basic but that failed… -
UI based cloud
So i followed the bindings documentation on how to connect the binding to the cloud service of Xiaomi.
After entering my user, password and server i got a bunch of errors in the logs…
This is just one of like six blocks that show up.
2021-07-30 12:10:39.628 [ERROR] [org.openhab.binding.miio ] - bundle - Pastebin.com
After playing around a little bit i found that i couldn´t delete something i already entered in the binding cofing, e.g. i can´t delete the server country. -
Text based config
I was able to look at the things file i used in my old environment and wanted to try the text based config.
So i created axiaomi.things
file in the things folder and pasted the modified config line:
Thing miio:basic:airpurifier2S "Luftreiniger Wohnzimmer" [ host="1.2.3.4", token="<Token>", deviceId="<deviceId>", model="zhimi.airpurifier.vb2", refreshInterval="30", timeout="15000", communication="direct"]
Guess what? Nothing happens!
oH reads the things file but wont do anything with it… no error, no new things, nothing.
- Log level DEBUG
Now i wanted to know what i happening and went to the console and switched the log level to DEBUG.
openhab> log:set DEBUG org.openhab.binding.miio
openhab> log:get org.openhab.binding.miio
DEBUG
Now i was able to also get the token for the second device and added this to the things file aswell.
This lead me to the following debug message:
2021-07-30 12:07:13.116 [DEBUG] [iio.internal.discovery.MiIoDiscovery] - Skipped adding local found Xiaomi Mi Device ABC (XYZ). Already discovered by cloud.
2021-07-30 12:07:13.177 [DEBUG] [iio.internal.discovery.MiIoDiscovery] - Skipped adding local found Xiaomi Mi Device CDE (ZYX). Already discovered by cloud.
So back to the inbox and remove the discovery results from the cloud.
Clear the things file, save and paste the config again.
Nothing… no error, no new things.
2021-07-30 12:12:39.792 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'xiaomi.things'
The binding is now configured as local only but still tries to get information from the cloud regularly…
2021-07-30 12:20:39.665 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"getVirtualModel":false,"getHuamiDevices":0} to https://de.api.io.mi.com/app/home/device_list
2021-07-30 12:20:39.829 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/device_list. Response: {"code":0,"message":"ok","result":{"list":[{"did":"<deviceId>","token":"<Token>","longitude":"0.00000000","latitude":"0.00000000","name":"Schlafzimmer","pid":"0","localip":"1.2.3.4","mac":"<MAC>","ssid":"Falkennest","bssid":"<MAC>","parent_id":"","parent_model":"","show_mode":1,"model":"zhimi.airpurifier.mc1","adminFlag":1,"shareFlag":0,"permitLevel":16,"isOnline":true,"desc":"Schlafen| PM2.5:5","extra":{"isSetPincode":0,"pincodeType":0,"fw_version":"1.4.3_21106","needVerifyCode":0,"isPasswordEncrypt":0},"prop":{"aqi":"5","mode":"silent","power":"on"},"uid":<UID>,"pd_id":123,"password":"","p2p_id":"","rssi":-48,"family_id":0,"reset_flag":0},{"did":"<deviceId>","token":"<Token>","longitude":"0.00000000","latitude":"0.00000000","name":"Wohnzimmer","pid":"0","localip":"1.2.3.5","mac":"<MAC>","ssid":"Falkennest","bssid":"<MAC>","parent_id":"","parent_model":"","show_mode":1,"model":"zhimi.airpurifier.vb2","adminFlag":1,"shareFlag":0,"permitLevel":16,"isOnline":true,"desc":"Gerät online ","extra":{"isSetPincode":0,"pincodeType":0,"fw_version":"2.0.8","needVerifyCode":0,"isPasswordEncrypt":0,"mcu_version":"1002"},"uid":<UID>,"pd_id":4567,"password":"","p2p_id":"","rssi":-67,"family_id":0,"reset_flag":0}]}}
2021-07-30 12:20:39.831 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Devices token info saved to /var/lib/openhab/miio/miioTokens-de.json
2021-07-30 12:20:39.834 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Xiaomi cloud info: Device name: 'Schlafzimmer', did: '<deviceId>', token: '<Token>', ip: 1.2.3.4, server: de
2021-07-30 12:20:39.835 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Xiaomi cloud info: Device name: 'Wohnzimmer', did: '<deviceId>', token: '<Token>', ip: 1.2.3.5, server: de
2021-07-30 12:20:39.837 [DEBUG] [iio.internal.discovery.MiIoDiscovery] - Cloud Info: Device name: 'Schlafzimmer', did: '<deviceId>', token: '<Token>', ip: 1.2.3.4, server: de
2021-07-30 12:20:39.837 [DEBUG] [iio.internal.discovery.MiIoDiscovery] - Cloud Info: Device name: 'Wohnzimmer', did: '<deviceId>', token: '<Token>', ip: 1.2.3.5, server: de
2021-07-30 12:20:39.839 [DEBUG] [iio.internal.discovery.MiIoDiscovery] - Discovered Mi Device ABC (<deviceId>) at 1.2.3.4 as miio:generic:<ID> with token <Token>
2021-07-30 12:20:39.839 [DEBUG] [iio.internal.discovery.MiIoDiscovery] - Discovered Mi Device DEF (<deviceId>) at 1.2.3.5 as miio:generic:<ID> with token <Token>
- UI based config the third
I removed the things file and went to the inbox.
I can see two devices with the correct names and the info “with token” at the end.
So i tried to add them and the log prints:
2021-07-30 12:12:54.747 [WARN ] [g.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type miio:generic.
I´m out of ideas…
It´s not working with the UI and local discovery, it´s not working with the UI and cloud based discovery and it´s not working with text based config.
Any ideas?
kind regards
Michael