Python plugin: Xiaomi Mi Robot Vacuum Topic is solved

Python and python framework

Moderator: leecollings

Joep123
Posts: 56
Joined: Monday 26 March 2018 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Blocky, ant mirobot state

Post by Joep123 »

KiiB wrote: Friday 07 June 2019 13:58 Maybe anyone tried to insert mi robot " State 12: 'In Error' " in blocky script?
Not Blockly but I use this script: https://ehoco.nl/xiaomi-roborock-s5-aut ... tofzuigen/
Works fine!

Maybe you can adjust the code a bit to your wishes.
KiiB
Posts: 8
Joined: Tuesday 13 March 2018 22:40
Target OS: Linux
Domoticz version: Stable
Location: Europe
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by KiiB »

Thank You,
I will investigate this, but for now i'm useless with LUA :)
It's strange that it is impossible to read state value in blocky even if own event interface can read them
idx last update Name State Value
237 2019-06-10 09:54:04 Xiaomi Mi Robot Vacuum - Status Off 0/Charging
Joep123
Posts: 56
Joined: Monday 26 March 2018 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Blocky, ant mirobot state

Post by Joep123 »

KiiB wrote: Friday 07 June 2019 13:58 pick up field do not work because "In error" have same state as "charging" or "paused". Thoose all statuses in domoticz are shown as state 0.
Value is shown as "0/In Error" but cant get it working with that syntax.
The status of the Robot Vacuum is On or Off (not Charging, In Error, Paused, etc.).
I guess you can only use On/Off in Blockly.

Try the LUA or dzVents scripts at https://ehoco.nl/xiaomi-roborock-s5-aut ... tofzuigen/, it isn't that difficult...
KiiB
Posts: 8
Joined: Tuesday 13 March 2018 22:40
Target OS: Linux
Domoticz version: Stable
Location: Europe
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by KiiB »

Dear Joep,
Yes, as button there is only 2 states of switch. On and Off,
But there is more information about state.
siurblio statusas.jpg
siurblio statusas.jpg (251.62 KiB) Viewed 5287 times
As You see in picture

Off 0/Paused
Off 0/Sleeping
Off 0/Charging
Off 0/In Error
On 1/Back to Home
On 1/Cleaning

These are states i saw until now. You even can find those values in "Status" button logs....
Hope someone could teach me how to use them in blocky script or at least dummy switch

EDIT:Looks like i can use that value with user variable.
Joep123
Posts: 56
Joined: Monday 26 March 2018 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Joep123 »

KiiB wrote: Monday 10 June 2019 14:02 Off 0/Paused
Off 0/Sleeping
Off 0/Charging
Off 0/In Error
On 1/Back to Home
On 1/Cleaning

These are states i saw until now. You even can find those values in "Status" button logs....
There is one more: "Off 0/Waiting".
hoeby
Posts: 531
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by hoeby »

Last week the xiaomi vacuum 1s was delivered.
Today i followed the github instructions.
Most difficult thing was to get the token. The rest was just follow the instructions and i works. And not just it works, i works very good.

Thanks to everyone who made this possible, for all the hard work and documentation
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
dobber
Posts: 19
Joined: Saturday 07 May 2016 1:43
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta..
Location: Sweden
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by dobber »

Installation broken on Raspbian Buster RPi4.

During installation there are lots of errors when using Rpi4 and Buster.

Errors occur after this:
Building wheels for collected packages: gevent, msgpack-python, greenlet
Building wheel for gevent (setup.py) ... \

End result is crash and burn. Installation does not work.
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by DAVIZINHO »

Hello,
Can someone configure this plugin in a docker instalation of domoticz?

im very interesting but i cant :-(

thanks a lot!
-David-
henryco
Posts: 6
Joined: Wednesday 13 January 2016 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by henryco »

Bonjour,

The Care-sensors indicator is always decreasing (now at 58%) even if i clean the sensors ... do you have the same behaviour and should we care about it ?
hoeby
Posts: 531
Joined: Saturday 02 June 2018 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.1
Location: Echt, Netherlands
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by hoeby »

henryco wrote: Thursday 10 October 2019 8:56 The Care-sensors indicator is always decreasing (now at 58%) even if i clean the sensors ... do you have the same behaviour and should we care about it ?
They do decrease.
After cleaning go to "switch" devices in domoticz. There is a device to reset the sensors/filters.
Reset the care-sensor and it is back to 100%

The percentage is just counting down in the usage. It is not measured by the device. Therefor cleaning doesn't help.


Image
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
airmarshall
Posts: 19
Joined: Friday 04 August 2017 19:21
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by airmarshall »

Hi Guys,

Trying to install the python-miio but it’s throwing a minimum python version error, requesting version >3.6.

Thus doesn’t seem available for my pi stretch install which is on the latest python 3.5.3 which is the version mentioned in all the ‘guides’ for install.

Any advice?
Hesmink
Posts: 168
Joined: Monday 22 June 2015 10:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Hesmink »

airmarshall wrote: Thursday 07 November 2019 17:14 Hi Guys,

Trying to install the python-miio but it’s throwing a minimum python version error, requesting version >3.6.

Thus doesn’t seem available for my pi stretch install which is on the latest python 3.5.3 which is the version mentioned in all the ‘guides’ for install.

Any advice?
My plugin was broken a while ago, and I ran into similar problems when trying to reinstall.

What I did to make it work with 3.5.3, and support my Roborock, was change pip_req.txt to:

Code: Select all

pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ more pip_req.txt
android-backup==0.1.0
asn1crypto==0.23.0
attrs==17.2.0
cffi==1.11.2
click==6.7
construct==2.9.31
cryptography==2.1.3
enum-compat==0.0.2
gevent==1.2.2
greenlet==0.4.12
idna==2.6
msgpack-python==0.4.8
netifaces==0.10.6
pretty-cron==1.0.2
pycparser==2.18
pycrypto==2.6.1
python-miio==0.3.8
pytz==2017.3
six==1.11.0
typing==3.6.2
zeroconf==0.19.1
Before running 'pip3 install -r pip_req.txt'

For me, after this the plugin seemed to work again, apart from the fact that a firmware upgrade probably changed my access token, and I haven't got around to retrieving it again.
airmarshall
Posts: 19
Joined: Friday 04 August 2017 19:21
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by airmarshall »

Thanks, you set me on the right track. The current latest release of python-miio added the requirement for python 3.7.

By appending the version number 0.4.6 to the install scripts has it working fine.
Hesmink wrote: Friday 08 November 2019 11:17
airmarshall wrote: Thursday 07 November 2019 17:14 Hi Guys,

Trying to install the python-miio but it’s throwing a minimum python version error, requesting version >3.6.

Thus doesn’t seem available for my pi stretch install which is on the latest python 3.5.3 which is the version mentioned in all the ‘guides’ for install.

Any advice?
My plugin was broken a while ago, and I ran into similar problems when trying to reinstall.

What I did to make it work with 3.5.3, and support my Roborock, was change pip_req.txt to:

Code: Select all

pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ more pip_req.txt
android-backup==0.1.0
asn1crypto==0.23.0
attrs==17.2.0
cffi==1.11.2
click==6.7
construct==2.9.31
cryptography==2.1.3
enum-compat==0.0.2
gevent==1.2.2
greenlet==0.4.12
idna==2.6
msgpack-python==0.4.8
netifaces==0.10.6
pretty-cron==1.0.2
pycparser==2.18
pycrypto==2.6.1
python-miio==0.3.8
pytz==2017.3
six==1.11.0
typing==3.6.2
zeroconf==0.19.1
Before running 'pip3 install -r pip_req.txt'

For me, after this the plugin seemed to work again, apart from the fact that a firmware upgrade probably changed my access token, and I haven't got around to retrieving it again.
airmarshall
Posts: 19
Joined: Friday 04 August 2017 19:21
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Android Mobile App Button Actions

Post by airmarshall »

So as per the screenshot the default button position is 'Clean'. If I reselect 'Clean' nothing happens to the robot. If I press 'Clean' in the webgui then the robot cleans as expected.

Anyone else experienced this?

Image
yahiko750
Posts: 1
Joined: Sunday 20 October 2019 14:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by yahiko750 »

Currently having this error, but it only happens when I change a setting on the "Hardware" tab like interval. The script itself works just fine. Anyone has an idea to squish this last nasty bug?

Code: Select all

2019-11-15 21:11:29.273 Error: (xiaomi-mi-robot-vacuum) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/MiRobotVacuum/:/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'.
2019-11-15 21:11:29.273 Error: (Roborock S55) Module Import failed, exception: 'AttributeError'
2019-11-15 21:11:29.273 Error: (Roborock S55) Error Line details not available.
RichardBokker
Posts: 39
Joined: Thursday 09 April 2015 20:57
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9317
Location: Netherlands
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by RichardBokker »

I want to add a second vacuum cleaner from same generation, what is de best solution for this?
Because the added hardware does not contain parameters like IP adres, ID and token.

Do a second clone, and rename clone-folder etc?
Other idea's?
Prutsium
Posts: 92
Joined: Monday 18 June 2018 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany / Netherlands
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Prutsium »

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?
avgays
Posts: 14
Joined: Monday 30 January 2017 12:02
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by avgays »

RichardBokker wrote: Sunday 24 November 2019 21:19 I want to add a second vacuum cleaner from same generation, what is de best solution for this?
Because the added hardware does not contain parameters like IP adres, ID and token.
Make copy of file miio_server.sh e.g. miio_server2.sh
Update IP and TOKEN for new robot and change PORT (--port 22223) in this file.
Then repeat steps 3-4 from installation instruction, changing miio_server to miio_server2 on each step
In Domoticz create Hardware with new PORT (22223)
RichardBokker
Posts: 39
Joined: Thursday 09 April 2015 20:57
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9317
Location: Netherlands
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by RichardBokker »

avgays wrote: Monday 25 November 2019 22:35
RichardBokker wrote: Sunday 24 November 2019 21:19 I want to add a second vacuum cleaner from same generation, what is de best solution for this?
Because the added hardware does not contain parameters like IP adres, ID and token.
Make copy of file miio_server.sh e.g. miio_server2.sh
Update IP and TOKEN for new robot and change PORT (--port 22223) in this file.
Then repeat steps 3-4 from installation instruction, changing miio_server to miio_server2 on each step
In Domoticz create Hardware with new PORT (22223)
Hmm, good one! Thnx. This should work, awesome! Gonna try it.
RichardBokker
Posts: 39
Joined: Thursday 09 April 2015 20:57
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9317
Location: Netherlands
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by RichardBokker »

i added me second vacuum with succes!

But after that, i resetted wifi of both my cleaners. To add them in de app on diferent server (netherlands instead someting chinese).
But now i can't control them anymore?
Yes, IP is the same, that is fixed on router based on MAC-Adres.

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?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest