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 »

@DAVIZINHO
Try delete __pycache__ in plugin folder and stop/start domoticz... Really seems like something cached.. in latest dz plugin system sends 2 parameters instead 4 as was before.
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 17:34 @DAVIZINHO
Try delete __pycache__ in plugin folder and stop/start domoticz... Really seems like something cached.. in latest dz plugin system sends 2 parameters instead 4 as was before.
thanks for the advice. done and not works.
I delete de folder with "sudo rm -Rf __pycache__" then stop/start and the problem persist :-(
kurairaito
Posts: 1
Joined: Monday 27 November 2017 19:11
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by kurairaito »

Hi,

Does this script/plugin works for the second generation (international version) or only with the first gen ?

Thanks
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 »

@kurairaito
I don't have 2nd, but someone said that python-miio lib works with 2nd version, so should be ok if so..
Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Quax1507 »

I can confirm, Domoticz V 8747 is still crashing

Code: Select all

2017-11-28 06:53:31.255  (Mi Robot EG) Sending 8 bytes of data:
2017-11-28 06:53:31.255  (Mi Robot EG)     91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. ..     <91>¦status
2017-11-28 06:53:31.257  Error:   /home/pi/domoticz/domoticz() [0x2336f0]
2017-11-28 06:53:31.257  Error:   /home/pi/domoticz/domoticz(_Z14signal_handleri+0x4c) [0x2337a8]
2017-11-28 06:53:31.257  Error:   /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer+0) [0x76c616b0]
Anyone an idea?

Quaxx
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 »

napo7
Posts: 20
Joined: Monday 06 February 2017 8:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by napo7 »

It seems that every python plugin are crashing on beta version on domoticz.
I had to go back to stable, because beta has memory leaks, and python does crash.

Now you are running server outside domoticz, could you backport this to stable ?
I think it should work...

EDIT : It seems I speak a bit too quickly.
I tried the last version of plugin on stable version of domoticz.
I had to download msgpack and put it into xiaomi-robot folder. This allowed me to run the plugin correctly.
Then I ran into "onMessage takes 2 arguments..." error, so I corrected the 3 lines containing this def with the same signature than the old version of the plugin... I had one successfull update of my xiaomi devices, but then I got "Error: Domoticz received fatal signal 11" at each startup....

So, even with stable version of domoticz, I'm still having crashes.
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 »

@napo7
Try updated version 0.1.3 of plugin (with fixes for 3.8153).
Tested only on dev env with Ubuntu for 3.8153 and 3.8755.
Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Quax1507 »

OK, just updated to 0.1.3 (on Domoticz 3.8755)

Will let You know if it fixes the issue...

Edit: running for about 5 hours now without issues. Keeping fingers crossed! 8-)
Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Quax1507 »

Still crashing (after about 12 hours) :(
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 »

@Quax1507

0.1.3 just have fix for support 3.8153.
I also have crashes of domoticz on the last beta (RPI3) with any plugin. Only on my dev env (ubuntu 16.04) with last beta works ok.
Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Quax1507 »

@mrinner

So ist's a problem with the python3 libs on Stretch?
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 »

@Quax1507
I think something with integration C and Python in Domoticz.
matteos1
Posts: 36
Joined: Monday 08 May 2017 17:29
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by matteos1 »

how is it possible to retriew the TOKEN for robot?
Quax1507
Posts: 101
Joined: Tuesday 07 April 2015 21:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Quax1507 »

User avatar
BullHead
Posts: 11
Joined: Sunday 05 June 2016 16:56
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8771
Location: Oxelösund/Sweden
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by BullHead »

Hello!
When i try to runt test script during installation i get this message:

Code: Select all

pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ sudo ./test.py
test: python modules path: ././.env/lib/python3.5/site-packages
test: trying connect to 127.0.0.1:22222
test: sent request to server [status]
test: reading response...
test: got server reply {'cmd': 'status', 'exception': 'python-miio: Unable to discover the device 192.168.1.16'}
Is there a simple solution for this?
And yes, the robot has been set to a static ip number in the router.
And yes, MiHome app is able to talk to the robot on 192.168.1.16 ip number.

EDIT:
Got it to work now.
Solution = Reboot router :lol:
Best regards
Jonas
Noka
Posts: 14
Joined: Thursday 14 December 2017 8:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Noka »

Hi,

Firstly thanks for your work :) hope it will work for me too.

I follow all your steps, the test say everything goes fine. But when I go to domoticz I don't have any Xiaomi vacuum robot available. Don't know why...

Do you have any recommandation?

Thanks in advance
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 »

@Noka

Did you add hardware with name 'Xiaomi Mi Robot Vacuum' in domoticz? If you did it - check the devices menu, all devices should be created anyway, with test or without. If test goed fine the plugin would works fine:)
Noka
Posts: 14
Joined: Thursday 14 December 2017 8:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by Noka »

mrinner wrote: Friday 15 December 2017 7:39 @Noka

Did you add hardware with name 'Xiaomi Mi Robot Vacuum' in domoticz? If you did it - check the devices menu, all devices should be created anyway, with test or without. If test goed fine the plugin would works fine:)
When I want to add hardware I don't have the vacuum on the list. So I can't add it in domoticz :/ ! Am wrong ?
napo7
Posts: 20
Joined: Monday 06 February 2017 8:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Xiaomi Mi Robot Vacuum

Post by napo7 »

Can you show us the listing of the "plugins" directory inside your domoticz installation ?

In this folder, you should have a "xiaomi-robot" folder or so. Can you also show us the content of this folder ?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest