Xiaomi Robot Vacuum Binding

I think you need to setup your timeout to a longer period.
Probably it fails to get responses sometimes. Also, if you have installed one of the alpha version make sure it is fully uninstalled
use bundle:list | grep Xiaomi to see if maybe multiple are there

yes, actually in this case paperUI is creating the binding config file for you. see the general OH help to find where it is residing exactly, if I recall right somewhere in userdata folder

you can make normal item / sitemap for the map… see the readme of the binding in the OH documentation

1 Like

In ubuntu the binding creates this config file in
/var/lib/openhab2/config/binding/miio.config

Just wondering, in the text-only configuration, would i have to place the text file in that directory as well?
As all other text configs are usually stored in /etc/openhab2/services

Thanks for your reply. Just to be sure: This means that I have to use PaperUI at least once to initially configure the binding and to let PaperUI create the file? There is no way to initialize the binding with text-only configuration?

no, just make the file directly will also work.
From the binding perspective I don’t control the file/info, I suggested PaperUI as I think it is just the most convenient way to create it and be sure the format is right. If find out the exact location and format, please share for others that may want to do it in the same way.

So the binding is not aware if you enter it via file or paperUI. This is handled by the OH framework.

For future reference, here are the ownership and permissions plus content

# ls -la /var/lib/openhab2/config/binding/miio.config
-rw-r--r-- 1 openhab openhab 145 Apr 21 12:05 /var/lib/openhab2/config/binding/miio.config

# cat /var/lib/openhab2/config/binding/miio.config
:org.apache.felix.configadmin.revision:=L"4"
country="de"
password="YOUR_PASSWORD"
service.pid="binding.miio"
username="YOUR_USERNAME"
1 Like

I have a short question regarding your update with the shown maps and the connection to the Xiaomi Cloud. I have a small child walking all around and touching everything. Sometime he is playing with my roborock (1st generation), which loses the coordinates and can no longer clean the defined spots. The problem was posted some months ago in this post.
Is your updated binding ready to satisfy this problem?

for backup map need root vacuum

my map doesnt work with xiaomi vacuum 1s. any ideas what im doing wrong?
(debian netinstall with openhabian)

2020-04-23 12:44:36.876 [INFO ] [g.miio.internal.cloud.CloudConnector] - Getting vacuum map ruby2%2F321261849%2F7 from Xiaomi cloud server: 

2020-04-23 12:44:37.874 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 

java.lang.Error: Probable fatal error:No fonts found.

	at sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1236) ~[?:1.8.0_232]

	at sun.font.SunFontManager.initialiseDeferredFont(SunFontManager.java:1106) ~[?:1.8.0_232]

	at sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:287) ~[?:1.8.0_232]

	at sun.font.CompositeFont.getSlotFont(CompositeFont.java:376) ~[?:1.8.0_232]

	at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:82) ~[?:1.8.0_232]

	at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:97) ~[?:1.8.0_232]

	at sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:359) ~[?:1.8.0_232]

	at sun.font.FontDesignMetrics.<init>(FontDesignMetrics.java:350) ~[?:1.8.0_232]

	at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:302) ~[?:1.8.0_232]

	at sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:855) ~[?:1.8.0_232]

	at org.openhab.binding.miio.internal.robot.RRMapDraw.drawOpenHabRocks(RRMapDraw.java:337) ~[?:?]

	at org.openhab.binding.miio.internal.robot.RRMapDraw.getImage(RRMapDraw.java:379) ~[?:?]

	at org.openhab.binding.miio.internal.handler.MiIoVacuumHandler.getMap(MiIoVacuumHandler.java:478) ~[?:?]

	at org.openhab.binding.miio.internal.handler.MiIoVacuumHandler.lambda$5(MiIoVacuumHandler.java:451) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_232]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_232]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_232]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

i did an update to my 2.5.3 openhabian and i get this log:

[INFO ] [miio.internal.cloud.MiCloudConnector] - Error logging on to Xiaomi cloud (0): Error getting logon location URL. Return code: 21310

i get no map or cloud info anymore…

Seems the textfont is not availble…I’ve selected something that should be available on vast majority of systems. seems still not all. See if you can install TimesRoman font to your system
maybe something like sudo apt update && sudo apt install ttf-mscorefonts-installer will do the trick

Something is wrong… :frowning: unfortunately the meaning of the return codes is not yet known.

I don’t recall seeing this before. UserId / passwd are sure correct? (that gives similar unclear response)
You can give it a try with fully restarting openhab, that clears all the cookies.
If that helps, let me know, than I can apply that as a solution for the issue.

i updated via openhabian-config and during the process i saw that it stops openhab.service tries to update java and then restart service again and i think during all that it also clears cache .Thats normal.Then i usually do a reboot when the system settles before i start using openhab.Then i first saw this error…I did a restart again but it did fix anything.My userid/passwd are still there,i did not change anything.

sry, after manual installation of ttf-mscorefonts-installer

apt-cache policy ttf-mscorefonts-installer
ttf-mscorefonts-installer:
  Installiert:           3.7
  Installationskandidat: 3.7
  Versionstabelle:
 *** 3.7 100
        100 /var/lib/dpkg/status

…and system restart:

2020-04-23 17:41:39.427 [INFO ] [g.miio.internal.cloud.CloudConnector] - Getting vacuum map ruby2%2F321261849%2F2 from Xiaomi cloud server: 

2020-04-23 17:41:41.201 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 

java.lang.Error: Probable fatal error:No fonts found.

	at sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1236) ~[?:1.8.0_232]

	at sun.font.SunFontManager.initialiseDeferredFont(SunFontManager.java:1106) ~[?:1.8.0_232]

	at sun.font.CompositeFont.doDeferredInitialisation(CompositeFont.java:287) ~[?:1.8.0_232]

	at sun.font.CompositeFont.getSlotFont(CompositeFont.java:376) ~[?:1.8.0_232]

	at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:82) ~[?:1.8.0_232]

	at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:97) ~[?:1.8.0_232]

	at sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:359) ~[?:1.8.0_232]

	at sun.font.FontDesignMetrics.<init>(FontDesignMetrics.java:350) ~[?:1.8.0_232]

	at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:302) ~[?:1.8.0_232]

	at sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:855) ~[?:1.8.0_232]

	at org.openhab.binding.miio.internal.robot.RRMapDraw.drawOpenHabRocks(RRMapDraw.java:337) ~[?:?]

	at org.openhab.binding.miio.internal.robot.RRMapDraw.getImage(RRMapDraw.java:379) ~[?:?]

	at org.openhab.binding.miio.internal.handler.MiIoVacuumHandler.getMap(MiIoVacuumHandler.java:478) ~[?:?]

	at org.openhab.binding.miio.internal.handler.MiIoVacuumHandler.lambda$5(MiIoVacuumHandler.java:451) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_232]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:1.8.0_232]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:1.8.0_232]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]

	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

I have the same message but with other returncode

[INFO ] [miio.internal.cloud.MiCloudConnector] - Error logging on to Xiaomi cloud (0): Error getting logon location URL. Return code: 70016

It occurs every 10 minutes after migrating from openhab 2.5.3 to 2.5.4 and binding-miio - 2.5.4. The miio binding before updating was the downloadedorg.openhab.binding.miio-2.5.4-SNAPSHOT.jar which i added in the addon folder. This worked fine, all maps could be downloaded. Then I updated openhab to 2.5.4, deleted the mii binding snapshot jar and installed the binding 2.5.4 by paperui. The user and password settings in gui was kept over migration and are fine.
I tried bundle restart, stop from opemnhab and clean cache. Nothing helps.
I even tried to change the server country in binding in papergui.
When changing something country in binding also the message appears first:

[ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while calling thing handler factory ‘org.openhab.binding.miio.internal.MiIoHandlerFactory@2e8913’: null
java.lang.NullPointerException: null
at
org.openhab.binding.miio.internal.handler.MiIoAbstractHandler.tokenCheckPass(MiIoAbstractHandler.java:134) ~[?:?]
at org.openhab.binding.miio.internal.handler.MiIoAbstractHandler.getConnection(MiIoAbstractHandler.java:288) ~[?:?]
at org.openhab.binding.miio.internal.handler.MiIoVacuumHandler.initializeData(MiIoVacuumHandler.java:407) ~[?:?]
at org.openhab.binding.miio.internal.handler.MiIoVacuumHandler.(MiIoVacuumHandler.java:95) ~[?:?]
at org.openhab.binding.miio.internal.MiIoHandlerFactory.createHandler(MiIoHandlerFactory.java:91) ~[?:?]
INFO ] [miio.internal.cloud.MiCloudConnector] - Error logging on to Xiaomi cloud (0): Cannot logon to Xiaomi cloud: Total timeout 10000 ms elapsed

After this it connect fines with the vaccum and get the status but no connection to cloud, still the first error message “Error getting logon location URL” every 10 minutes

i am at 2.5.3 and i am not sure i am using ur latest .jar ,where can i download it?

Maybe something like this:

In the mean time I made quick fix for the issue that it won’t prevent the map from being created

download the 2.5.5 snapshot from the normal repositories if you want the latest.
All relevant changes are in the regular builds (or upgrade to 2.5.4 release), no need for my alpha builds.

I still need to do the upgrade myself, but it seems something changed in the framework that created this issue. I did a fresh install 2.5.4 for testing and than I could not reproduce, so maybe it is something in relation to upgrading.

I did now delete the mii thing and uninstalled the binding. Afterwards I added the binding again. Still no connection. And because the missing connection there is no initialized thing found.