Python plugin: Xiaomi Mi Robot Vacuum Topic is solved
Moderator: leecollings
-
- Posts: 2
- Joined: Wednesday 11 October 2017 12:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Xiaomi Mi Robot Vacuum
Did you place the plugin in the correct folder? If you did it should appear under hardware in Domoticz.
The folder should be; /home/pi/domoticz/plugins/.
https://www.domoticz.com/wiki/Using_Python_plugins
The folder should be; /home/pi/domoticz/plugins/.
https://www.domoticz.com/wiki/Using_Python_plugins
-
- Posts: 24
- Joined: Tuesday 13 September 2016 19:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Xiaomi Mi Robot Vacuum
I think this is the same issue as mentioned in this topic:
http://www.domoticz.com/forum/viewtopic ... 65&t=21379
Btw I have one question,
is this plugin working for Xiaomi Robot Gen 2?
http://www.domoticz.com/forum/viewtopic ... 65&t=21379
Btw I have one question,
is this plugin working for Xiaomi Robot Gen 2?
RPi 3
Domoticz Béta
RFLink Gateway dipool antenna
Many kaku devices
P1 smart meter
Custom made ESP8266 devices
Hue lights / Milight ligts and strips
Domoticz Béta
RFLink Gateway dipool antenna
Many kaku devices
P1 smart meter
Custom made ESP8266 devices
Hue lights / Milight ligts and strips
-
- Posts: 101
- Joined: Tuesday 07 April 2015 21:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Xiaomi Mi Robot Vacuum
I just noticed that the utility sensors generated by the plugin are no longer updated with V3.8833.
I went back to V3.8825 and it is working again!
Ahy idea?
I went back to V3.8825 and it is working again!
Ahy idea?
-
- 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
I hipe you guys can help me out.
I cannot finish the installation of this plugin.
i have problems with these 2, and cannot continu..
Its says:
i have tried everything regarding to get other packages installed (setuptools, of vritualenv), but is still not found..
i'm running Rpi2, started with default image.
I cannot finish the installation of this plugin.
i have problems with these 2, and cannot continu..
Code: Select all
sudo pip3 install -U setuptools
sudo pip3 install -U virtualenv
Code: Select all
sudo: pip3: command not found
i'm running Rpi2, started with default image.
-
- Posts: 101
- Joined: Tuesday 07 April 2015 21:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Xiaomi Mi Robot Vacuum
Try: „apt-get install python3-pip“
or
apt-get install python3.5-pip“
Gesendet von iPhone mit Tapatalk
or
apt-get install python3.5-pip“
Gesendet von iPhone mit Tapatalk
-
- 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
I tried that also.
Python3-pip is installed.
Python3.5-pip says:
Code: Select all
E: Unable to locate package python3.5-pip
E: Couldn't find any package by regex 'python3.5-pip'
edit:
i'm required to install the miio to. That is also not working.
Does not work:
Code: Select all
pip3 install python-miio
Code: Select all
pip install virtualenv
Last edited by RichardBokker on Monday 22 January 2018 19:47, edited 1 time in total.
-
- Posts: 101
- Joined: Tuesday 07 April 2015 21:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Xiaomi Mi Robot Vacuum
What's the output of:
"apt list --installed |fgrep -i python" ?
"apt list --installed |fgrep -i python" ?
-
- 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
-
- Posts: 101
- Joined: Tuesday 07 April 2015 21:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Xiaomi Mi Robot Vacuum
Strange! No idea...
-
- Posts: 101
- Joined: Tuesday 07 April 2015 21:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Xiaomi Mi Robot Vacuum
Hmmm?
Missing search path?
What about "/usr/bin/apt list --installed |fgrep -i python"
Missing search path?
What about "/usr/bin/apt list --installed |fgrep -i python"
-
- 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
unfortunally, that is not working too.
-
- 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
@RichardBokker
did you installed python3-pip with sudo? "sudo apt-get install python3-pip"
If yes, pip3 cmd should be available 100%
Then,
cd xiaomi-mirobot # plugin folder
virtualenv -p python3 .env # creating environment for python libs
source .env/bin/activate # activating environment, only after this step you need to install other relations:
pip3 install gevent msgpack-python python-miio==0.3.1
I'm on 3.8805 and all works. I'll try to update to the latest beta on dev machine next week.
Also seems dz have many issues with python subsytem on the latest beta...
did you installed python3-pip with sudo? "sudo apt-get install python3-pip"
If yes, pip3 cmd should be available 100%
Then,
cd xiaomi-mirobot # plugin folder
virtualenv -p python3 .env # creating environment for python libs
source .env/bin/activate # activating environment, only after this step you need to install other relations:
pip3 install gevent msgpack-python python-miio==0.3.1
I'm on 3.8805 and all works. I'll try to update to the latest beta on dev machine next week.
Also seems dz have many issues with python subsytem on the latest beta...
-
- 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
hello,
i want to make a dzvents that send me a notification for change main brush
i make this dzvents and not works
local cepillo = domoticz.devices('Vacuum - Care Main Brush')
if (cepillo.sensorType < 10) then
cepillo_var.set(1)
domoticz.notify('AVISO','VACUUM CHANGE MAIN BRUSH', '', domoticz.PRIORITY_LOW)
end
I thint the .sensorType is not the correct parameter. can someone tell me the correct?
i want to make a dzvents that send me a notification for change main brush
i make this dzvents and not works
local cepillo = domoticz.devices('Vacuum - Care Main Brush')
if (cepillo.sensorType < 10) then
cepillo_var.set(1)
domoticz.notify('AVISO','VACUUM CHANGE MAIN BRUSH', '', domoticz.PRIORITY_LOW)
end
I thint the .sensorType is not the correct parameter. can someone tell me the correct?
-
- 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
Sorry, i read this just now.mrinner wrote: ↑Friday 26 January 2018 21:52 @RichardBokker
did you installed python3-pip with sudo? "sudo apt-get install python3-pip"
If yes, pip3 cmd should be available 100%
Then,
cd xiaomi-mirobot # plugin folder
virtualenv -p python3 .env # creating environment for python libs
source .env/bin/activate # activating environment, only after this step you need to install other relations:
pip3 install gevent msgpack-python python-miio==0.3.1
I'm on 3.8805 and all works. I'll try to update to the latest beta on dev machine next week.
Also seems dz have many issues with python subsytem on the latest beta...
I think my installation was corrupt. I made a new installation on a new Pi, and everything works perfect now.
-
- 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
What command's do i use to control the robot?
I want to make script with LUA.
i think i should use:
But what entries? Home , Cleaning or On are not working.
Anysone some ideas?
I did managed to readout the status with:
I want to make script with LUA.
i think i should use:
Code: Select all
otherdevices['Robot - Control'] = "".
Anysone some ideas?
I did managed to readout the status with:
Code: Select all
if otherdevices['Robot - Status'] == "Cleaning" then
-
- 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
Someone, please?RichardBokker wrote: ↑Friday 09 February 2018 17:04 What command's do i use to control the robot?
I want to make script with LUA.
i think i should use:But what entries? Home , Cleaning or On are not working.Code: Select all
commandarray['Robot - Control'] = "".
Anysone some ideas?
I did managed to readout the status with:Code: Select all
if otherdevices['Robot - Status'] == "Cleaning" then
edit:
found, it is: commandArray['Robot - Control''] = 'Set Level 10' (or 20, 30, 40, 50, 60)
Re: Python plugin: Xiaomi Mi Robot Vacuum
The code you pasted for your IF statement seems to only check if its either On or OFF. But not if its Cleaning, Paused, Sleeping, In Error, Charging, Back to home, etc.RichardBokker wrote: ↑Monday 12 February 2018 11:52Someone, please?RichardBokker wrote: ↑Friday 09 February 2018 17:04 What command's do i use to control the robot?
I want to make script with LUA.
i think i should use:But what entries? Home , Cleaning or On are not working.Code: Select all
commandarray['Robot - Control'] = "".
Anysone some ideas?
I did managed to readout the status with:Code: Select all
if otherdevices['Robot - Status'] == "Cleaning" then
edit:
found, it is: commandArray['Robot - Control''] = 'Set Level 10' (or 20, 30, 40, 50, 60)
After your tip on controlling the robot, I think I might have found the fix to override the Xiaomi Mi Robot Main Brush Blocked fault error and have it continue cleaning.
Here's the Lua script:
Code: Select all
commandArray = {}
if otherdevices_svalues['Robot - Status'] == "In Error" then
print ("Resuming the Cleanup")
commandArray['Robot - Control'] = 'Set Level 10'
else
print(otherdevices_svalues['Robot - Status'])
end
return commandArray
-
- 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
I got the script working, but had to convert the Robot - state with tostring().
Here is my case-construction that i'm using.
Here is my case-construction that i'm using.
Code: Select all
-- Using TimeBetween script in main LUA script folder
package.path = package.path .. ';' .. '/home/pi/domoticz/scripts/lua/script_time_TimeBetween.lua'
local TimeBetween = require('timebetween')
time = os.date("*t")
commandArray = {}
-- Possible state's of Robot Vacuum: Charging / Paused / Cleaning / Waiting / Back to home / Sleeping
-- Selector witch Robot Vacuum: Clean(10) / Home(20) / Spot(30) / Pauze(40) / Stop(50) / Find(60)
---- Variabele to use
-- StoffieState (uservariable)
-- AtHome (uservariable)
-- Stoffie - Control (device)
-- Stoffie - Status (device)
local stoffie = 'Stoffie - Status'
-- print(otherdevices_svalues[stoffie] .. " dit is de actuele status")
-- Required to convert State to Stringvalue
StoffieStatus = tostring(otherdevices_svalues[stoffie]);
-- IDLE
if (uservariables['StoffieState'] == 'IDLE') then
print ("Stoffie is idle");
if timebetween("08:00","16:00") then -- Run's only during day hours.
if (uservariables['AtHome'] == 'NO') then -- Run's only when nobody is at home
commandArray['SendNotification']='Stoffie is Starting'
commandArray['Variable:StoffieState']='STARTING'
-- Start Robot command, command send once.
commandArray['Stoffie - Control'] = 'Set Level 10'
end
end
end
-- STARTING
if (uservariables['StoffieState'] == 'STARTING') then
if StoffieStatus == 'Cleaning' then -- If robot is cleaning, continu to next step
commandArray['SendNotification']='Stoffie is Running'
commandArray['Variable:StoffieState']='RUNNING'
end
if timebetween("16:00","08:00") then -- is program hangs, to executed state
commandArray['Variable:StoffieState']='EXECUTED'
end
end
-- RUNNING
if (uservariables['StoffieState'] == 'RUNNING') then
if StoffieStatus == 'Back to home' then -- If robot is going back to home, continu to next step
commandArray['SendNotification']='Stoffie is Stopping'
commandArray['Variable:StoffieState']='STOPPING'
end
end
-- STOPPING
if (uservariables['StoffieState'] == 'STOPPING') then
if StoffieStatus == 'Charging' then -- if robot is Charging, continu to next step
commandArray['SendNotification']='Stoffie is Executed'
commandArray['Variable:StoffieState']='EXECUTED'
-- Stop Robot command, command send once.
commandArray['Stoffie - Control'] = 'Set Level 50'
end
end
-- EXECUTED
if (uservariables['StoffieState'] == 'EXECUTED') then
if timebetween("23:55","23:56") then -- Runs only once a day. Reset at end of day.
commandArray['SendNotification']='Stoffie going to Idle'
commandArray['Variable:StoffieState']='IDLE'
end
end
return commandArray
-
- Posts: 6
- Joined: Thursday 22 February 2018 21:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8934
- Contact:
Re: Python plugin: Xiaomi Mi Robot Vacuum
EDIT:
I solved it!
The server had apparently crashed when I tried to start it erlier today, so when I ran my server tests now. It started for a moment to update the vaccums information.
When I tried to start the server the "right way" via: sudo service miio_server start and sudo chmod +x test.py, it all started working.
Puh!
(Original post below)
Hi!
I have installed the plugin, and got the hardware setup. But, my devices are all out of sync and does not really do anything.
Where should I begin my trouble shooting?
I have checked the robots ip and token-settings, they are correct.
EDIT:
I just noticed that the parameters of the switches updates when I run sudo ./miio_server.py 192.168.1.233 476e6b70343055483230644c53707a12 --host 127.0.0.1 --port 22222
The server, however starts on port 59238 and is giving correct data from the vaccum. The port it starts on seems do differ between the server starts.
What is causing this, and what should I do to remain a stable connection.
When the switches updates in the Domoticz interface, I am still unable to send any commands to the vaccum via the switches.
Thank you!
I solved it!
The server had apparently crashed when I tried to start it erlier today, so when I ran my server tests now. It started for a moment to update the vaccums information.
When I tried to start the server the "right way" via: sudo service miio_server start and sudo chmod +x test.py, it all started working.
Puh!
(Original post below)
Hi!
I have installed the plugin, and got the hardware setup. But, my devices are all out of sync and does not really do anything.
Where should I begin my trouble shooting?
I have checked the robots ip and token-settings, they are correct.
EDIT:
I just noticed that the parameters of the switches updates when I run sudo ./miio_server.py 192.168.1.233 476e6b70343055483230644c53707a12 --host 127.0.0.1 --port 22222
The server, however starts on port 59238 and is giving correct data from the vaccum. The port it starts on seems do differ between the server starts.
What is causing this, and what should I do to remain a stable connection.
When the switches updates in the Domoticz interface, I am still unable to send any commands to the vaccum via the switches.
Thank you!
- Attachments
-
- Mirobot-Forum-2.JPG (48.07 KiB) Viewed 4657 times
-
- Mirobot-Forum.JPG (41.28 KiB) Viewed 4657 times
Who is online
Users browsing this forum: Google [Bot] and 1 guest