Xiaomi Robot Vacuum Binding

binding
vacuum
xiaomi
Tags: #<Tag:0x00007fe057c52990> #<Tag:0x00007fe057c52580> #<Tag:0x00007fe057c52008>

(Giovanni Guadagnini) #940

How can i do it?


(Goran Stijakovic) #941

Hello Giovanni,
look at this Youtube Video. The only problem is that the video is in german.


[Yeelight] How to set rules
(Giovanni Guadagnini) #942

Thank you. I will try.


(Giovanni Guadagnini) #943

Thanks it works :slight_smile:


(Goran Stijakovic) #944

Perfect!


(Sascha_S) #945

I have been using the Vacuum Binding for my vacuum for almost a year now. Suddenly I get this error:

Status: OFFLINE - COMMUNICATION_ERROR maximum number of DatagramSockets reached

I configured the vacuum using a .things file:

Thing miio:vacuum:natascha "Livingroom_Natascha" @ "House" [ host="192.168.XXX.XXX", token="XXXXXXXXXXXXXXXXXXXXXXXXXX" ]

What is going on?
Strange is also, that I keep getting the vacuum in my inbox.
Help would be appreciated


(marcel) #946

Yes, this was recently identified as an issue.
To fix this, please also define the deviceId in your .things file as well. Current version of the binding now has this as a mandatory field.
Alternative is to have the thing automatically discovered instead of defining by thing file


(Sascha_S) #947

Alrighty,
but isnt the device ID in my .things file already?

I thought the part after miio:vacuum: (so natascha in my case) is the deviceID…


(marcel) #948

it indeed is when you would use regular discovery . The binding is using the one in the properties. So make it something like:

Thing miio:vacuum:natascha "Livingroom_Natascha" @ "House" [ host="192.168.XXX.XXX", token="XXXXXXXXXXXXXXXXXXXXXXXXXX" , deviceId="XXXXXXXXXX" ]


(Bart) #949

When trying to use the “custom scene” functionality, I get the following error. I assume this should work by creating and naming a scene in the Mi Home app, and then just putting that string into the item’s state?

21:23:48.908 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘customScene’ received command Night
21:23:48.917 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - Locating action for channel customScene: Night
21:23:48.918 [INFO ] [rthome.event.ItemStatePredictedEvent] - customScene predicted to become Night
21:23:48.922 [DEBUG] [inding.miio.handler.MiIoBasicHandler] - Sending command set_scene["Night]
21:23:48.926 [WARN ] [nal.transport.MiIoAsyncCommunication] - Send command ‘set_scene’ with parameters ["Night] -> 192.168.1.14 (Device: 04A1B313) gave error com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 9 path $[0]
21:23:48.931 [INFO ] [marthome.event.ItemStateChangedEvent] - customScene changed from Sleep to Night
21:23:48.930 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.handleCommand()’ on ‘org.openhab.binding.miio.handler.MiIoBasicHandler@8d80bb’: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 9 path $[0]
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 9 path $[0]
at com.google.gson.internal.Streams.parse(Streams.java:60) ~[21:com.google.gson:2.7.0.v20170129-0911]

The item’s definition is just verbatim from the readme:

String customScene “Set Scene” (G_light) {channel=“miio:basic:059455c7:customScene”}


(Aaron) #950

Hi everyone it’s a long post but I noticed something that i have a question on

Is main controll of the vacuum done over the local network I noticed it says the map still comes from the cloud so is the rest handled locally?

Also how are you all finding this vacumm thinking about buying in the future


(Jack Sand) #951

map_present

miio:vacuum:05C15368:status#map_present

Number

what is this for?


(marcel) #952

It does not work that way unfortunately. The profiles are stored in the cloud, not on the device.
You will need to find the exact parameters that the app is sending for your scene.
I’m actually thinking to remove this command as it is not very useful from the binding point of view.

The error does look like a bug though, missing the closing " in the.


(marcel) #953

Indeed, the control via the binding is done over the local network.
The android/IOS app can communicate via cloud and local… if it is in the same subnet it will communicate directly. If not, it will communicate via the cloud. It goes seamless… you will not notice.
Some parts are only available in the cloud (like the map info), hence that is not available in the binding. (you can root the vacuum, than there are some options to pull the map data directly)

I’m still very happy with my purchase. I think it is working very fine and has some features that are only available on much more expensive models… I would definitely buy it again.


(Aaron) #954

Hi Marcel thanks for the reply

that’s relay good too know and its actually a major selling point for me tbh you can never trust how long a company will keep its servers online for making your device a paperweight once they do

I think i will purchase one as they are a good price and look forward too using your binding

its just a shame there’s no virtual wall feature with these robots
are both generations of the robot supported with your binding


(Tom) #955

Marcel, please can you please give me one example how to send one command to Light, base on commands informations in post Xiaomi Robot Vacuum Binding.
I stuck with what to send. Properties or supported methods?

Please One example like

PhilipsZhiRuiBedsideLamp_Actions_ExecuteCommand.sendCommand(‘pow’,‘on’)

To get idea how …

Any of these do nothing …


(Denis) #956

Here are my examples of commands that I successfully use to control Yeelight LED Ceiling Lamp

//Command to turn on the lamp on mode 1 (Sun)
sendCommand(BR_Lamp_Cmd, 'set_power["on", "smooth", 500, 1]')

//Command to turn on the lamp on mode 5 (Moon)
sendCommand(BR_Lamp_Cmd, 'set_power["on", "smooth", 500, 5]') 

//Command to turn off the lamp
sendCommand(BR_Lamp_Cmd, 'set_power["off", "smooth", 500]')

Yeelight bulb
(Brian M. Pedersen) #957

I don’t think yeelight bulbs are controlled the same way as the PhilipsZhiRuiXXX bulbs, but Im not sure


(marcel) #958

Yeelight & Philips light commands have some similarities

if you look at the database you get a good idea of the commands for philips lights (look at actions part in the json)


(Tom) #959

Trying to findout the basic. How to send power on/off as its working only thing working over Binging, so I can guess how to test other commands …
I tryed

PhilipsZhiRuiBedsideLamp_Actions_ExecuteCommand.sendCommand('set_power["pow","on"]')
PhilipsZhiRuiBedsideLamp_Actions_ExecuteCommand.sendCommand('set_power["on","pow"]')

But nothing happend … at leas no error now :slight_smile:

EDIT:

ahaaaa

PhilipsZhiRuiBedsideLamp_Actions_ExecuteCommand.sendCommand('set_power["on"]')
PhilipsZhiRuiBedsideLamp_Actions_ExecuteCommand.sendCommand('set_power["off"]')

so for what i need that ‘pow’ stuff?