Xiaomi Robot Vacuum Binding

My path maybe other openhabian has this path here:
grafik
I hope that is right. The documentation is not totally clear for me sorry. Debug log is a log what i don’t know. I know only openhab.log. I get a new device after reboot i thing.


But i don’t get any channel. I switch over to cloud in thing settings. But i have only hidden channels:

To enable debug logging, you can type in the console log:set debug org.openhab.binding.miio

The right folder is printed during the startup of the binding.
You may need to restart OH if the path was not existant when OH was started.

In the log you should see something like using etc\openhab\misc\miio\dreame.vacuum.mc1808-miot.json see Xiaomi Mi Air Purifier (Xiaomi Mi IO) - #330 by chrismast for a screenshot of how it would loook like.

After you’ve added your thing, it may take 1 to 2 minutes to communicate with the device and initialize the thing in the right way.

Hello Marcel,

i restart openhab and nothing happends. I switch debug mode on and restart only the binding. Now WaterMode is there. Thank you very much! Sometimes openhab is a little bit silly…

I create selection via Sitemap but there is no effect if i choose something:

But read out of item works.

´´´

2021-02-27 15:25:43.416 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":186,"method":"set_properties","params":[{"did":"water-mode","siid":18,"piid":20,"value":2}]} -> 192.168.179.158 (Device: 16D5DC17 token: 494D4C44XXXXXXXXXXXXXXXX51724E31 Queue: 1). Send via cloudserver: de
2021-02-27 15:25:43.515 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":186,"method":"set_properties","params":[{"did":"water-mode","siid":18,"piid":20,"value":2}]} to https://de.api.io.mi.com/app/home/rpc/383114263
2021-02-27 15:25:43.664 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/383114263. Response: {"code":0,"exe_time":2,"id":186,"otlocalts":1614435943649473,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18}]}
2021-02-27 15:25:43.667 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"exe_time":2,"id":186,"otlocalts":1614435943649473,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18}]}
2021-02-27 15:25:43.670 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":186,"method":"set_properties","params":[{"did":"water-mode","siid":18,"piid":20,"value":2}]} send via cloudserver de
2021-02-27 15:25:43.674 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for RobbyBubbleGeneric type: SET_PROPERTIES, result: [{"code":0,"did":"water-mode","piid":20,"siid":18}], fullresponse: {"code":0,"exe_time":2,"id":186,"otlocalts":1614435943649473,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18}]}
2021-02-27 15:25:43.971 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":188,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} -> 192.168.179.158 (Device: 16D5DC17 token: 494D4C44XXXXXXXXXXXXXXXX51724E31 Queue: 2). Send via cloudserver: de
2021-02-27 15:25:44.093 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":188,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} to https://de.api.io.mi.com/app/home/rpc/383114263
2021-02-27 15:25:44.163 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/383114263. Response: {"code":0,"exe_time":21,"id":188,"otlocalts":1614435944147189,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:25:44.166 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"exe_time":21,"id":188,"otlocalts":1614435944147189,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:25:44.170 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":188,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} send via cloudserver de
2021-02-27 15:25:44.176 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for RobbyBubbleGeneric type: GET_PROPERTIES, result: [{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}], fullresponse: {"code":0,"exe_time":21,"id":188,"otlocalts":1614435944147189,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:25:44.592 [DEBUG] [io.internal.handler.MiIoBasicHandler] - Skip refresh of channel water-mode for miio:basic:RobbyBubbleBasic as it is not linked
2021-02-27 15:25:46.425 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":204,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} -> 192.168.179.158 (Device: 16D5DC17 token: 494D4C44XXXXXXXXXXXXXXXX51724E31 Queue: 2). Send via cloudserver: de
2021-02-27 15:25:46.515 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":204,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} to https://de.api.io.mi.com/app/home/rpc/383114263
2021-02-27 15:25:46.567 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/383114263. Response: {"code":0,"exe_time":3,"id":204,"otlocalts":1614435946551850,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:25:46.570 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"exe_time":3,"id":204,"otlocalts":1614435946551850,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:25:46.574 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":204,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} send via cloudserver de
2021-02-27 15:25:46.579 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for RobbyBubbleGeneric type: GET_PROPERTIES, result: [{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}], fullresponse: {"code":0,"exe_time":3,"id":204,"otlocalts":1614435946551850,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:26:14.079 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":220,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} -> 192.168.179.158 (Device: 16D5DC17 token: 494D4C44XXXXXXXXXXXXXXXX51724E31 Queue: 2). Send via cloudserver: de
2021-02-27 15:26:14.298 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":220,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} to https://de.api.io.mi.com/app/home/rpc/383114263
2021-02-27 15:26:14.350 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/383114263. Response: {"code":0,"exe_time":3,"id":220,"otlocalts":1614435974333034,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:26:14.353 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"exe_time":3,"id":220,"otlocalts":1614435974333034,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:26:14.355 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":220,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} send via cloudserver de
2021-02-27 15:26:14.359 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for RobbyBubbleGeneric type: GET_PROPERTIES, result: [{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}], fullresponse: {"code":0,"exe_time":3,"id":220,"otlocalts":1614435974333034,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:26:14.646 [DEBUG] [io.internal.handler.MiIoBasicHandler] - Skip refresh of channel water-mode for miio:basic:RobbyBubbleBasic as it is not linked
2021-02-27 15:26:44.129 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":237,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} -> 192.168.179.158 (Device: 16D5DC17 token: 494D4C44XXXXXXXXXXXXXXXX51724E31 Queue: 2). Send via cloudserver: de
2021-02-27 15:26:44.299 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Send request: {"id":237,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} to https://de.api.io.mi.com/app/home/rpc/383114263
2021-02-27 15:26:44.404 [DEBUG] [miio.internal.cloud.MiCloudConnector] - Request to de server /home/rpc/383114263. Response: {"code":0,"exe_time":3,"id":237,"otlocalts":1614436004373303,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:26:44.410 [DEBUG] [miio.internal.cloud.MiCloudConnector] - response: {"code":0,"exe_time":3,"id":237,"otlocalts":1614436004373303,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:26:44.413 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command {"id":237,"method":"get_properties","params":[{"did":"water-mode","siid":18,"piid":20},{"did":"fault","siid":3,"piid":1}]} send via cloudserver de
2021-02-27 15:26:44.421 [DEBUG] [internal.handler.MiIoAbstractHandler] - Received response for RobbyBubbleGeneric type: GET_PROPERTIES, result: [{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}], fullresponse: {"code":0,"exe_time":3,"id":237,"otlocalts":1614436004373303,"result":[{"code":0,"did":"water-mode","piid":20,"siid":18,"value":2},{"code":0,"did":"fault","piid":1,"siid":3,"value":0}]}
2021-02-27 15:26:44.715 [DEBUG] [io.internal.handler.MiIoBasicHandler] - Skip refresh of channel water-mode for miio:basic:RobbyBubbleBasic as it is not linked

Xiaomi app will not update and stay on low.

It is strange.
In the first line you set it to 2
and 2021-02-27 15:25:46.570 the response is actually 2, suggesting it was successful.
Can it be that the Xiaomi app is bit slow to pull the latest status.

OK if I set wet mode nothing happens. If I choose other cleaner mode, then wet mode will set also… Strange bug maybe at api from Xiaomi.

Hi everyone,
First a little bit of background before we get to the main point… :slight_smile:
I’m currently migrating my system from my synology nas to NUC and I decided to use docker engine. What I noticed is that when docker image starts up it fires a chown -R openhab:openhab on my userdata folder.
The next thing I noticed is that it takes a long time to be executed like… a very long time - 5-10 mins.
When I triggered manually chown -vR on the same I saw that there are A LOT of .rrmap files under userdata/miio folder. Even ls -l was taking so long I couldn’t even list the folder.
The only workaround I’ve found is to pass it as a pipe (thanks to the google) and delete them using this command:
find . -maxdepth 1 -name “*.rrmap” -print0 | xargs -0 rm

I’m wondering if there is a setting on the binding to purge old .rrmap files and if there can be created such feature or I have to handle it via shell script?

Cheers,
Konstantin

@polychronov No such thing is implemented in the binding as these files are only created when the binding is in debug mode.

Suggest to put back to info logging to stop the creation of the rrmap files.
log:set DEFAULT org.openhab.binding.miio
and if that is not working (e.g. if you run whole openhab in debug mode) you can set it for the binding alone:
log:set info org.openhab.binding.miio

Oh. If this is due to the logging I’ve already disabled it so I guess no such issues will occur in the future.
Thanks !

Cheers,
Konstantin

1 Like

Hello everybody,
my name is Dennis and i started my openhab project a few weeks ago. Last week i got a Roborock s7 and want to add it in my smart home too.
Currently i have the problem to connect my “Robby”. The thing type is: Unsupported Xiaomi Mi Device", the modelId is “roborock.vacuum.a15”. The token seems correct because it is “Online” (i got the token from GitHub - PiotrMachowski/Xiaomi-cloud-tokens-extractor: This tool/script retrieves tokens for all devices connected to Xiaomi cloud and encryption keys for BLE devices.)
. My thing settings are here:


Under channels i get these:

String   RoborockS7NetworkSsid           "Ssid"                                                    {channel="miio:generic:1750DD59:network#ssid"}

String   RoborockS7NetworkBssid          "Bssid"                                                   {channel="miio:generic:1750DD59:network#bssid"}

Number   RoborockS7NetworkRssi           "Rssi"                                                    {channel="miio:generic:1750DD59:network#rssi"}

Number   RoborockS7NetworkLife           "Life"                                                    {channel="miio:generic:1750DD59:network#life"}

Switch   RoborockS7ActionsPower          "Power on/off"                                            {channel="miio:generic:1750DD59:actions#power"}

String   RoborockS7ActionsCommands       "Execute command"                                         {channel="miio:generic:1750DD59:actions#commands"}

String   RoborockS7ActionsRpc            "Execute rpc (cloud) command"                             {channel="miio:generic:1750DD59:actions#rpc"}

Switch   RoborockS7ActionsTestcommands   "(experimental)execute test to find supported channels"   {channel="miio:generic:1750DD59:actions#testcommands"}

I created a sitemap just for start and stopping. The log give me this for the start:

2021-04-05 15:04:14.729 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'RoborockS7ActionsPower' received command ON
2021-04-05 15:04:14.731 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'RoborockS7ActionsPower' predicted to become ON
2021-04-05 15:04:14.740 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'RoborockS7ActionsPower' changed from OFF to ON

and for stop:

2021-04-05 15:04:24.615 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'RoborockS7ActionsPower' received command OFF
2021-04-05 15:04:24.618 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'RoborockS7ActionsPower' predicted to become OFF
2021-04-05 15:04:24.623 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'RoborockS7ActionsPower' changed from ON to OFF

and also

2021-04-05 15:04:24.631 [DEBUG] [nal.transport.MiIoAsyncCommunication] - Command added to Queue {"id":125,"method":"set_power","params":["off"]} -> 192.168.2.230 (Device: 1750DD59 token: 464F767AXXXXXXXXXXXXXXXX69543535 Queue: 1).

But nothing happens. Any ideas? Do I make a newbie mistake?

I am very happy if you guys could help me.

Thanks
Dennis

Hello Everyone,

i started with some testes and used existing configurations for my roborock s7 like:

Thing miio:vacuum:s6e "roborock" [ host="192.168.2.230", 
                                   token="<your token>", 
                                   deviceId="1750DD59", 
                                   model="roborock.vacuum.a15", 
                                   communication="direct"]

This is working. I will do some tests and update my post here!

I have the same problem. The Roborock ist online and I get only a bit of Roborock S7 Channels. The Roborock does not respond to commands.
The log file says “Discovered from cloud, but ignored because not supported: 1751250E Device name: ‘Robo’, did: ‘391193870’, token: ‘434d594b7111185a6f6379745a377442’, ip: 192.168.178.59, server: de”

Yes, indeed your vacuum is not yet supported so your milage may vary.
The discovery can be worked around with setting the binding config to accept these
Than you can try the trick of overriding the model

Anyway, suggest to add a github issue with the debug responses for this robot so it can maybe be supported in a future release.

Hi,
I have an Roborock S5 MAX running with this Binding and everything works fine.
Since a few days I have a message in my log file (every minute):

Error logging on to Xiaomi cloud (0): Error getting logon location URL. Return code: 0

But I can control it with my openHAB.
Any Idea what I can do?

Did you recently change your xiamo password? That’s when I got he message

The error is related to problems trying to logon to the cloud.
If you changed nothing from your side (e.g. like password suggested above) then maybe Xiaomi is changing something in their cloud.

Note, you can expect everything to continue to run fine except for getting the map and getting tokens for newly added devices. (the binding does not use the cloud for the regular usage)

You are right.
My Xiaomi Home App had an orange dot and I followed this dot to Profile → Einstellungen → Sicherheitseinstellungen → ein neues Kennwort anlegen. At this point I can enter a password with 4 digits. But I canceled this.
I didn’t bring this together with this message in the log, maybe this ist the problem?!
When I enter there 4 digits, do I need them in this Binding?

Just for the information: Now I tested to enter 4 digits and then I could disable the password in the app. Now the message is gone. Thank you.

1 Like

I opened an issue containing the debug info for the new S7 model as requested: [miio] Add support for Roborock S7 vacuum robots · Issue #10590 · openhab/openhab-addons · GitHub.

Did you try if it works is you override the model with one of the known models?
e.g. put rockrobo.vacuum.s6 in the config as model.
Can you try and feedback the debug log

Hello,

first Thanks for this great Plugin :slight_smile: .

I am new to Openhab 3, i installed this Binding and I have 3 Mi Devices:
Roborock S5 - works perfect
Mi Air Purifier 2 - works but only in cloud mode (but everthing works), in Direct Mode its always offline
Mi Smart Antibacterial Humidifier - this device also only “come online” in cloud mode and after 1 Minute it is online and shows Information under Thing Properties.
But there are “no channels” and the Power channel did not work.

Is there a way i can add the channels manually ? The Binding “wiki” say it is a deerma.humidifier.jsq1 and it have support.