Xiaomi Robot Vacuum Binding

binding
vacuum
xiaomi
Tags: #<Tag:0x00007f1825f4f9b8> #<Tag:0x00007f1825f4f7b0> #<Tag:0x00007f1825f4f5f8>

(Andreas B ) #343

I have the following “Info” every 30 seconds in my log:

00:04:22.116 [INFO ] [rnal.transport.MiIoAsyncCommunication] - Received message is invalid JSON:
00:04:52.156 [INFO ] [rnal.transport.MiIoAsyncCommunication] - Received message is invalid JSON:

Any way to get in detail about that “info”? Is that already known - I think that I did not had that with 2.1? I am running on 2.2 since this morning and I got the newest version of the binding.


(Mark) #344

See my post above. This is still unresolved.


(Andreas B ) #345

Hey Mark,

thank you! Was to sleepy I guess - didnt see it. Then I will try to lower that log level at first.


(marcel) #346

I don’t really know what is causing this error indeed, As far as I know this is not because of a change in the code.
I tried to understand what happened in the framework that can cause this, but have not really found it.

anyway, I’ll change the level to debug, so it won’t show up in the log anymore.


(marcel) #347

New release available

23 December release

  • Updated yeelight database
  • Change type from string to number for several properties of Philips bulb & yeelight @OliM
  • Add new Robot vacuum 2 support
  • Updated to 2.3 snapshot
  • Fix discovery
  • Fix several code warnings
  • Update documentation (a bit…)
  • Change log level to avoid flooding log @mhilbush @DaAndy
  • Colors for yeelight color bulb(untested, experimental) @Caroline_O
  • removes NPE is specific cases during change of type
  • Removing unavailable properties from plug m1
  • Several cleanups to prepare for including it in the regular builds
    note to update uninstall and re-install the binding. In case of yeelights/philips bulb, best to remove the thing and add it again.

(Maciek B) #348

Thank you for continuous work on this binding and your support!


(Anthrax) #349

Hey There Everybody,

1st post in this awesome community!

First things first: Thank you so much for Openhab in general and this binding especially!

Working very nice so far - Only hurdle was extracting the Token from my Yeelights (ceiling & strip)…
But after using the following commands for adb and abe.jar (Android Backup Utilities) I was able to find the Token within this file after extraction: D:\Downloads\yeelight.tar\apps\com.yeelight.cherry\sp\miot.xml

commands:

adb.exe backup com.yeelight.cherry -f D:\Downloads\yeelight.ab
java -jar abe.jar unpack D:\Downloads\yeelight.ab D:\Downloads\yeelight.tar

One thing I’m missing though…
How do I set the ceiling to Moon (night mode)? Yeelights documentation (see page 12) shows the following method and parameters:

Method: set_power
Usage: This method is used to switch on or off the smart LED (software
managed on/off).
Parameters: 3.

"power" can only be “on” or “off”. “on” means turn on the smart LED,
“off” means turn off the smart LED.
“effect”: Refer to “set_ct_abx” method.
“duration”: Refer to “set_ct_abx” method.
“mode” (optional):
0: Normal turn on operation (default value)
1: Turn on and switch to CT mode.
2: Turn on and switch to RGB mode.
3: Turn on and switch to HSV mode.
4: Turn on and switch to color flow mode.
5: Turn on and switch to Night light mode. (Ceiling light only).

Is this working already?!

anyways, merry christmas and/or best regards
Anthrax


(Oli M) #350

thanks for the update!
switching on my yeelight ceeling lights is working now! im very happy with it now :slight_smile:
however i have the same issue now with colorMode. if i send another number, it switches back immediately:

2017-12-24 13:20:32.930 [ome.event.ItemCommandEvent] - Item ‘og_licht_kueche_tisch_mode’ received command 3
2017-12-24 13:20:32.942 [vent.ItemStateChangedEvent] - og_licht_kueche_tisch_mode changed from 2 to 3
2017-12-24 13:20:33.117 [vent.ItemStateChangedEvent] - og_licht_kueche_tisch_mode changed from 3 to 2

same issue if i try to change the color of my yeelight led strip:

2017-12-24 13:26:37.485 [ome.event.ItemCommandEvent] - Item ‘og_licht_wohnzimmer_led_color’ received command 110,88,85
2017-12-24 13:26:37.498 [vent.ItemStateChangedEvent] - og_licht_wohnzimmer_led_color changed from 0,0,100 to 110,88,85
2017-12-24 13:26:37.602 [vent.ItemStateChangedEvent] - og_licht_wohnzimmer_led_color changed from 110,88,85 to 0,0,100

I deleted the things and added them again. however it didnt find my yeelight led strip anymore. i had to add it manually…

Yeelight ceeling light:

  • power: working
  • brightness: not working
  • colorTemperature: not working
  • colorMode: not working

Yeelight led strip:

  • power: working
  • brightness: working
  • colorTemperature: not working
  • colorMode: not working

(Marat) #351

Hello! I’ve been trying to install the latest build from marketplace, but during start up it says:
Error executing command: Error executing command on bundles:
Error starting bundle 210: Could not resolve module: org.openhab.binding.miio [210]
Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
Unresolved requirement: Import-Package: org.eclipse.smarthome.config.discovery.mdns

Also tried to build git branch by myself, the same issue :frowning:
Is it something wrong with my Openhab installation? Previous build worked fine.
Thanks!


(marcel) #352

@Anthrax

I think because seems the set scene command requires text input, but the mode property gives number as return…
I assumed these to be equal.

Can you try to execute in the (advanced) command channel the following

set_scene["nightlight", 10]
and
set_scene["nightlight"]

to see if that is switching the mode/scene to the nightlight


(marcel) #353

@Marat

Indeed there was a error at the startup of the binding.The mdns discovery service I was using is now (in 2.3) marked as deprecated. I replaced it with the newer version. But it seems that gave a runtime error.
I’ve reverted back the change. The market place has the update


(Oli M) #354
2017-12-26 14:27:50.903 [ome.event.ItemCommandEvent] - Item 'og_licht_kueche_tisch_cmd' received command set_scene["nightlight", 10]

2017-12-26 14:27:50.915 [vent.ItemStateChangedEvent] - og_licht_kueche_tisch_cmd changed from {"result":["ok"],"id":6862} to set_scene["nightlight", 10]

2017-12-26 14:27:51.045 [vent.ItemStateChangedEvent] - og_licht_kueche_tisch_cmd changed from set_scene["nightlight", 10] to {"result":["ok"],"id":45}

works fine


(marcel) #355

@OliM
And the version without the ,10 does that work as well?


(Oli M) #356

set_scene[“nightlight”] didnt work.
set_scene[“nightlight”, 10] worked once, but cant get it working again. hmmm


(Anthrax) #357

Hey guys,

I’m away for the holidays will test as soon as I’ll be back.

You rock!
Anthrax


(Daniel Linder) #358

Hi,
I just added the Mi LED Desk Lamp using the latest update of the binding.
At a first glance, it seems to function flawless.
To extract the key - I installed the Mi Home app and followed the instructions in this thread.
However, since the Openhab integration (in my house) is kind of “Work In Progress” - my daughters would like to be able to control their laps using the standard Yeelight app - and the Google Home integration.
So - if I add the lamp to the Yeelight app, it will be removed from the Mi Home app (at least I have not found a way for them to co-exist in both apps). Will the Openhab Integration still work, ie. is the key I extracted a “static key” - or is a new key generated each time I pair the lamp with Mi Home?
I can of course try, but thought I should check with the experts first. :slight_smile:


(Arazlin) #359

Hello =), I bought a xiaomi robot vacuum (generation 2) recently. The addon installed no problem, and I retrieved the token no problem. The vacuum was found in my inbox (Paper UI) but it has listed the chancels as ‘miio:unsupported:047071BE’. I am able to retrieve the network information but I’m unable to start the vacuum or get any other information (no errors pop up in the openhab logs that I’ve been able to see)

Guess my first question should be is this particular robot vacuum supported?


(marcel) #360

Hi @LouiseButler your model should be supported indeed if you have the latest binding installed. I’ve tried to add the code for it. I if you installed the binding before 24th pls update the binding and delete your thing. Than let it be discovered again with the new version.

You’re the first with the new robot version, so it may require bit of work.


(Arazlin) #361

Yep, installed the binding yesterday. Happy to help test / fiddle / provide logs as you need :slight_smile:


(marcel) #362

okay, to get you going…

Yes, would be great to have the debug log of the binding from where it starts to understand why it is not auto discovering your vacuum

to get it, pls execute in the karaf console:
log:set debug org.openhab.binding.miio
bundle:restart org.openhab.binding.miio
'log:tail org.openhab.binding.miio`

Than, to get you going pls instead of having it discovered automatically, add it as a miio:vacuum device with the right ip & token. Now it should work

Than once it has doing it iitial set of requests etc (you may see a NPE at the very first refresh) it expect it will work

After it works, would be great to receive from you the full log (best send in PM). A;so if it does not work , would be great to see the log file to understand why it is not working

Also would be good to understand which modelId you see in paperUI or in the config after the first set of updates