Xiaomi Robot Vacuum Binding

binding
vacuum
xiaomi
Tags: #<Tag:0x00007fd3138ca490> #<Tag:0x00007fd3138ca350> #<Tag:0x00007fd3138ca210>

(Andrew Pawelski) #570

Is there any chance this binding is interfering with the Mi Smart home binding?


(Marcus K.) #571

i use both and haven’t noticed any side-effects form using those two bindings in parallel


(Andrew Pawelski) #572

OK thanks just wondering as I cant get any control over gateway or the child devices, only some status and the gateway is detected by this biinding. Can I ask if your zigbee stuff is working fully and what version of OH you are running?


(marcel) #573

Not very likely… Indeed the gateway may be detected, but as long as you don’t add it as a thing, there won’t be any further communication with it.


(Marcus K.) #574

i’m running openHAB 2.3.0~20180429034940-1 (Build #1265) and yes my zigbee stuff (xiaomi,hue and osram) are working flawless, but i also use the orginal gateways for each of them as well as the according binding (see my profil for more informatipn :wink: )

and as @marcel_verpaalen already wrote the xiaomi gateway as well as my other xiaomi devices coupled with it, are also found by the Xiaomi MI IO binding, but for controlling them i use the Xiaomi Mi Smart Home Binding
the Xiaomi MI IO binding i only use for the robot vaccum


(Andrew Pawelski) #575

OK thanks I too use @marcel_verpaalen awesome binding for my wifi Xiaomi products its is awesome and flawless. Im just having no joy with my zigbee ones but thats for another thread I guess.


(jeshab) #576

Thanks for the information. I installed the latest build and I can draw the cleanup zone on the map the same way than in the Mi Home app but I don’t see how I can get the coordinates.


(Thorsten G) #577

You have to draw the zone and then press the cleanup button for about 2 seconds. Your coordinates will be copied to your phone’s clipboard.


(jeshab) #578

Awesome. I was able to get the coordinates. Thanks!

Updates
I am using a transformation mapping file to include my different coordinates and it works very well. Here is a light version of my config:

items/vacuum.items

Group:Switch:OR(ON, OFF) gVacuumArea "Vacuum Area"
Switch RobotVacuumActionDiningArea "Dining Table Cleaning" (gVacuumArea) {expire="5s"}
Switch RobotVacuumActionKitchenArea "Kitchen Cleaning" (gVacuumArea) {expire="5s"}

rules/vacuum.rules

rule "Vacuum Cleaning Area Request"
when
  Item gVacuumArea received update ON
then
  // Only if the mi robot is currently on the dock
  if (RobotVacuumStatusState.state == "Charging") {
    val areaItem = gVacuumArea.members.findFirst[ i | i.state == ON ] as SwitchItem
    val areaLabel = transform("REGEX", "RobotVacuumAction(\\w+)Area", areaItem.name)
    val areaMap = transform("MAP", "vacuum_area.map", areaLabel)

    if (areaMap != "")
      RobotVacuumActionCommand.sendCommand('app_zoned_clean[' + areaMap + ']')
  }
end

transform/vacuum_area.map

Dining=[26146,21844,27546,24994,1]
Kitchen=[20040,21173,23790,24273,1]

(Andrew Pawelski) #579

anyone seen this before? seems to be rediscovering over and over


(Matt) #580

@hachinga
Hi Thorsten,

i used your example for the zone cleaning but i have a strange problem. i use the below command which is working but if i run it again on the other day the zone is totally of and the vacuum is only cleaning half of the room.
do you have any ide what could cause the problem?
i already adjusted the coordinates twice but its only working for some time and then the zone is of again.

sendCommand(actionCommand,"app_zoned_clean[[24662,24079,28962,28029,1]]")

my rule

rule "Zone Cleaning"
 when
    Item vacZoneCleaning changed
 then
  switch (vacZoneCleaning.state) {
    case 1: {
          sendCommand(actionCommand,"app_zoned_clean[[24662,24079,28962,28029,1]]")
          vacZoneCleaning.postUpdate(0) }
    case 2: {
          sendCommand(actionCommand,"app_zoned_clean[[22479,27136,24529,29286,1]]")
          vacZoneCleaning.postUpdate(0) }
    case 3: {
          sendCommand(actionCommand,"app_zoned_clean[[29131,25240,32381,29440,1]]")
          vacZoneCleaning.postUpdate(0) }
    case 4: {
          sendCommand(actionCommand,"app_zoned_clean[[19383,26954,20883,29254,1]]")
          vacZoneCleaning.postUpdate(0) }
    case 5: {
          sendCommand(actionCommand,"app_zoned_clean[[32389,25262,35939,29512,1]]")
          vacZoneCleaning.postUpdate(0) }
    case 6: {
          sendCommand(actionCommand,"app_zoned_clean[[33025,21392,39075,24192,1]]")
          vacZoneCleaning.postUpdate(0) }
    case 7: {
          sendCommand(actionCommand,"app_zoned_clean[[35882,24372,43232,28422,1]]")
          vacZoneCleaning.postUpdate(0) }
    case 8: {
          sendCommand(actionCommand,"app_zoned_clean[[39199,22046,42199,24446,1]]")
          vacZoneCleaning.postUpdate(0) }
  }
  end

sitemap (the part for the vacuum)

Frame label="Others" {	
	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"]
		Selection	item=vacZoneCleaning mappings=[1="Master Bedroom", 2="Master Bathroom", 3="Kids Room", 4="Guest Bathroom", 5="Guest Room", 6="Kitchen", 7="Living/Dining", 8="Toilette"]
		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) #581

I’m afraid there is some sort of discovery issue when it is discovering the gateway device.
I don’t have such device, would you mind sending me a PM with a debug log when it is discovering.


(marcel) #582

From what I understand the coordinates may change once the vacuum does a full regular vacuum session.
So even though in the screen it looks the same each time, the coordinates may not be same each time. (like the vacuum also does not always run the same path each session)


(Thorsten G) #583

Hi Matt,

I’m having the same issue. As Marcel stated, the map coordinates are slightly different after every full clean cycle. Sometimes the map is even upside down :expressionless: I think the only solution is to use zone cleaning from now on even for the whole cleaning area. That means of course, that we have to create a zone for the whole area.

Regards

Thorsten


(Matt) #584

Hi Thorsten,

i was thinking of the same, will test it later when i’m home.
right now i have a full cleaning starting every time when the last person left our apartment.
therefore the zones are getting messed up at least 1 to 2 times per day.

lets see how it’s working with one separate zone for the full area.

apart from the zone problem i love the binding, thanks a lot for the work Marcel @marcel_verpaalen, and my xiaomi S50 is working well with it.
now i need only to get a nice widget done for habpanel :slight_smile:

Regards
Matt


(Matt ) #585

Just wanting to chime in that I’ve managed to get this controlling some WiFi plugs I bought by mistake when intending to get the Zigbee models… I’d since configured the zigbee ones with the other Mi Binding (probably a few months before you got this binding going).

But had a bit of spare time, so came back to the drawer full of ‘one day it’ll work’ items.

I used the iOS backup viewer to get the token data out.

Nice work!!


(Matthew) #586

Hi there, I seem to be having the Status: OFFLINE - CONFIGURATION_ERROR.

I have added my token.

Is there something else I also need to do that I may have forgotten to?


(Andrew Pawelski) #587

Think the gateway itself is faulty- I got another and that one has no issues


(Salexes) #588

I am getting this error:

2018-05-11 17:14:09.065 [WARN ] [nal.transport.MiIoAsyncCommunication] - Send command '{"id":320,"method":"miIO.info","params":[]}'  -> 192.168.1.119 (Device: 04AB4E66) gave error Given final block not properly padded

The thing is I just backed up my iphone and extracted the token from the database but it is still the same one as before, same ip as well, what could the issue be then ?

is it possible to force it to generate a new token ?


(Andy Wolff) #589

Sorry for the late reply. Since I wrote this post, I don’t have the problem anymore …
I have the firmware 3.3.9_003194 on my Mi Robot Vacuum…
What do you mean “What is the hardware you are running this on?”?