Xiaomi Robot Vacuum Binding

Tags: #<Tag:0x00007f1830ab9f10> #<Tag:0x00007f1830ab9d58> #<Tag:0x00007f1830ab9c18>

(Carsten) #241

Did you see the screenshot? my item file is named xiaomi_vacuum.items… My items are named with the right channel and no item seems to work… i reinstall binding and things…thing is online… but i am not sure what is about this error in the bottom :frowning:

(marcel) #242

Can it be your OH version is 2.1, or early 2.2 version. For those there was a bug wrt to the firmware functionality which gave a 404 error. I wouldn’t know. You may want to restart OH, as it does not always handle item changes very well.

If you don’t have updates, please check the debug log of the binding (see how to enable in the very first post)
that may give some hints to what is going on

(marcel) #243

@shorty707 you are checking your setup while attending the conference… :+1::grin:

(Shorty707) #244

:wink: I live only 20 min from where it was :wink:
already back home

(Carsten) #245

yes, i got 2.1 on OpenhabianPI…

If i enable this line the sitemap is not working anymore and everything :frowning:

Switch actionVacuum 	"Staubsauger" 			(gVac)  	{channel="miio:vacuum:03D88748:actions#vacuum" } [ "Switchable" ]
Group item=gVac {
		Switch item=actionControl mappings=[vacuum="Vacuum", pause="Pause",spot="Spot", dock="Dock"]
 		Switch item=actionFan mappings=[38="Silent", 60="Normal", 77="Power",90="Full", -1="Custom"]
 		Switch item=actionVacuum
		Default item=statusBat 
		Default item=statusArea 
		Default item=statusTime 
		Group  item=gVacStat
		Group  item=gVacCons
		Group  item=gVacDND
		Group  item=gVacHist
		Group  item=gVacNetwork

(marcel) #246

what if you remove the [ "Switchable" ] part. Does that make a difference. Why do you have that?

(Carsten) #247

Yes, then the item is working :see_no_evil:
BUT…i need this item for the openhab simulation for Alexa or Google Home…

(marcel) #248

I have not used it, but as far as I know you need to add that to your item file instead of to the sitemap

(Carsten) #249

yes yes, i only have the “Switch item=actionVacuum” in my sitemap in my item file is this line…

Switch actionVacuum 	"Staubsauger" 			(gVac)  	{channel="miio:vacuum:03D88748:actions#vacuum" } [ "Switchable" ]

(Shorty707) #250

when you put the switchable part BEFoRE the channel part.
does this change something?

(Mihai Badea) #251

I see that this channel type is a String
How to use it? What string to send?

(Bofh90) #252

Thank you :slight_smile:

(marcel) #253

In paperUI you will see the options in the dropdown
If you want to define it in the basic/classic UI use the values as below

<option value="main_brush_work_time">Reset Mainbrush</option>
 <option value="side_brush_work_time">Reset Sidebrush</option>
 <option value="filter_work_time">Reset Filter</option>
 <option value="sensor_dirty_time">Reset Sensors</option>

( ) #254

As @shorty707 already said: http://docs.openhab.org/configuration/items.html#syntax

All parts must be given in the order shown

(Carsten) #255

yes, sorry my bad :see_no_evil:

(Andreas B ) #256

The MiToolkit seems to have a problem with the latest Java Update - Version 151.

************** Ausnahmetext **************
System.IO.FileNotFoundException: Die Datei "C:\Program Files (x86)\Java\jre1.8.0_151\lib\security\local_policy.jar" konnte nicht gefunden werden.
Dateiname: "C:\Program Files (x86)\Java\jre1.8.0_151\lib\security\local_policy.jar"
   bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   bei System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   bei System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   bei MiToolkit.modFunctions.MD5FileHash(String sFile)
   bei MiToolkit.Start.cmdCheckConnection_Click(Object sender, EventArgs e)
   bei System.Windows.Forms.Control.OnClick(EventArgs e)
   bei System.Windows.Forms.Button.OnClick(EventArgs e)
   bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
   bei System.Windows.Forms.Button.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Geladene Assemblys **************
    Win32-Version: 4.7.2115.0 built by: NET47REL1LAST.
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll.
    CodeBase: file:///C:/Desktop/Smart%20Home/MiToolkit%201.4/MiToolkit.exe.
    Win32-Version: 14.7.2046.0 built by: NET47REL1.
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll.
    Win32-Version: 4.7.2110.0 built by: NET47REL1LAST.
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll.
    Win32-Version: 4.7.2116.0 built by: NET47REL1LAST.
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll.
    Win32-Version: 4.7.2110.0 built by: NET47REL1LAST.
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
    Win32-Version: 4.7.2046.0 built by: NET47REL1.
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
    Win32-Version: 4.7.2046.0 built by: NET47REL1.
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll.
    Win32-Version: 4.7.2102.0 built by: NET47REL1LAST.
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll.
    Win32-Version: 4.7.2114.0 built by: NET47REL1LAST.
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll.
    Win32-Version: 4.7.2046.0 built by: NET47REL1.
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_de_b77a5c561934e089/mscorlib.resources.dll.
    Win32-Version: 4.7.2046.0 built by: NET47REL1.
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.

Here is the archive for older versions: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html . 144 was working - at least I think so.

Edit: You need to login to download… wtf…

Edit 2: Found an old java-version in my download-folder :smiley: (Update 111), it is working with it, but I do not get my newly connected socket; the backup-data seems to be old.

Edit 3: Downloaded the latest release of the Kit and it is working now.

(trant) #257

What action commands are possible for the binding to control the vacuum? Is it possible to control it like the joystick app?

(marcel) #258

Indeed those kind of commands are possible.
For list of all command look here

(Peter Mueller) #259

I just want to thank Marcel for his nice binding. Yesterday, the cleaner arrived. Mi home app and binding installation worked like a charm. Just got a message on my smartphone “Finished cleaning”. Great!

(Doug Culnane) #260

I am struggling with setting this up. I can not get the Token via the MiToolkit because my backup is encoded (I do not know how to change this). I managed to get a Device ID and Token using the method described here: https://www.npmjs.com/package/homebridge-xiaomi-mi-robot-vacuum
(This works well if you have disabled the firewall on your computer…)

The openhab Binding autoFinds the Vaccum but the Device ID is not that same as the output from “miio --discover --sync” I can replace the FFFFF… token from with the discovered one and and can change the Device ID. I have tried various combinations of Device ID and Token but so far failed to get any items to get values from the vacuum device. Do I need to define the items in an item file or are the PaperUI created items enough? Should I use the auto discovered binding Device ID. Is the “miio --discover --sync” device ID wrong…?

Looking at the Binding Java Code I guess I should be able to telnet to port 54321 however I can not. Is this a problem? How does the communication work? Any tips welcome.

Thanks for your help and work on this.