Python plugin: Xiaomi Mi Robot Vacuum Topic is solved

Python and python framework

Moderator: leecollings

mrinner
Posts: 56
Joined: Tuesday 22 August 2017 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belarus
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by mrinner »

llheim wrote: Monday 06 November 2017 18:38 Error: CConnection_connect:, illegal operation, Plugin has not started yet.
Try the updated version 0.1.1 of plugin.
Also test.py updated for better error handling.

Thanks!
llheim
Posts: 8
Joined: Sunday 12 March 2017 15:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by llheim »

Next update (I got some time off from work so I can play around with Domoticz :) ): Building goes fine, running test.py goes fine (the 47 seconds in clean_seconds is correct. I don't have a very small house but I test started the mi robot yesterday to see it was online :) )
test: python modules path: ./.env/lib/python3.4/site-packages
test: starting server.py process
test: wait server starting... 5 seconds
server: Starting server on 127.0.0.1 22222
test: trying connect to 127.0.0.1:22222
test: sent request to server [status]
test: reading response...
server: connected ('127.0.0.1', 39072)
server: got socket msg: ['status']
server: vac result {'error': None, 'clean_seconds': 47, 'cmd': 'status', 'state_code': 8, 'fan_level': 60, 'clean_area': 0.6525, 'battery': 100}
test: got server reply {'cmd': 'status', 'state_code': 8, 'clean_area': 0.6525, 'error': None, 'battery': 100, 'fan_level': 60, 'clean_seconds': 47}
test: kill servery.py pid: 1181
However when i wanted to open Domoticz I got an offline message. Running systemctl status it showed 'exited'. Restarting the service didn't help so I renamed the xiaomi-robot folder and tried again. That didn't work. I than rebooted my rpi and that got Domoticz up and running again however without the Domoticz webserver. Strangely enough the xioami-robot server was running. Only after removing the complete xiaomi-robot directory and rebooting the Domotics webserver started again.

Unfortunately I don't know where Domoticz keeps its error logs so I can't give you that information (without the webserver I can't acces the logs from my browser) but it seems your server and the domoticz server can't get along.
Active: active (running) since di 2017-11-07 14:18:59 CET; 55s ago
Process: 621 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/domoticz.service
└─1108 python3 /home/pi/domoticz/plugins/xiaomi-mirobot.back/./ser...
mrinner
Posts: 56
Joined: Tuesday 22 August 2017 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belarus
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by mrinner »

llheim wrote: Tuesday 07 November 2017 14:46 Unfortunately I don't know where Domoticz keeps its error logs
Thanks for the debug! Now plugin looks much better than yesterday (tests works).
Let me know domoticz version. Today I've tried to help one person which uses stable 3.8153 and domoticz hangs, but after update to the latest beta plugin works fine (I'm on 3.8658)

You can configure log to file: edit domoticz.sh:
uncomment line, and change path: #DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"
Tommie
Posts: 8
Joined: Thursday 22 December 2016 23:20
Target OS: Linux
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Tommie »

Hi Mrinner,

Many thanks for your plugin and clear wiki!

I’ve installed all the prereqs, got the token and added the vacuum cleaner to Domoticz. But for now it seems that i cannot communicate with the vacuum cleaner. I hope you our someone can point me in the right direction with this issue...

Firstly i got the Domoticz offline message like Ilheim (post above). So updated Domoticz to the latest Beta version. This fixed the Domoticz Offline message.

But i still cannot communicatie with the vacuum.. what i did so far:

- checked all the prereqs again
- checked the token
- checked the vacuum’s IP (from Android App & i can ping the device)
- rebooted the Raspberry PI

Output from test.py:
test: python modules path: ./.env/lib/python3.4/site-packages
test: starting server.py process
test: wait server starting... 5 seconds
server: Starting server on 127.0.0.1 22222
Traceback (most recent call last):
File "././.env/lib/python3.4/site-packages/gevent/greenlet.py", line 536, in run
result = self._run(*self.args, **self.kwargs)
File "././.env/lib/python3.4/site-packages/gevent/baseserver.py", line 360, in serve_forever
self.start()
File "././.env/lib/python3.4/site-packages/gevent/baseserver.py", line 304, in start
self.init_socket()
File "././.env/lib/python3.4/site-packages/gevent/server.py", line 127, in init_socket
self.socket = self.get_listener(self.address, self.backlog, self.family)
File "././.env/lib/python3.4/site-packages/gevent/server.py", line 138, in get_listener
return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family)
File "././.env/lib/python3.4/site-packages/gevent/server.py", line 229, in _tcp_listener
sock.bind(address)
OSError: [Errno 98] Address already in use: ('127.0.0.1', 22222)
Wed Nov 8 14:55:07 2017 <Greenlet at 0x760d2e90: <bound method StreamServer.serve_forever of <StreamServer at 0x760e89f0 address=127.0.0.1:22222 handle=<function socket_incoming_connection at 0x760e1c90>>>> failed with OSError

Traceback (most recent call last):
File "./server.py", line 198, in <module>
services.join()
File "././.env/lib/python3.4/site-packages/gevent/pool.py", line 552, in join
result = self._empty_event.wait(timeout=timeout)
File "././.env/lib/python3.4/site-packages/gevent/event.py", line 219, in wait
return self._wait(timeout)
File "././.env/lib/python3.4/site-packages/gevent/event.py", line 129, in _wait
gotit = self._wait_core(timeout)
File "././.env/lib/python3.4/site-packages/gevent/event.py", line 106, in _wait_core
result = self.hub.switch()
File "././.env/lib/python3.4/site-packages/gevent/hub.py", line 630, in switch
return RawGreenlet.switch(self)
gevent.hub.LoopExit: ('This operation would block forever', <Hub at 0x760c9da0 epoll default pending=0 ref=0 fileno=3>)
test: trying connect to 127.0.0.1:22222
test: sent request to server [status]
test: reading response...
('test: got server reply', {u'exception': u'python-miio: hasattr(): attribute name must be string', u'cmd': 'status'})
test: kill servery.py pid: 13107
mrinner
Posts: 56
Joined: Tuesday 22 August 2017 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belarus
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by mrinner »

Tommie wrote: Wednesday 08 November 2017 14:57 But i still cannot communicatie with the vacuum.. what i did so far:
1. Firstly disable the plugin hardware.
2. Then check python process by "ps aux|grep server.py" or via "htop" and kill it if process is running.
3. Run test.py
4. If test.py works properly - you have 2 ways:

a) enable plugin with right settings and debug mode and check logs (local server should start with plugin automatically)

b) run local server manually by "python3 server.py IP TOKEN" (as service, or in "tmux", or as background process if you want) and then just enable plugin. Plugin will start connecting to this server and you will see it in output.
Tommie
Posts: 8
Joined: Thursday 22 December 2016 23:20
Target OS: Linux
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Tommie »

Thanks for the reply!

I've killed the process and have (seem succesfull?) a reply from test.py:

Code: Select all

test: python modules path: ./.env/lib/python3.4/site-packages
test: starting server.py process
test: wait server starting... 5 seconds
server: Starting server on 127.0.0.1 22222
test: trying connect to 127.0.0.1:22222
test: sent request to server [status]
test: reading response...
server: connected ('127.0.0.1', 39888)
server: got socket msg: ['status']
Got error when receiving: timed out
Retrying with incremented id, retries left: 3
server: vac result {'fan_level': 90, 'error': None, 'cmd': 'status', 'clean_area': 0.0, 'state_code': 8, 'battery': 100, 'clean_seconds': 5}
test: got server reply {'clean_seconds': 5, 'cmd': 'status', 'battery': 100, 'state_code': 8, 'error': None, 'fan_level': 90, 'clean_area': 0.0}
test: kill servery.py pid: 1670
From logging i got messages like this (Sophie is our trustworthy vacuum):
2017-11-09 16:44:39.931 (Sophie) Calling message handler 'onHeartbeat'.
2017-11-09 16:44:39.932 (Sophie) Trying connect to MIIOServer 127.0.0.1:22222
2017-11-09 16:44:39.932 (Sophie) Transport set to: 'TCP/IP', 127.0.0.1:22222.
2017-11-09 16:44:39.932 PluginSystem: Starting I/O service thread.
2017-11-09 16:44:39.932 (Sophie) Connect directive received, action initiated successfully.
2017-11-09 16:44:39.983 (Sophie) Calling message handler 'onConnect'.
2017-11-09 16:44:39.983 (Sophie) MIIOServer connection status is [0] [Success]
2017-11-09 16:44:54.913 (Sophie) Calling message handler 'onHeartbeat'.
2017-11-09 16:44:54.914 (Sophie) Sending 19 bytes of data:
2017-11-09 16:44:54.914 (Sophie) 91 b1 63 6f 6e 73 75 6d 61 62 6c 65 5f 73 74 61 74 75 73 .. ��consumable_status
2017-11-09 16:44:54.914 (Sophie) Sending 8 bytes of data:
2017-11-09 16:44:54.914 (Sophie) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. ��status
When sending a clean commando (but the vacuum stays silent):
2017-11-09 16:46:04.346 (Sophie) Calling message handler 'onCommand'.
2017-11-09 16:46:04.347 (Sophie) onCommand called for Unit 2: Command 'Set Level', Level: 10
2017-11-09 16:46:04.347 (Sophie) Sending 7 bytes of data:
2017-11-09 16:46:04.347 (Sophie) 91 a5 73 74 61 72 74 .. .. .. .. .. .. .. .. .. .. .. .. .. ��start
2017-11-09 16:46:09.957 (Sophie) Calling message handler 'onHeartbeat'.
2017-11-09 16:46:09.957 (Sophie) Sending 8 bytes of data:
2017-11-09 16:46:09.957 (Sophie) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. ��status
Settings in hardware:

Python Path: python3
MIIOServer host:port: 127.0.0.1:22222
mrinner
Posts: 56
Joined: Tuesday 22 August 2017 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belarus
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by mrinner »

Tommie wrote: Thursday 09 November 2017 16:33 I've killed the process and have (seem succesfull?) a reply from test.py:
Test is OK.
Seems plugin system cannot run subprocess (local server) correctly. I will recommend you choose plan B for now:
run server manually and then start plugin
"python3 server.py IP TOKEN"
duki
Posts: 1
Joined: Friday 10 November 2017 21:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by duki »

mrinner wrote: Thursday 09 November 2017 19:41
Tommie wrote: Thursday 09 November 2017 16:33 I've killed the process and have (seem succesfull?) a reply from test.py:
Test is OK.
Seems plugin system cannot run subprocess (local server) correctly. I will recommend you choose plan B for now:
run server manually and then start plugin
"python3 server.py IP TOKEN"
Hi,
Thanks for this plugin !!!

Same problem than Tommie, same solution (plan B!) :-D
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Dnpwwo »

The plugin framework is single threaded so sub-processes won't work properly, this is documented on the wiki http://www.domoticz.com/wiki/Developing_a_Python_plugin:
The following things should not be attempted using the Python Framework:
  • Use of asynchronous code or libraries. This will not work the way you expect.
  • Use of call back functions. This will not work the way you expect.
  • Waiting or sleeping. Plugins are single threaded so the whole plugin system will wait.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
mrinner
Posts: 56
Joined: Tuesday 22 August 2017 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belarus
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by mrinner »

Dnpwwo wrote: Friday 10 November 2017 23:35 The plugin framework is single threaded so sub-processes won't work properly, this is documented on the wiki...
I thought "subprocess.Popen" should work correctly (start external python script in background).. but seems on some platforms issues with it.
Jacco7702
Posts: 1
Joined: Monday 13 November 2017 20:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8834
Location: Sweden
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Jacco7702 »

So for solution B how have you solved it when a restart is happening (for any reason....).?
Tried to solve it with shell script via cron but I did not fix it yet at least ...

@mrinner Thanks for all your work. Really cool to see it work in Domoticz :D Is there an update in the near future perhaps? And also a note on the github repository would be nice
markcame
Posts: 36
Joined: Wednesday 07 December 2016 19:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by markcame »

@mrinner thanks for the developing of the plugin, i've decided to upgrade to the last version today but i ran in some problems.

First as already described i have to manually run the server.py because the domoticz cannot run as subprocess.

as second it seems that now i can send command but nont recive status from the robot, the server recive all correctly but passing to plugin somethings goes wrong attached the log of domoticz.

Code: Select all

2017-11-18 17:20:39.388 (Xiaomi Robot) Calling message handler 'onHeartbeat'.
2017-11-18 17:20:39.389 (Xiaomi Robot) Sending 8 bytes of data:.
2017-11-18 17:20:39.389 (Xiaomi Robot) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. ��status
2017-11-18 17:20:39.993 (Xiaomi Robot) Received 86 bytes of data:.
2017-11-18 17:20:39.994 (Xiaomi Robot) 87 a9 66 61 6e 5f 6c 65 76 65 6c 5a a3 63 6d 64 a6 73 74 61 ��fan_levelZ�cmd�sta
2017-11-18 17:20:39.994 (Xiaomi Robot) 74 75 73 aa 73 74 61 74 65 5f 63 6f 64 65 08 a7 62 61 74 74 tus�state_code.�batt
2017-11-18 17:20:39.994 (Xiaomi Robot) 65 72 79 64 ad 63 6c 65 61 6e 5f 73 65 63 6f 6e 64 73 00 a5 eryd�clean_seconds.�
2017-11-18 17:20:39.994 (Xiaomi Robot) 65 72 72 6f 72 c0 aa 63 6c 65 61 6e 5f 61 72 65 61 cb 00 00 error��clean_area�..
2017-11-18 17:20:39.994 (Xiaomi Robot) 00 00 00 00 00 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ......
2017-11-18 17:20:39.994 (Xiaomi Robot) Calling message handler 'onMessage'.
2017-11-18 17:20:39.994 Error: (Xiaomi Robot) 'onMessage' failed 'TypeError':'onMessage() takes 2 positional arguments but 4 were given'
juanfranrg
Posts: 2
Joined: Sunday 19 November 2017 15:54
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by juanfranrg »

Hi, I have this error attached, I installed all necessary and vaccum works fine, but always I recived this message every minute, my domoticz is installed in a Rasberry Pi 3,

Thanks you!Image

Enviado desde mi MI 5s mediante Tapatalk

juanfranrg
Posts: 2
Joined: Sunday 19 November 2017 15:54
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by juanfranrg »

Solved, I changed domoticz stable to beta and works perfect without errors, thanks you for the plugin! Great work!

Enviado desde mi MI 5s mediante Tapatalk

mrinner
Posts: 56
Joined: Tuesday 22 August 2017 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belarus
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by mrinner »

Plugin updated to 0.1.2
- Now MIIO Server runs outside plugin, so you need some preparation for that change.
due issues with dz <=> python integration limits, in future releases I will add option to start server with plugin or outside because this works on some environments
- Added miio_server.sh for run miio server as service
- IP and TOKEN moved from Hardwave->Settings into miio_server.sh

Check the https://github.com/mrin/domoticz-mirobot-plugin


Plugin works on latest beta of domoticz, because python framework api has some changes which not supported by stable release 8.153
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 »

markcame wrote: Saturday 18 November 2017 17:22 @mrinner thanks for the developing of the plugin, i've decided to upgrade to the last version today but i ran in some problems.

First as already described i have to manually run the server.py because the domoticz cannot run as subprocess.

as second it seems that now i can send command but nont recive status from the robot, the server recive all correctly but passing to plugin somethings goes wrong attached the log of domoticz.

Code: Select all

2017-11-18 17:20:39.388 (Xiaomi Robot) Calling message handler 'onHeartbeat'.
2017-11-18 17:20:39.389 (Xiaomi Robot) Sending 8 bytes of data:.
2017-11-18 17:20:39.389 (Xiaomi Robot) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. ��status
2017-11-18 17:20:39.993 (Xiaomi Robot) Received 86 bytes of data:.
2017-11-18 17:20:39.994 (Xiaomi Robot) 87 a9 66 61 6e 5f 6c 65 76 65 6c 5a a3 63 6d 64 a6 73 74 61 ��fan_levelZ�cmd�sta
2017-11-18 17:20:39.994 (Xiaomi Robot) 74 75 73 aa 73 74 61 74 65 5f 63 6f 64 65 08 a7 62 61 74 74 tus�state_code.�batt
2017-11-18 17:20:39.994 (Xiaomi Robot) 65 72 79 64 ad 63 6c 65 61 6e 5f 73 65 63 6f 6e 64 73 00 a5 eryd�clean_seconds.�
2017-11-18 17:20:39.994 (Xiaomi Robot) 65 72 72 6f 72 c0 aa 63 6c 65 61 6e 5f 61 72 65 61 cb 00 00 error��clean_area�..
2017-11-18 17:20:39.994 (Xiaomi Robot) 00 00 00 00 00 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ......
2017-11-18 17:20:39.994 (Xiaomi Robot) Calling message handler 'onMessage'.
2017-11-18 17:20:39.994 Error: (Xiaomi Robot) 'onMessage' failed 'TypeError':'onMessage() takes 2 positional arguments but 4 were given'
i have the same problem. do you solved?
mrinner
Posts: 56
Joined: Tuesday 22 August 2017 20:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belarus
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by mrinner »

@DAVIZINHO
Plugin works on latest beta's.
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 »

mrinner wrote: Sunday 26 November 2017 9:39 @DAVIZINHO
Plugin works on latest beta's.
I have the Last beta and this error :-(
toutazimuth
Posts: 16
Joined: Tuesday 29 September 2015 19:20
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by toutazimuth »

@mrinner
All is fine for me also with Pi3 and V3 8747 :)
and I am completely beginner :mrgreen:
You are one of the best
it's a perfect program for me !

Thx a lot
mi.PNG
mi.PNG (102.41 KiB) Viewed 4071 times
mi02.PNG
mi02.PNG (99.99 KiB) Viewed 4071 times

Code: Select all

2017-11-26 12:28:39.946 Build Hash: c1c42b4b, Date: 2017-11-26 07:53:56
2017-11-26 12:28:39.946 Startup Path: /home/pi/domoticz/
2017-11-26 12:28:39.999 EventSystem: reset all events...
2017-11-26 12:28:40.156 PluginSystem: Started, Python version '3.5.3'.
2017-11-26 12:28:40.166 WebServer(HTTP) started on address: :: with port 8080
2017-11-26 12:28:40.171 WebServer(SSL) started on address: :: with port 443
2017-11-26 12:28:40.173 Proxymanager started.
2017-11-26 12:28:40.175 TCPServer: shared server started...
2017-11-26 12:28:40.175 RxQueue: queue worker started...
2017-11-26 12:28:40.226 Incoming connection from: 192.168.1.68
2017-11-26 12:28:42.175 Hardware Monitor: Started
2017-11-26 12:28:42.228 Wunderground: Worker started...
2017-11-26 12:28:42.228 (Petit Robot) Started.
2017-11-26 12:28:42.229 EventSystem: reset all events...
2017-11-26 12:28:42.230 EventSystem: reset all device statuses...
2017-11-26 12:28:42.385 Python EventSystem: Initalizing event module.
2017-11-26 12:28:42.385 EventSystem: Started
2017-11-26 12:28:42.385 EventSystem: Queue thread started...
2017-11-26 12:28:42.500 PluginSystem: Entering work loop.
2017-11-26 12:28:42.679 (Petit Robot) Entering work loop.
2017-11-26 12:28:42.679 (Petit Robot) Initialized version 0.1.2, author 'mrin'

Code: Select all

2017-11-26 12:38:07.477 (Petit Robot) Received 88 bytes of data:
2017-11-26 12:38:07.477 (Petit Robot) 87 a7 62 61 74 74 65 72 79 64 a3 63 6d 64 a6 73 74 61 74 75 ��batteryd�cmd�statu
2017-11-26 12:38:07.477 (Petit Robot) 73 aa 63 6c 65 61 6e 5f 61 72 65 61 cb 40 41 d8 51 eb 85 1e s�clean_area�@A�Q�.
2017-11-26 12:38:07.477 (Petit Robot) b8 ad 63 6c 65 61 6e 5f 73 65 63 6f 6e 64 73 cd 09 41 aa 73 ��clean_seconds�.A�s
2017-11-26 12:38:07.477 (Petit Robot) 74 61 74 65 5f 63 6f 64 65 08 a5 65 72 72 6f 72 c0 a9 66 61 tate_code.�error��fa
2017-11-26 12:38:07.477 (Petit Robot) 6e 5f 6c 65 76 65 6c 4d .. .. .. .. .. .. .. .. .. .. .. .. n_levelM
2017-11-26 12:38:07.477 (Petit Robot) Calling message handler 'onMessage'.
2017-11-26 12:38:07.478 (Petit Robot) Got: {'cmd': 'status', 'state_code': 8, 'error': None, 'clean_seconds': 2369, 'fan_level': 77, 'battery': 100, 'clean_area': 35.69}
2017-11-26 12:38:22.305 (Petit Robot) Calling message handler 'onHeartbeat'.
2017-11-26 12:38:22.306 (Petit Robot) Sending 8 bytes of data:
2017-11-26 12:38:22.306 (Petit Robot) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. ��status
2017-11-26 12:38:22.509 (Petit Robot) Received 88 bytes of data:
2017-11-26 12:38:22.509 (Petit Robot) 87 a7 62 61 74 74 65 72 79 64 a3 63 6d 64 a6 73 74 61 74 75 ��batteryd�cmd�statu
2017-11-26 12:38:22.509 (Petit Robot) 73 aa 63 6c 65 61 6e 5f 61 72 65 61 cb 40 41 d8 51 eb 85 1e s�clean_area�@A�Q�.
2017-11-26 12:38:22.509 (Petit Robot) b8 ad 63 6c 65 61 6e 5f 73 65 63 6f 6e 64 73 cd 09 41 aa 73 ��clean_seconds�.A�s
2017-11-26 12:38:22.509 (Petit Robot) 74 61 74 65 5f 63 6f 64 65 08 a5 65 72 72 6f 72 c0 a9 66 61 tate_code.�error��fa
2017-11-26 12:38:22.509 (Petit Robot) 6e 5f 6c 65 76 65 6c 4d .. .. .. .. .. .. .. .. .. .. .. .. n_levelM
2017-11-26 12:38:22.509 (Petit Robot) Calling message handler 'onMessage'.
2017-11-26 12:38:22.509 (Petit Robot) Got: {'cmd': 'status', 'state_code': 8, 'error': None, 'clean_seconds': 2369, 'fan_level': 77, 'battery': 100, 'clean_area': 35.69}
2017-11-26 12:38:37.338 (Petit Robot) Calling message handler 'onHeartbeat'.
2017-11-26 12:38:37.339 (Petit Robot) Sending 8 bytes of data:
2017-11-26 12:38:37.339 (Petit Robot) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. ��status
2017-11-26 12:38:37.542 (Petit Robot) Received 88 bytes of data:
2017-11-26 12:38:37.542 (Petit Robot) 87 a7 62 61 74 74 65 72 79 64 a3 63 6d 64 a6 73 74 61 74 75 ��batteryd�cmd�statu
2017-11-26 12:38:37.542 (Petit Robot) 73 aa 63 6c 65 61 6e 5f 61 72 65 61 cb 40 41 d8 51 eb 85 1e s�clean_area�@A�Q�.
2017-11-26 12:38:37.542 (Petit Robot) b8 ad 63 6c 65 61 6e 5f 73 65 63 6f 6e 64 73 cd 09 41 aa 73 ��clean_seconds�.A�s
2017-11-26 12:38:37.542 (Petit Robot) 74 61 74 65 5f 63 6f 64 65 08 a5 65 72 72 6f 72 c0 a9 66 61 tate_code.�error��fa
2017-11-26 12:38:37.542 (Petit Robot) 6e 5f 6c 65 76 65 6c 4d .. .. .. .. .. .. .. .. .. .. .. .. n_levelM
2017-11-26 12:38:37.543 (Petit Robot) Calling message handler 'onMessage'.
2017-11-26 12:38:37.543 (Petit Robot) Got: {'cmd': 'status', 'state_code': 8, 'error': None, 'clean_seconds': 2369, 'fan_level': 77, 'battery': 100, 'clean_area': 35.69}
2017-11-26 12:38:52.321 (Petit Robot) Calling message handler 'onHeartbeat'.
2017-11-26 12:38:52.321 (Petit Robot) Sending 8 bytes of data:
mi02.PNG
mi02.PNG (99.99 KiB) Viewed 4071 times
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 »

toutazimuth wrote: Sunday 26 November 2017 12:43 @mrinner
All is fine for me also with Pi3 and V3 8747 :)
and I am completely beginner :mrgreen:
You are one of the best
it's a perfect program for me !

Thx a lot

Code: Select all

2017-11-26 12:38:07.477 (Petit Robot) Received 88 bytes of data:
2017-11-26 12:38:07.477 (Petit Robot) 87 a7 62 61 74 74 65 72 79 64 a3 63 6d 64 a6 73 74 61 74 75 ��batteryd�cmd�statu
2017-11-26 12:38:07.477 (Petit Robot) 73 aa 63 6c 65 61 6e 5f 61 72 65 61 cb 40 41 d8 51 eb 85 1e s�clean_area�@A�Q�.
2017-11-26 12:38:07.477 (Petit Robot) b8 ad 63 6c 65 61 6e 5f 73 65 63 6f 6e 64 73 cd 09 41 aa 73 ��clean_seconds�.A�s
2017-11-26 12:38:07.477 (Petit Robot) 74 61 74 65 5f 63 6f 64 65 08 a5 65 72 72 6f 72 c0 a9 66 61 tate_code.�error��fa
2017-11-26 12:38:07.477 (Petit Robot) 6e 5f 6c 65 76 65 6c 4d .. .. .. .. .. .. .. .. .. .. .. .. n_levelM
2017-11-26 12:38:07.477 (Petit Robot) Calling message handler 'onMessage'.
2017-11-26 12:38:07.478 (Petit Robot) Got: {'cmd': 'status', 'state_code': 8, 'error': None, 'clean_seconds': 2369, 'fan_level': 77, 'battery': 100, 'clean_area': 35.69}
2017-11-26 12:38:22.305 (Petit Robot) Calling message handler 'onHeartbeat'.
2017-11-26 12:38:22.306 (Petit Robot) Sending 8 bytes of data:
2017-11-26 12:38:22.306 (Petit Robot) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. ��status
2017-11-26 12:38:22.509 (Petit Robot) Received 88 bytes of data:
2017-11-26 12:38:22.509 (Petit Robot) 87 a7 62 61 74 74 65 72 79 64 a3 63 6d 64 a6 73 74 61 74 75 ��batteryd�cmd�statu
2017-11-26 12:38:22.509 (Petit Robot) 73 aa 63 6c 65 61 6e 5f 61 72 65 61 cb 40 41 d8 51 eb 85 1e s�clean_area�@A�Q�.
2017-11-26 12:38:22.509 (Petit Robot) b8 ad 63 6c 65 61 6e 5f 73 65 63 6f 6e 64 73 cd 09 41 aa 73 ��clean_seconds�.A�s
2017-11-26 12:38:22.509 (Petit Robot) 74 61 74 65 5f 63 6f 64 65 08 a5 65 72 72 6f 72 c0 a9 66 61 tate_code.�error��fa
2017-11-26 12:38:22.509 (Petit Robot) 6e 5f 6c 65 76 65 6c 4d .. .. .. .. .. .. .. .. .. .. .. .. n_levelM
2017-11-26 12:38:22.509 (Petit Robot) Calling message handler 'onMessage'.
2017-11-26 12:38:22.509 (Petit Robot) Got: {'cmd': 'status', 'state_code': 8, 'error': None, 'clean_seconds': 2369, 'fan_level': 77, 'battery': 100, 'clean_area': 35.69}
2017-11-26 12:38:37.338 (Petit Robot) Calling message handler 'onHeartbeat'.
2017-11-26 12:38:37.339 (Petit Robot) Sending 8 bytes of data:
2017-11-26 12:38:37.339 (Petit Robot) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. ��status
2017-11-26 12:38:37.542 (Petit Robot) Received 88 bytes of data:
2017-11-26 12:38:37.542 (Petit Robot) 87 a7 62 61 74 74 65 72 79 64 a3 63 6d 64 a6 73 74 61 74 75 ��batteryd�cmd�statu
2017-11-26 12:38:37.542 (Petit Robot) 73 aa 63 6c 65 61 6e 5f 61 72 65 61 cb 40 41 d8 51 eb 85 1e s�clean_area�@A�Q�.
2017-11-26 12:38:37.542 (Petit Robot) b8 ad 63 6c 65 61 6e 5f 73 65 63 6f 6e 64 73 cd 09 41 aa 73 ��clean_seconds�.A�s
2017-11-26 12:38:37.542 (Petit Robot) 74 61 74 65 5f 63 6f 64 65 08 a5 65 72 72 6f 72 c0 a9 66 61 tate_code.�error��fa
2017-11-26 12:38:37.542 (Petit Robot) 6e 5f 6c 65 76 65 6c 4d .. .. .. .. .. .. .. .. .. .. .. .. n_levelM
2017-11-26 12:38:37.543 (Petit Robot) Calling message handler 'onMessage'.
2017-11-26 12:38:37.543 (Petit Robot) Got: {'cmd': 'status', 'state_code': 8, 'error': None, 'clean_seconds': 2369, 'fan_level': 77, 'battery': 100, 'clean_area': 35.69}
2017-11-26 12:38:52.321 (Petit Robot) Calling message handler 'onHeartbeat'.
2017-11-26 12:38:52.321 (Petit Robot) Sending 8 bytes of data:
mi02.PNG
hello!.
For me works fine but i received the log like you with "error". do you solved this error that apears in log??

i have the last beta too ( Pi3 and V3.8747)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest