Page 13 of 16
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Friday 29 November 2019 16:03
by hoeby
RichardBokker wrote: ↑Thursday 28 November 2019 9:49
Yes, IP is the same, that is fixed on router based on MAC-Adres.
Both vacuum cleaners have the same IP?
This can't work. Be sure, the don't have the same address
RichardBokker wrote: ↑Thursday 28 November 2019 9:49
I had them on chinese server to get my token on old MiHome app + adb procedure.
Does the ID or Token change on new server? Should i keep the cleaners on chinese server?
I found that everytime you do something in the app. remove and add. Of switch between servers, that the token changes.
The token is not personalized to your vacuum cleaner
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Friday 29 November 2019 19:19
by RichardBokker
hoeby wrote: ↑Friday 29 November 2019 16:03
RichardBokker wrote: ↑Thursday 28 November 2019 9:49
Yes, IP is the same, that is fixed on router based on MAC-Adres.
Both vacuum cleaners have the same IP?
This can't work. Be sure, the don't have the same address
RichardBokker wrote: ↑Thursday 28 November 2019 9:49
I had them on Chinese server to get my token on old MiHome app + adb procedure.
Does the ID or Token change on new server? Should i keep the cleaners on Chinese server?
I found that every-time you do something in the app. remove and add. Of switch between servers, that the token changes.
The token is not personalised to your vacuum cleaner
Haha correct, both cleaners having their own unique IP of course. I just try to mention that IP was not changed during that time.
Your second quote is very useful. So apparently you cannot put a dutch server on, because you are not able to get the tokens in a adb backup in the older app version.
So in that case u should use an other server (i.a. singapore) and stay on it. thats bad

Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Friday 29 November 2019 19:34
by hoeby
I share your thoughed. It is sad.
I changed everything from the gateway to zigbee2mqtt. But the vacuum cleaner doesn't without the chinese server.
It is that, or clean with your manual vacuum cleaner
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 17 December 2019 23:27
by tjabas
is it possible to get it to work with zone cleaning?
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Sunday 29 December 2019 19:07
by mioiox
Prutsium wrote: ↑Monday 25 November 2019 9:06
Hi as my S5 Max would be arriving this week started to read a bit about this plugin.
Now i noticed all is based round the Mi Home app but as far as i know the S5 Max uses the Roborock app.
Is the guide then the same or wouldn't it work?
I am in the same situation (S5 Max and Roborock app). I tried* to find a way to extract the token from the ios Roborock app, but without success. I was also thinking of using both apps (Roborock and MiHome), however this most probably is not possible, since each of them wants the robot to be added. And the step of adding it will regenerate the token, presumably.
Has someone succeeded with this?
P.S. What I did so far:
1. Backed up iphone (don't have access to an Android, currently)
2. Opened backup using iBackup Viewer (free)
3. Browsed the branch com.roborock.smart and extracted every non-png file
3. Not many of those are readable. Probably the info in question resides within the index.ios.bundle file (which is around 3.5 MB), however I couldn't find anything useful (that looks like a hex token).
I (and others, I guess) would be really grateful for some insights!
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Saturday 25 January 2020 13:53
by macieiks
Hi,
I'm at the purchase stage of automatic vacuum cleaner. Checking this 13 page topic I see that Xiaomi would be a good solution when comparing price/quality/functionality ratio. As per description I see this plugin is based on original rytilahti python-miio library. Does it mean that it supports all vacuums listed on that library webpage with their full compatibilities? Especially I am interested in buying Xiaomi Mijia STYJ02YM (Viomi V2 Pro), Could someone confirm before purchase? Is there a possibility to use mop functionality nowadays with this Domoticz plugin?
Thanks.
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Monday 17 February 2020 21:05
by tjabas
after updating to Buster the plugin stopped working, the roborock control says off in the status, and if i restart the plugin i get this in the log:
2020-02-17 21:02:01.322 Status: (Roborock s50) Started.
2020-02-17 21:02:01.541 Status: (Roborock s50) Entering work loop.
2020-02-17 21:02:01.541 Status: (Roborock s50) Initialized version 0.1.3, author 'mrin'
nothing more, anyone else who has this problem?
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Monday 17 February 2020 23:16
by Geitje
Yeah, had this too when upgrading to Buster. I needed some extra libs. I just walked through the installation process again, looked at the errors and advices the terminal gave, and got it fixed.
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 18 February 2020 6:53
by tjabas
Thanks, did you have to ad the token again?
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 18 February 2020 17:11
by tjabas
now i have installed the plugin again, but not everything works as it should, i can start the vaccum from domoticz, but i cant set the status of it, cant see battery or anything.
here is some of the log:
(.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ sudo ./test.py
test: python modules path: ././.env/lib/python3.7/site-packages
test: python modules path: ././.env/lib/python3.4/site-packages
test: trying connect to 127.0.0.1:22222
test: sent request to server [status]
test: reading response...
test: got server reply {'error': None, 'state_code': 8, 'battery': 100, 'fan_lev el': 38, 'clean_seconds': 3981, 'clean_area': 49.5025, 'cmd': 'status'}
what can be wrong?
i run Buster on rpi3
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 18 February 2020 17:17
by tjabas
i also get this error in the domoticz log:
2020-02-18 17:15:58.866 Error: (xiaomi-mi-robot-vacuum) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/xiaomi-mirobot/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-02-18 17:15:58.866 Error: (Roborock s50) Module Import failed, exception: 'AttributeError'
2020-02-18 17:15:58.866 Error: (Roborock s50) Error Line details not available.
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 18 February 2020 18:38
by Geitje
Did you do
Code: Select all
sudo chmod +x miio_server.py
sudo chmod +x miio_server.sh
In the domoticz/plugins/xiaomi-mirobot dir?
It recieves data from server, but seems the plugin is not working well.
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 18 February 2020 19:14
by tjabas
Yes i did sudo chmod , i have gone through the installation process several times, but it wont work, should i delete the old installation folder in domoticz /plugins before i install the plugin again? I havent done that before?
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 18 February 2020 19:25
by Jojik1
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 18 February 2020 20:34
by tjabas
thank you all for your help, i had to delete the old installation folder and delete the plugin in plugin manager, then ad the plugin in the meny again and now it works.
thanks again

Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 18 February 2020 20:44
by tjabas
hmm, now i turned of the plugin in the plugin manager just to see if it starts again, but now i get error codes again:
2020-02-18 20:41:38.185 Error: (xiaomi-mi-robot-vacuum) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/xiaomi-mirobot/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-02-18 20:41:38.185 Error: (roborock) Module Import failed, exception: 'AttributeError'
2020-02-18 20:41:38.185 Error: (roborock) Error Line details not available.
for it to work again i need to remove the plugin and restart domoticz, then ad the plugin again for it to work.
what can be wrong?
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 18 February 2020 21:33
by tjabas
and here is a log when the plugin works after a rebot of Domoticz:
2020-02-18 21:30:31.738 (roborock) Pushing 'ReadEvent' on to queue
2020-02-18 21:30:31.775 (roborock) Processing 'ReadEvent' message
2020-02-18 21:30:31.775 (roborock) Received 86 bytes of data
2020-02-18 21:30:31.775 (roborock) 87 a5 65 72 72 6f 72 c0 aa 73 74 61 74 65 5f 63 6f 64 65 08 ǥerror�state_code.
2020-02-18 21:30:31.775 (roborock) a7 62 61 74 74 65 72 79 64 a9 66 61 6e 5f 6c 65 76 65 6c 3c Ǣatterydɦan_level<
2020-02-18 21:30:31.775 (roborock) ad 63 6c 65 61 6e 5f 73 65 63 6f 6e 64 73 04 aa 63 6c 65 61 ͣlean_seconds.ʣlea
2020-02-18 21:30:31.775 (roborock) 6e 5f 61 72 65 61 cb 00 00 00 00 00 00 00 00 a3 63 6d 64 a6 n_areaˮ.......ãmd�
2020-02-18 21:30:31.775 (roborock) 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. .. .. status
2020-02-18 21:30:31.775 (roborock) Pushing 'onMessageCallback' on to queue
2020-02-18 21:30:31.775 (roborock) Processing 'onMessageCallback' message
2020-02-18 21:30:31.775 (roborock) Calling message handler 'onMessage'.
2020-02-18 21:30:31.775 (roborock) Got: {'error': None, 'state_code': 8, 'battery': 100, 'fan_level': 60, 'clean_seconds': 4, 'clean_area': 0.0, 'cmd': 'status'}
there is an error code on the 4:th line from the top.
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 18 February 2020 23:43
by Jojik1
2020-02-18 23:41:17.613 (robot) Pushing 'onHeartbeatCallback' on to queue
2020-02-18 23:41:17.614 (robot) Processing 'onHeartbeatCallback' message
2020-02-18 23:41:17.614 (robot) Calling message handler 'onHeartbeat'.
2020-02-18 23:41:17.614 (robot) Pushing 'WriteDirective' on to queue
2020-02-18 23:41:17.614 (robot) Processing 'WriteDirective' message
2020-02-18 23:41:17.614 (robot) Sending 8 bytes of data
2020-02-18 23:41:17.614 (robot) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. Ѧstatus
2020-02-18 23:41:17.672 (robot) Pushing 'ReadEvent' on to queue
2020-02-18 23:41:17.715 (robot) Processing 'ReadEvent' message
2020-02-18 23:41:17.715 (robot) Received 88 bytes of data
2020-02-18 23:41:17.715 (robot) 87 a5 65 72 72 6f 72 c0 aa 73 74 61 74 65 5f 63 6f 64 65 08 ǥerror�state_code.
2020-02-18 23:41:17.715 (robot) a7 62 61 74 74 65 72 79 64 a9 66 61 6e 5f 6c 65 76 65 6c 4b Ǣatterydɦan_levelK
2020-02-18 23:41:17.715 (robot) ad 63 6c 65 61 6e 5f 73 65 63 6f 6e 64 73 cd 01 2b aa 63 6c ͣlean_secondsͮ+ʣl
2020-02-18 23:41:17.715 (robot) 65 61 6e 5f 61 72 65 61 cb 40 1b 2e 14 7a e1 47 ae a3 63 6d ean_areaˀ...zᇮãm
2020-02-18 23:41:17.715 (robot) 64 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. dƳtatus
2020-02-18 23:41:17.715 (robot) Pushing 'onMessageCallback' on to queue
2020-02-18 23:41:17.715 (robot) Processing 'onMessageCallback' message
2020-02-18 23:41:17.715 (robot) Calling message handler 'onMessage'.
2020-02-18 23:41:17.715 (robot) Got: {'error': None, 'state_code': 8, 'battery': 100, 'fan_level': 75, 'clean_seconds': 299, 'clean_area': 6.795, 'cmd': 'status'}
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Friday 28 February 2020 14:23
by avgays
tjabas wrote: ↑Tuesday 18 February 2020 20:44
for it to work again i need to remove the plugin and restart domoticz, then ad the plugin again for it to work.
Do you really need to REMOVE the plugin?
In my case this is "usual" way THIS plugin works -
any changes can be applied only by restarting Domotics after re-configuring/restarting plugin in the plugin manager (which always cause error)
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Friday 28 February 2020 14:40
by tjabas
Hi!
well youre right about that, i also noticed that i dont need to reinstall the plugin, i just need to reboot domoticz for it to work again, but i still get all these errors in the log:
2020-02-28 13:49:18.931 Error: roborock hardware (19) thread seems to have ended unexpectedly
2020-02-28 13:58:04.104 Error: roborock hardware (19) thread seems to have ended unexpectedly
2020-02-28 14:00:10.965 Error: roborock hardware (19) thread seems to have ended unexpectedly
2020-02-28 14:05:33.830 Error: roborock hardware (19) thread seems to have ended unexpectedly
2020-02-28 14:05:47.833 Error: roborock hardware (19) thread seems to have ended unexpectedly
2020-02-28 14:07:53.857 Error: roborock hardware (19) thread seems to have ended unexpectedly
2020-02-28 14:13:30.800 Error: roborock hardware (19) thread seems to have ended unexpectedly
2020-02-28 14:15:37.545 Error: roborock hardware (19) thread seems to have ended unexpectedly
but the vaccum seems to be connected anyway, is there a way to disable these error masseges?
it fill my log all the time.