Python plugin: Xiaomi Mi Robot Vacuum Topic is solved

Python and python framework

Moderator: leecollings

JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by JanvdW »

hoeby wrote: Thursday 11 June 2020 21:31
JanvdW wrote: Monday 08 June 2020 23:58 Does no one has an idea how to fix this issue?
Could you check if msgpack is correctly installed?
The error looks to have some connection with that.

Go to the .env environment to check.
When I install the msgpack again I get messages that requirements are already satisfied. I used the following commands:

Code: Select all

source .env/bin/activate
pip3 install gevent msgpack-python python-miio==0.3.1
This gives the follwing output

Code: Select all

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: gevent in ./.env/lib/python3.7/site-packages (20.5.0)
Requirement already satisfied: msgpack-python in ./.env/lib/python3.7/site-packages (0.5.6)
Requirement already satisfied: python-miio==0.3.1 in ./.env/lib/python3.7/site-packages (0.3.1)
Requirement already satisfied: greenlet>=0.4.14; platform_python_implementation == "CPython" in ./.env/lib/python3.7/site-packages (from gevent) (0.4.15)
Requirement already satisfied: android-backup in ./.env/lib/python3.7/site-packages (from python-miio==0.3.1) (0.1.0)
Requirement already satisfied: attrs in ./.env/lib/python3.7/site-packages (from python-miio==0.3.1) (17.2.0)
Requirement already satisfied: zeroconf in ./.env/lib/python3.7/site-packages (from python-miio==0.3.1) (0.26.2)
Requirement already satisfied: cryptography in ./.env/lib/python3.7/site-packages (from python-miio==0.3.1) (2.1.3)
Requirement already satisfied: typing in ./.env/lib/python3.7/site-packages (from python-miio==0.3.1) (3.7.4.1)
Requirement already satisfied: pytz in ./.env/lib/python3.7/site-packages (from python-miio==0.3.1) (2020.1)
Requirement already satisfied: click in ./.env/lib/python3.7/site-packages (from python-miio==0.3.1) (6.7)
Requirement already satisfied: pretty-cron in ./.env/lib/python3.7/site-packages (from python-miio==0.3.1) (1.2.0)
Requirement already satisfied: construct in ./.env/lib/python3.7/site-packages (from python-miio==0.3.1) (2.8.16)
Requirement already satisfied: pycrypto in ./.env/lib/python3.7/site-packages (from python-miio==0.3.1) (2.6.1)
Requirement already satisfied: ifaddr in ./.env/lib/python3.7/site-packages (from zeroconf->python-miio==0.3.1) (0.1.6)
Requirement already satisfied: six>=1.4.1 in ./.env/lib/python3.7/site-packages (from cryptography->python-miio==0.3.1) (1.11.0)
Requirement already satisfied: cffi>=1.7; platform_python_implementation != "PyPy" in ./.env/lib/python3.7/site-packages (from cryptography->python-miio==0.3.1) (1.11.2)
Requirement already satisfied: asn1crypto>=0.21.0 in ./.env/lib/python3.7/site-packages (from cryptography->python-miio==0.3.1) (0.23.0)
Requirement already satisfied: idna>=2.1 in ./.env/lib/python3.7/site-packages (from cryptography->python-miio==0.3.1) (2.6)
Requirement already satisfied: pycparser in ./.env/lib/python3.7/site-packages (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography->python-miio==0.3.1) (2.18)
hoeby
Posts: 528
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 »

Did you use this command line to install the plugin?

Code: Select all

pip3 install gevent msgpack-python python-miio==0.3.1
If so, i have bad experiance with it. It doesn't install all packages which are needed.
This command line will install much more, but look on page 14, that the pip_req.txt file is changed.
Without changing i kept having issues on OS Buster.

Code: Select all

pip3 install -r pip_req.txt 
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by JanvdW »

I am not sure if I understood you comment well, but if I run 'pip3 install -r pip_req.txt' in the .env environment I get a long list of error messages (can't even see all messages when I scroll back).
hoeby
Posts: 528
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 »

JanvdW wrote: Thursday 18 June 2020 23:05 I am not sure if I understood you comment well, but if I run 'pip3 install -r pip_req.txt' in the .env environment I get a long list of error messages (can't even see all messages when I scroll back).
If you run the original pip_req.txt file, then you have a lot of errors.
The first time i runned that command with the original pip_req.txt file i also got a lot of red errors messages.

This is the original pip_req.txt, which needs to be changed

Code: Select all

android-backup==0.1.0
asn1crypto==0.23.0
attrs==17.2.0
cffi==1.11.2
click==6.7
construct==2.8.16
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.1
pytz==2017.3
six==1.11.0
typing==3.6.2
zeroconf==0.19.1
Change it to this and then run the command 'pip3 install -r pip_req.txt' in the .env environment

Code: Select all

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.4.0
greenlet==0.4.15
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.4.4
pytz==2017.3
six==1.11.0
typing==3.6.2
zeroconf==0.19.1
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by JanvdW »

Thanks; I succeeded to run the command without errors now. Unfortunately the robot still doesn't react when I address him from Domoticz. Then I started the miio server from the console:

Code: Select all

sudo ./miio_server.py <ip address> <token id> --host 127.0.0.1 --port 22222
This results in the following output:

Code: Select all

server: Starting server on 127.0.0.1 22222
server: connected ('127.0.0.1', 34080)
./miio_server.py:67: DeprecationWarning: encoding is deprecated, Use raw=False instead.
  unpacker = Unpacker(encoding='utf-8')
server: got socket msg: ['status']
server: got socket msg: ['status']
Got error when receiving: timed out
server: vac result {'exception': 'python-miio: No response from the device', 'cmd': 'status'}
server: send reply ('127.0.0.1', 34080)
The ping result on the robot's ip is positive. I don't understand why the robot gives no response.
hoeby
Posts: 528
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 »

Just to be sure.
Is that first line the exact code you send?

This line

Code: Select all

sudo ./miio_server.py <ip address> <token id> --host 127.0.0.1 --port 22222
You need to replaced the ip address with the ip address from the vacuum. And token by its token.

An example

Code: Select all

sudo ./miio_server.py 192.168.1.12 476e6b70343055483230644c53707a12 --host 127.0.0.1 --port 22222 
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by JanvdW »

Yes, of course. I used the proper parameters :D
hoeby
Posts: 528
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 »

Did it worked in the past?
Or is it the first time?

Reason why, is to check if the token is right.
Don't un-install the vacuum in the app and add it again. Then the token will change.

I had some kind of error you had. But don't know if it was exactly the same.
This i had when i first installed with the wrong install line: pip3 install gevent msgpack-python python-miio==0.3.1
After that i cleared the SD and started with a fresh install and now used the modified pip_req.txt file. That went without errors.

Don't know if there is old stuff installed, because you first used to other install line. which gives the error.

further i don't know how to help you.
I am not that great with the codes. Hopefully someone else jumps in.
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by JanvdW »

It worked before, but not in my new Domoticz installation. I am not 100% sure if I reinstalled the app. I didn't thought that the token will change. When I have time I will check the token; I remember that takes some time (with an old version of the app, right?)
hoeby
Posts: 528
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 »

JanvdW wrote: Saturday 20 June 2020 23:03 It worked before, but not in my new Domoticz installation. I am not 100% sure if I reinstalled the app. I didn't thought that the token will change. When I have time I will check the token; I remember that takes some time (with an old version of the app, right?)
When i removed and add the vacuum in the app. Then i get a new token.

There a multi options to get the token.
The old version app is one of them
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
Romel
Posts: 15
Joined: Tuesday 06 August 2019 14:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Kromeriz / Czech
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Romel »

Hi all is this caused by wrong token ?

Code: Select all

(.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ miiocli device --ip 192.168.88.155 --token 5735396c756d554d79614e70496f6577 info
ERROR:miio.device:Got error when receiving: timed out
Error: No response from the device
Iam encountering to this problem:

Code: Select all

(.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ sudo ./miio_server.py 192.168.88.155 5735396C756D554D79614E70496F6577 --host 127.0.0.1 --port 22222
server: Starting server on 127.0.0.1 22222
server: connected ('127.0.0.1', 54120)
server: got socket msg: ['status']
Got error when receiving: timed out
Retrying with incremented id, retries left: 3
Got error when receiving: timed out
Retrying with incremented id, retries left: 2
Got error when receiving: timed out
Retrying with incremented id, retries left: 1
server: got socket msg: ['status']
Got error when receiving: timed out
server: vac result {'exception': 'python-miio: ', 'cmd': 'status'}

Code: Select all

(.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ ping 192.168.88.155
PING 192.168.88.155 (192.168.88.155) 56(84) bytes of data.
64 bytes from 192.168.88.155: icmp_seq=1 ttl=64 time=5.39 ms
64 bytes from 192.168.88.155: icmp_seq=2 ttl=64 time=2.71 ms
64 bytes from 192.168.88.155: icmp_seq=3 ttl=64 time=1.66 ms
no LAN firewall rules
two times I reseted vacuum for new token.
thanks in advance

SOLVED - bad TOKEN from wireshark. after used from Mi Home v 5.4.54 it is working

Code: Select all

(.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ python3 ./test.py
test: python modules path: ././.env/lib/python3.7/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_level': 102, 'clean_seconds': 1691, 'clean_area': 31.785, 'cmd': 'status'}
Last edited by Romel on Wednesday 15 July 2020 6:38, edited 2 times in total.
tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by tjabas »

is it possible to get roomcleaning with this plugin?

is it possible to speak to google home and say" clean the livingroom"?

it would be awsome if it was possible.
Hybris03
Posts: 3
Joined: Wednesday 07 August 2019 23:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Hybris03 »

Hello,
i just tested the plug-in with my xiaomi mi robot V1.
Everything appears fine in domoticz, but no action works and the levels remain at 0 (battery for example).
I am using the latest stable version of Domoticz.

When I run the following test command, it hangs on: Test: reading response
sudo service miio_server start
sudo chmod +x test.py
sudo ./test.py
Can you give me a hand ?

In the logs I have the following:
2020-07-30 11:57:18.460 (Aspirateur Xiaomi) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2020-07-30 11:57:18.460 (Aspirateur Xiaomi) 'HardwareID':'15'
2020-07-30 11:57:18.460 (Aspirateur Xiaomi) 'HomeFolder':'/home/pi/domoticz/plugins/xiaomi-mirobot/'
2020-07-30 11:57:18.460 (Aspirateur Xiaomi) 'StartupFolder':'/home/pi/domoticz/'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'UserDataFolder':'/home/pi/domoticz/'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Database':'/home/pi/domoticz/domoticz.db'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Language':'fr'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Version':'0.1.3'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Author':'mrin'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Name':'Aspirateur Xiaomi'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Port':'0'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Key':'xiaomi-mi-robot-vacuum'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Mode2':'15'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Mode4':'Debug'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Mode5':'selector'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'Mode6':'127.0.0.1:22222'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'DomoticzVersion':'2020.2 (build 12221)'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'DomoticzHash':'74c0c9fcc-modified'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) 'DomoticzBuildTime':'2020-07-12 10:47:23'
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) Device count: 9
2020-07-30 11:57:18.461 (Aspirateur Xiaomi) Device: 1 - ID: 80, Name: 'Aspirateur Xiaomi - Status', nValue: 0, sValue: ''
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device ID: '80'
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device Name: 'Aspirateur Xiaomi - Status'
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device nValue: 0
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device sValue: ''
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device LastLevel: 0
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device: 2 - ID: 81, Name: 'Aspirateur Xiaomi - Control', nValue: 0, sValue: ''
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device ID: '81'
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device Name: 'Aspirateur Xiaomi - Control'
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device nValue: 0
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device sValue: ''
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device LastLevel: 0
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device: 4 - ID: 82, Name: 'Aspirateur Xiaomi - Fan Level', nValue: 0, sValue: ''
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device ID: '82'
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device Name: 'Aspirateur Xiaomi - Fan Level'
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device nValue: 0
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device sValue: ''
2020-07-30 11:57:18.462 (Aspirateur Xiaomi) Device LastLevel: 0
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device: 5 - ID: 83, Name: 'Aspirateur Xiaomi - Battery', nValue: 0, sValue: ''
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device ID: '83'
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device Name: 'Aspirateur Xiaomi - Battery'
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device nValue: 0
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device sValue: ''
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device LastLevel: 0
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device: 6 - ID: 84, Name: 'Aspirateur Xiaomi - Care Main Brush', nValue: 0, sValue: ''
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device ID: '84'
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device Name: 'Aspirateur Xiaomi - Care Main Brush'
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device nValue: 0
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device sValue: ''
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device LastLevel: 0
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device: 7 - ID: 85, Name: 'Aspirateur Xiaomi - Care Side Brush', nValue: 0, sValue: ''
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device ID: '85'
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device Name: 'Aspirateur Xiaomi - Care Side Brush'
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device nValue: 0
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device sValue: ''
2020-07-30 11:57:18.463 (Aspirateur Xiaomi) Device LastLevel: 0
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device: 8 - ID: 86, Name: 'Aspirateur Xiaomi - Care Sensors', nValue: 0, sValue: ''
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device ID: '86'
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device Name: 'Aspirateur Xiaomi - Care Sensors'
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device nValue: 0
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device sValue: ''
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device LastLevel: 0
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device: 9 - ID: 87, Name: 'Aspirateur Xiaomi - Care Filter', nValue: 0, sValue: ''
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device ID: '87'
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device Name: 'Aspirateur Xiaomi - Care Filter'
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device nValue: 0
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device sValue: ''
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device LastLevel: 0
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device: 10 - ID: 88, Name: 'Aspirateur Xiaomi - Care Reset Control', nValue: 0, sValue: ''
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device ID: '88'
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device Name: 'Aspirateur Xiaomi - Care Reset Control'
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device nValue: 0
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device sValue: ''
2020-07-30 11:57:18.464 (Aspirateur Xiaomi) Device LastLevel: 0
2020-07-30 11:57:18.465 (Aspirateur Xiaomi) Pushing 'ProtocolDirective' on to queue
2020-07-30 11:57:18.465 (Aspirateur Xiaomi) Pushing 'PollIntervalDirective' on to queue
2020-07-30 11:57:18.465 (Aspirateur Xiaomi) Processing 'ProtocolDirective' message
2020-07-30 11:57:18.465 (Aspirateur Xiaomi) Protocol set to: 'None'.
2020-07-30 11:57:18.465 (Aspirateur Xiaomi) Processing 'PollIntervalDirective' message
2020-07-30 11:57:18.465 (Aspirateur Xiaomi) Heartbeat interval set to: 15.
2020-07-30 11:57:27.966 (Aspirateur Xiaomi) Pushing 'onHeartbeatCallback' on to queue
2020-07-30 11:57:27.980 (Aspirateur Xiaomi) Processing 'onHeartbeatCallback' message
2020-07-30 11:57:27.981 (Aspirateur Xiaomi) Calling message handler 'onHeartbeat'.
2020-07-30 11:57:27.981 (Aspirateur Xiaomi) Pushing 'ConnectDirective' on to queue
2020-07-30 11:57:27.981 (Aspirateur Xiaomi) Trying connect to MIIOServer 127.0.0.1:22222
2020-07-30 11:57:27.981 (Aspirateur Xiaomi) Processing 'ConnectDirective' message
2020-07-30 11:57:27.981 (Aspirateur Xiaomi) Transport set to: 'TCP/IP', 127.0.0.1:22222.
2020-07-30 11:57:27.982 (Aspirateur Xiaomi) Connect directive received, action initiated successfully.
2020-07-30 11:57:27.982 (Aspirateur Xiaomi) Pushing 'onConnectCallback' on to queue
2020-07-30 11:57:28.032 (Aspirateur Xiaomi) Processing 'onConnectCallback' message
2020-07-30 11:57:28.032 (Aspirateur Xiaomi) Calling message handler 'onConnect'.
2020-07-30 11:57:28.032 (Aspirateur Xiaomi) MIIOServer connection status is [0] [Success]
2020-07-30 11:57:42.969 (Aspirateur Xiaomi) Pushing 'onHeartbeatCallback' on to queue
2020-07-30 11:57:43.009 (Aspirateur Xiaomi) Processing 'onHeartbeatCallback' message
2020-07-30 11:57:43.009 (Aspirateur Xiaomi) Calling message handler 'onHeartbeat'.
2020-07-30 11:57:43.010 (Aspirateur Xiaomi) Pushing 'WriteDirective' on to queue
2020-07-30 11:57:43.010 (Aspirateur Xiaomi) Pushing 'WriteDirective' on to queue
2020-07-30 11:57:43.010 (Aspirateur Xiaomi) Processing 'WriteDirective' message
2020-07-30 11:57:43.010 (Aspirateur Xiaomi) Sending 19 bytes of data
2020-07-30 11:57:43.010 (Aspirateur Xiaomi) 91 b1 63 6f 6e 73 75 6d 61 62 6c 65 5f 73 74 61 74 75 73 .. ѱconsumable_status
2020-07-30 11:57:43.010 (Aspirateur Xiaomi) Processing 'WriteDirective' message
2020-07-30 11:57:43.010 (Aspirateur Xiaomi) Sending 8 bytes of data
2020-07-30 11:57:43.010 (Aspirateur Xiaomi) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. Ѧstatus
2020-07-30 11:57:57.972 (Aspirateur Xiaomi) Pushing 'onHeartbeatCallback' on to queue
2020-07-30 11:57:57.989 (Aspirateur Xiaomi) Processing 'onHeartbeatCallback' message
2020-07-30 11:57:57.989 (Aspirateur Xiaomi) Calling message handler 'onHeartbeat'.
2020-07-30 11:57:57.989 (Aspirateur Xiaomi) Pushing 'WriteDirective' on to queue
2020-07-30 11:57:57.989 (Aspirateur Xiaomi) Processing 'WriteDirective' message
2020-07-30 11:57:57.989 (Aspirateur Xiaomi) Sending 8 bytes of data
2020-07-30 11:57:57.989 (Aspirateur Xiaomi) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. Ѧstatus
2020-07-30 11:58:17.099 (Aspirateur Xiaomi) Pushing 'onHeartbeatCallback' on to queue
2020-07-30 11:58:17.105 (Aspirateur Xiaomi) Processing 'onHeartbeatCallback' message
2020-07-30 11:58:17.105 (Aspirateur Xiaomi) Calling message handler 'onHeartbeat'.
2020-07-30 11:58:17.106 (Aspirateur Xiaomi) Pushing 'WriteDirective' on to queue
2020-07-30 11:58:17.106 (Aspirateur Xiaomi) Processing 'WriteDirective' message
2020-07-30 11:58:17.106 (Aspirateur Xiaomi) Sending 8 bytes of data
2020-07-30 11:58:17.106 (Aspirateur Xiaomi) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. Ѧstatus
Hybris03
Posts: 3
Joined: Wednesday 07 August 2019 23:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Hybris03 »

Hello everyone again,
I found a little thing on the french domoticz forum to test the ip and the token.
Apparently I have a return, which confirms that the information entered is correct.
The problem therefore comes from elsewhere.
If you have any ideas ... I'm interested!
thank you in advance

Code: Select all

(.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ sudo service domoticz.sh restart
(.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ export MIROBO_IP=192.168.1.XX
(.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ export MIROBO_TOKEN=4e75566b30XX54536331XXXXXXXXXXXX
(.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ mirobo
State: Charging
Battery: 100 %
Fanspeed: 60 %
Cleaning since: 0:38:04
Cleaned area: 35.755 m²
Hybris03
Posts: 3
Joined: Wednesday 07 August 2019 23:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Hybris03 »

End of story,
after removing everything, I re-installed plugin but updating all the dependencies.
I used python-miio == 0.5.3
If that helps, there is a clear tutorial at the following address:

https://ehoco.nl/roborock-vacuum-cleane ... -domoticz/
Destyny
Posts: 3
Joined: Tuesday 24 March 2020 13:55
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Destyny »

Hi,

Has anyone installed mi-robot plugin on synology NAS (no-docker, no VM) ?
DarkAllMan
Posts: 52
Joined: Friday 23 December 2016 9:41
Target OS: Linux
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by DarkAllMan »

My Domoticz Device status is not updated.
When I send tasks the cleaner starts...
When I run test.py, I get following output:

Code: Select all

got server reply {'error': None, 'state_code': 5, 'battery': 82, 'fan_level': 106, 'clean_seconds': 180, 'clean_area': 2.3325, 'cmd': 'status'}
But the selector switch stays set to "OFF"
After checking github, it seems I'm missing the status device for my vaccuum cleaner:

Image

Forgot to enable this device.... got it now....
Argden
Posts: 1
Joined: Sunday 20 December 2020 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Argden »

Hello,

I have tried to add my Mi Robot to Domoticz exactly like in the instruction, but something is wrong.
Please see attached files.
What can be wrong?
Thanks!
Attachments
3.JPG
3.JPG (73.53 KiB) Viewed 2073 times
2.JPG
2.JPG (77.11 KiB) Viewed 2073 times
1.JPG
1.JPG (87.36 KiB) Viewed 2073 times
HFman
Posts: 82
Joined: Thursday 02 March 2017 20:28
Target OS: Linux
Domoticz version: V4.1174
Location: Netherlands
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by HFman »

Did you check the Domoticz LOG ?
Can you connect mannually to to the robot ?
Raspberry PI 3 - Opentherm Gateway + ESP8826 - EvoHome - ESPEasy CO2 + Fancontrol - RF-Link - zigbee2mqqt -
vodor
Posts: 39
Joined: Friday 19 February 2016 14:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by vodor »

Kinda related question: Anybody in this forum considered looking at communicating with their Xiaomi vaccum via Valentudo and MQTT from Domoticz?
This seem to be doable by using NodeRed however I would much rather prefer a MQTT plugin in domoticz.

Example https://blog.keroi.net/valetudo-libere-aspire-2/

NOTE: You might have to use google translate

Would love to year your thoughts
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest