Xiaomi Mi Robot

@Partone that should do it… same I did, mine updated.I don’t think any restarts or likes are needed,
Only thing is to ensure is that it is fully un-installed prior to installing again.

@marcel_verpaalen
ok… strange. I will try it again later. thank you!

@marcel_verpaalen
I also could not update to the latest Version. I uninstalled and reinstalled and geht the old Version. Also when i uninstall, restart openhab and afterwards install the Binding.

@p_schlarb, @Partone
I indeed found it… it went to a new folder after my last change (due to the OH version upgrade)

Market place is now updated with the new link.

@marcel_verpaalen does this Robot use the same protocol as other Xiaomi Smart Home devices? If so, would it be worth including it in that binding rather than its own separate binding?

@marcel_verpaalen what was the issue? I’ve tried to uninstall / install it but will not update. it’s still installing the same version. maybe I have to restart the service.

@marcel_verpaalen @Partone
i uninstalled the Binding, restarted the service and installed again and got the new Version
here is the new Log:

14:34:54.406 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:034EE848' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Receive timed out
14:34:54.406 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Empty response received.
java.lang.NullPointerException
        at java.io.StringReader.<init>(StringReader.java:50)[:1.8.0_121]
        at com.google.gson.JsonParser.parse(JsonParser.java:45)[10:com.google.gson:2.3.1]
        at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.getResultHelper(XiaomiVacuumHandler.java:366)[202:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
        at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.updateVacuumStatus(XiaomiVacuumHandler.java:197)[202:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
        at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.updateData(XiaomiVacuumHandler.java:293)[202:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
        at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.lambda$0(XiaomiVacuumHandler.java:147)[202:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_121]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
14:34:54.433 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'xiaomivacuum:vacuum:034EE848' changed from OFFLINE (COMMUNICATION_ERROR): Receive timed out to OFFLINE (COMMUNICATION_ERROR): No valid status response

Can you include 2 more pieces from the log, while putting it to TRACE level

  1. Include the parts around sending the command & receiving the response -if any (it should now have the message details I think)
  2. the part where discovery is running, and it discovers the thing (it should now include a line with timing). Discovery runs each 5 min or if you push the discovery button in UI.

This part of the error log is not so interesting… it is the communication part where things go wrong and where now is some more logging done.

@marcel_verpaalen
Yes of course. :slight_smile:

Here the Discovery:

16:43:28.916 [TRACE] [aomivacuum.discovery.VacuumDiscovery] - Discovery on 224.0.0.1 error: Receive timed out
16:43:28.925 [TRACE] [aomivacuum.discovery.VacuumDiscovery] - Discovery responses from : 172.16.182.244:21 31 00 20 00 00 00 00 03 4E E8 48 59 5A 58 0E FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
16:43:28.929 [DEBUG] [aomivacuum.discovery.VacuumDiscovery] - Vacuum time stamp: 2017-07-03T16:43:26, OH time 2017-07-03T16:43:28.929, delta 1
16:43:28.933 [DEBUG] [aomivacuum.discovery.VacuumDiscovery] - Discovered Xiaomi Robot Vacuum 034EE848 at 172.16.182.244
16:43:28.936 [DEBUG] [aomivacuum.discovery.VacuumDiscovery] - No token discovered for device 034EE848. To discover token reset the vacuum & connect to it's wireless network and re-run discovery
16:43:52.365 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Update vacuum status 'xiaomivacuum:vacuum:034EE848'
16:43:52.371 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Using vacuum serial 034EE848
16:43:52.379 [DEBUG] [omivacuum.internal.RoboCommunication] - Send command: {'method': 'get_status', 'id': 1} -> 172.16.182.244 (token: XXXXXXXXXXX)
16:43:57.393 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Empty response received.
java.lang.NullPointerException
        at java.io.StringReader.<init>(StringReader.java:50)[:1.8.0_121]
        at com.google.gson.JsonParser.parse(JsonParser.java:45)[10:com.google.gson:2.3.1]
        at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.getResultHelper(XiaomiVacuumHandler.java:366)[202:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
        at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.updateVacuumStatus(XiaomiVacuumHandler.java:197)[202:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
        at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.updateData(XiaomiVacuumHandler.java:293)[202:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
        at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.lambda$0(XiaomiVacuumHandler.java:147)[202:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_121]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

i can’t send any command cause it tells me its offline and the command is ignored. Only de refresh command ist set off but no message details in output.

@p_schlarb thanks, that rules out 1 of the problems-> the timing differences. Seems the clock is perfect in sync.

Now I realize that somehow it does not arrive at my nice new code wrt to the logging. It seems to happer prior to where I assumed the error was thrown. anyway, I managed to replicate this sort of response by putting in a wrong token, hence can improve how to catch this error…

Handling the error however, does not fix the problem of why the vacuum thinks you are sending an invalid command.
Have you tried https://github.com/rytilahti/python-mirobo ? Is it working with the token you have?

Are you manually adding the things, or let it be discovered and than updating the token? if you done it manually, would you mind deleting the thing and have it added by discovery and than update the token, maybe there is a difference due to the deviceID. If the thing was there already for some time, please also delete it and let it be discovered again, so the full config is populated.

@marcel_verpaalen
i’ve done your suggestion and it seems to work. I deleted the thing and all Bindings. Let the Robot be discoverd and added it from the discovery. Since 10 Minutes the Robot is online and i got no single Error.

Thanks!

Update worked after restart of openhab.
Here’s the new output:

20:53:15.132 [TRACE] [aomivacuum.discovery.VacuumDiscovery] - Discovery responses from : 192.168.2.122:21 31 00 20 00 00 00 00 03 D7 89 9B 59 5A 92 98 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20:53:15.142 [DEBUG] [aomivacuum.discovery.VacuumDiscovery] - Vacuum time stamp: 2017-07-03T20:53:12, OH time 2017-07-03T20:53:15.141, delta 1
20:53:15.145 [DEBUG] [aomivacuum.discovery.VacuumDiscovery] - Discovered Xiaomi Robot Vacuum 03D7899B at 192.168.2.122

And then:

20:54:34.057 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Initializing Xiaomi Robot Vacuum handler 'xiaomivacuum:vacuum:03D7899B'
20:54:34.085 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Getting vacuum serial
20:54:34.099 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Polling job scheduled to run every 30 sec. for 'xiaomivacuum:vacuum:03D7899B'
20:54:39.099 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Update vacuum status 'xiaomivacuum:vacuum:03D7899B'
20:54:39.107 [DEBUG] [omivacuum.internal.RoboCommunication] - Send command: {'method': 'get_status', 'id': 1} -> 192.168.2.122 (token: ************************)
20:54:44.146 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Empty response received.
java.lang.NullPointerException
	at java.io.StringReader.<init>(StringReader.java:50)[:1.8.0_121]
	at com.google.gson.JsonParser.parse(JsonParser.java:45)[13:com.google.gson:2.3.1]
	at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.getResultHelper(XiaomiVacuumHandler.java:366)[244:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
	at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.updateVacuumStatus(XiaomiVacuumHandler.java:197)[244:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
	at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.updateData(XiaomiVacuumHandler.java:293)[244:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
	at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.lambda$0(XiaomiVacuumHandler.java:147)[244:org.openhab.binding.xiaomivacuum:2.2.0.201707021014]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_121]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

The Binding does not work if you add more than one Xiaomi Vacuum in the Binding. The Status of both Robot switches between “OFFLINE - COMMUNICATION_ERROR No valid status response” and Online. The Token worked before, but after adding the second one, it stopped. Reinstalling the Binding also makes no difference. In the ioBroker-Forum is written: “If you got more than one, you have to change the local port”. This is not possible in the binding. I hope you can implement this setting also. But i don´t think that this would make this work, as only adding one of the two robots doesnt work anymore. I´ve tried to delete the thing, binding, cache & tmp and start right from the beginning again, but the same error still occours:

09:06:14.752 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Empty response received. java.lang.NullPointerException 09:06:14.752 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘xiaomivacuum:vacuum:03D87B3E’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Receive timed out 09:06:14.754 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘xiaomivacuum:vacuum:03D87B3E’ changed from OFFLINE (COMMUNICATION_ERROR): Receive timed out to OFFLINE (COMMUNICATION_ERROR): No valid status response 09:06:25.234 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Update vacuum status ‘xiaomivacuum:vacuum:034D720F’ 09:06:25.236 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Using vacuum serial 034D720F 09:06:25.236 [DEBUG] [omivacuum.internal.RoboCommunication] - Send command: {‘method’: ‘get_status’, ‘id’: 1} -> 10.0.0.92 (token: 30QxxxxxxxYRMB) 09:06:25.240 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘xiaomivacuum:vacuum:034D720F’ changed from OFFLINE (COMMUNICATION_ERROR): No valid status response to ONLINE 09:06:30.242 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Empty response received. java.lang.NullPointerException 09:06:30.245 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘xiaomivacuum:vacuum:034D720F’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Receive timed out 09:06:30.246 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘xiaomivacuum:vacuum:034D720F’ changed from OFFLINE (COMMUNICATION_ERROR): Receive timed out to OFFLINE (COMMUNICATION_ERROR): No valid status response 09:06:44.754 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Update vacuum status ‘xiaomivacuum:vacuum:03D87B3E’ 09:06:44.754 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Using vacuum serial 03D87B3E 09:06:44.754 [DEBUG] [omivacuum.internal.RoboCommunication] - Send command: {‘method’: ‘get_status’, ‘id’: 1} -> 10.0.0.92 (token: bwwxxxxxxxpWO) 09:06:44.755 [INFO ] [me.event.ThingStatusInfoChangedEvent] - ‘xiaomivacuum:vacuum:03D87B3E’ changed from OFFLINE (COMMUNICATION_ERROR): No valid status response to ONLINE 09:06:49.760 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Empty response received. java.lang.NullPointerException at java.io.StringReader.(StringReader.java:50)[:1.8.0_131] at com.google.gson.JsonParser.parse(JsonParser.java:45)[10:com.google.gson:2.3.1] at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.getResultHelper(XiaomiVacuumHandler.java:366)[209:org.openhab.binding.xiaomivacuum:2.2.0.201707021014] at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.updateVacuumStatus(XiaomiVacuumHandler.java:197)[209:org.openhab.binding.xiaomivacuum:2.2.0.201707021014] at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.updateData(XiaomiVacuumHandler.java:293)[209:org.openhab.binding.xiaomivacuum:2.2.0.201707021014] at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.lambda$0(XiaomiVacuumHandler.java:147)[209:org.openhab.binding.xiaomivacuum:2.2.0.201707021014] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131] at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]

and

openhab> log:display org.openhab.binding.xiaomivacuum 09:51:18.087 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Update vacuum status ‘xiaomivacuum:vacuum:034D720F’ 09:51:18.088 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Using vacuum serial 034D720F 09:51:18.088 [DEBUG] [omivacuum.internal.RoboCommunication] - Send command: {‘method’: ‘get_status’, ‘id’: 1} -> 10.0.0.91 (token: 30QxxxxxxRMB) 09:51:23.092 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Empty response received. java.lang.NullPointerException at java.io.StringReader.(StringReader.java:50)[:1.8.0_131] at com.google.gson.JsonParser.parse(JsonParser.java:45)[10:com.google.gson:2.3.1] at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.getResultHelper(XiaomiVacuumHandler.java:366)[209:org.openhab.binding.xiaomivacuum:2.2.0.201707021014] at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.updateVacuumStatus(XiaomiVacuumHandler.java:197)[209:org.openhab.binding.xiaomivacuum:2.2.0.201707021014] at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.updateData(XiaomiVacuumHandler.java:293)[209:org.openhab.binding.xiaomivacuum:2.2.0.201707021014] at org.openhab.binding.xiaomivacuum.handler.XiaomiVacuumHandler.lambda$0(XiaomiVacuumHandler.java:147)[209:org.openhab.binding.xiaomivacuum:2.2.0.201707021014] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131] at java.lang.Thread.run(Thread.java:748)[:1.8.0_131] 09:51:53.093 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Update vacuum status ‘xiaomivacuum:vacuum:034D720F’ 09:51:53.093 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Using vacuum serial 034D720F 09:51:53.094 [DEBUG] [omivacuum.internal.RoboCommunication] - Send command: {‘method’: ‘get_status’, ‘id’: 1} -> 10.0.0.91 (token: 30QxxxxxxxRMB) 09:52:28.097 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Update vacuum status ‘xiaomivacuum:vacuum:034D720F’ 09:52:28.098 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Using vacuum serial 034D720F 09:52:28.098 [DEBUG] [omivacuum.internal.RoboCommunication] - Send command: {‘method’: ‘get_status’, ‘id’: 1} -> 10.0.0.91 (token: 30QxxxxxxxxRMB) 09:52:33.102 [DEBUG] [mivacuum.handler.XiaomiVacuumHandler] - Empty response received. java.lang.NullPointerException 09:52:45.678 [TRACE] [aomivacuum.discovery.VacuumDiscovery] - Discovery on 224.0.0.1 error: Receive timed out 09:52:45.679 [TRACE] [aomivacuum.discovery.VacuumDiscovery] - Discovery responses from : 10.0.0.91:21 31 00 20 00 00 00 00 03 4D 72 0F 59 5B 49 4B FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09:52:45.679 [DEBUG] [aomivacuum.discovery.VacuumDiscovery] - Vacuum time stamp: 2017-07-04T09:52:43, OH time 2017-07-04T09:52:45.679, delta 1 09:52:45.679 [DEBUG] [aomivacuum.discovery.VacuumDiscovery] - Discovered Xiaomi Robot Vacuum 034D720F at 10.0.0.91 09:52:45.679 [DEBUG] [aomivacuum.discovery.VacuumDiscovery] - No token discovered for device 034D720F. To discover token reset the vacuum & connect to it’s wireless network and re-run discovery

For those installing the binding via market place:

Did minor update that will improve the error logging & improve formatting of the DND times.
Note for those updating, please remove your vacuum thing (don’t forget to store your token) and add it back again after the update. This is needed as the config was changed

@BOFH90 send you PM wrt for specific test version to test the multiple vacuums

Your test-version is working successfully with two robots. Even the auto-discovery for both is working after installing the binding.

Thank you so much for your effort.

EDIT: It now started to fail again:
2017-07-05 12:30:52.342 [hingStatusInfoChangedEvent] - ‘xiaomivacuum:vacuum:03D87B3E’ changed from OFFLINE (COMMUNICATION_ERROR): Die Adresse wird bereits verwendet (Bind failed) to OFFLINE (COMMUNICATION_ERROR): No valid status response

2017-07-05 12:30:54.995 [hingStatusInfoChangedEvent] - ‘xiaomivacuum:vacuum:034D720F’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No valid status response

2017-07-05 12:31:30.022 [hingStatusInfoChangedEvent] - ‘xiaomivacuum:vacuum:034D720F’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No valid status response

The binding works like a charm, thanks for that!

What does the variable “in_cleaning” show? For me it doesn’t change while the vacuum is cleaning (which can be determined by the state variable anyway). Does it show the need to empty the dust bin?

Are the maps of the cleaning process created and stored in the vacuum itself or somewhere in China? Is it possible to get the map of the current and past cleaning processes without using the Mi Home app/without internet access?

The Binding now works for one of both robots, the second one worked for 2-5 minutes and then switching between offline and online again. But the first is online and working since 2 hours now.

I see in the python script an interesting remark
Anyway, thanks to #21 I realized that the id generation is the problem and I got the cli tool working again by not reusing the same 'id' for communication (the robot answers once per 'id' in a specific time-frame.

which may occur with the way the binding is configured. it could explain why it works for some time and than not.
In the binding each time an error occurs, I reset this id to 1, which may lead that within the timeframe no more commands are accepted.

1 Like

I made a small update to the binding.

To easier have the latest info available I made a new topic for the binding in the bindings category to continue the discussion

Hi, I’m trying to connect to my new vacuum cleaner that I received today, but so far no luck with that.
It seems that my device has some strange device ID. Xiaomi Mi Robot Vacuum should have 0x02f2 (754), but I’m getting 984 (0x03D8).

INFO:mirobo.device:Sending discovery to <broadcast> with timeout of 5s..
INFO:mirobo.device: IP 192.168.8.1: 984 - token: b'51344c5942785736757a3133766a7836'

Firmware version of my device is: 3.3.9_003077.

When I try to connect it always ends up with timeout:

INFO:mirobo.cli:Debug mode active
ERROR:mirobo.cli:Unable to read the stored msgid: [Errno 2] No such file or directory: '/tmp/python-mirobo.seq'
DEBUG:mirobo.cli:Connecting to 192.168.3.100 with token 51344c5942785736757a3133766a7836
DEBUG:mirobo.protocol:Unable to decrypt, returning raw bytes.
DEBUG:mirobo.device:Discovered 984 18672 with ts: 2017-07-13 21:15:10
DEBUG:mirobo.device:192.168.3.100:54321 >>: {'id': 1, 'method': 'get_status'}
ERROR:mirobo.device:got error when receiving: timed out
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/mirobo/device.py", line 129, in send
data, addr = s.recvfrom(1024)
socket.timeout: timed out

Have somebody came across to this?
Thanks for info