Xiaomi cloud vacuum auto discovery

Hey there,
i am not able to get my roborock s7 work with the Mi IO binding.
My openhab is 3.1 which runs on docker. The s7 is connected via the Mi Home app.
Because the s7 is located in a different subnet, i configured the binding to use cloud connection.
But auto discovery does not work, the s7 does not appear in my inbox.

In the logs i can see a login error

[miio.internal.cloud.MiCloudConnector] - Xiaomi Login step 1 content response= &&&START&&&{"serviceParam":"{...}","qs":"%3Fsid%3Dxiaomiio%26_json%3Dtrue","code":70016,"description":"登录验证失败","securityStatus":0,...,"result":"error","captchaUrl":null,"callback":"https://sts.api.io.mi.com/sts","location":"https://account.xiaomi.com/..."}

…which is similar to this post: https://community.openhab.org/t/xiaomi-robot-vacuum-binding/31317/1510

Logging in at https://account.xiaomi.com with my entered credentials succeeds, so my configuration seems to be correct. Furthermore i can see in the logs that my s7 is recognized by the binding and the token and other data is traced to userdata/miio/miioTokens-de.json
So i dont know why it does not appear in the inbox (and prints the login error).

Unfortunately setting up a thing manually using the detected s7 configuration does not work either. The thing is reported as

Thing 'miio:vacuum:roborock' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): No Response from device

In the logs i find something like

[WARN ] [.core.thing.binding.BaseThingHandler] - Handler MiIoVacuumHandler of thing miio:vacuum:roborock tried updating channel actions#segment although the handler was already disposed.

and several traces like

Config description for 'miio:dnd_end' is not resolvable, assuming 'miio:vacuum:s7:dnd#dnd_end' is initializable

But i dont know where to look next.
Does anybody have an idea how to make the s7 work with the binding?

If you put the Chinese in "code":70016,"description":"登录验证失败", in google translate it gives a Login verification failed.

I expect the info in userdata/miio/miioTokens-de.json is outdated. Hence it is not getting the latest information. You could check this by deleting the file. If it is not refreshing unfortunately it is not working.
Note that in case of the selecting the cloud connection, the token is not really used, the token is relevant only for local communication.

Unfortunately, the cloud login process is kind of voodoo… It is reverse engineered by looking what the app is sending. One thing to try is to fully restart openhab (it will clean all the possible left session cookies, restarting the binding alone is not enough)

There have been users that had success by resetting their Xiaomi password, the new password worked again.

The last thing what I can suggest is to trace the communication
log:set trace org.openhab.binding.miio.internal.cloud and share in PM (I don’t think it contains your userid/pass, but check anyway) to see if anything can be learned from that.

Note, that until you can successfully logon again, indeed the vacuum will not be discovered, nor will it work with cloudmode.

I expect once cloud logon works again, your discover etc will work as usual. Also, after successful communication it will show ONLINE rather than OFFLINE. I don’t think the issues are anything specific to the S7 vacuum itself.

thanks for your very fast response :slight_smile:
i restarted openhab several times and i also changed the password because i thought it might be related due to special characters. unfortunately without any effect.
when i delete the .json file it will be recreated with the same content. i also verified with another tool that the data is valid and uptodate.
i will check for the trace and send you a pm. thanks so far :slight_smile:

as a summary i could easily solve the issue by running a manual scan for miio devices. for some reason the initial scan did not find my s7. however the manual scan did the job very well. so if you run into similar problems, this may help you too. the mentioned login error is strange of course but was not relevant to use the binding.
i found another thing which was causing some trouble on my site: there were two different deviceIDs, one from the miioTokens json file and one from auto/manual discovery. i always used the id from the json file which is similar to the id i received from other token-extracting-tools. but this id did not work for me. first after running the discovery scan i received the other id which i could use for manual thing configuration e.g. in things files.
thanks again to @marcel_verpaalen for your help :slight_smile: