Xiaomi Robot Vacuum Binding

i upgraded to 2.4 stable .I installed the binding through paperui addons and in the inbox i get double entries!


i have 3 yeelight color bulbs and a ledstrip 1.0.As you see i get the same device as “xiaomi mi device” and as “xiaomi mi basic device”…Why is that?What device to add?I uninstalled the binding ,stoped openhab ,clean cache and restarted.I reinstalled the binding but i get the same double items…

wtr to the double entries: you can pick either one… end result is the same. The binding has 2 different types of discoveries. As the info provided by the device is not equal for the 2 methods, you get 2 items.
Unfortunately not all devices support both methods, otherwise one could be eliminated.
I did not find a good (supported by the framework) way to join them.

Sorry for asking here but anyone had issues with the first gen that it suddenly stops during cleaning? Like if you cut power from it… for me it seems a battery issue but I’m not sure
It only do this in normal cleanup, when operating with remote controls or using spot/zoned cleanup no problem…
I somehow reverted back to the original fw some days ago, it did the same thing…

How can I send a command from:


to a RGB Yeelight v1?

Edit:
Solution is to add a new channel:

String YeelightAC_1                                         {channel="miio:basic:xxxxxxx:actions#commands"}

then you cand send commands to it:

sendCommand(YeelightAC_1, 'set_name["Yeelight#1"]')

indeed as @Nico111 indicated create a item for the command channel.
In the spec it has e.g. { "id": 1, "method": "set_power", "params":["on", "smooth", 500]}
the command to send in OH only would need the method[params] so the example equivalent would be set_power["on", "smooth", 500]

1 Like

Hi!

I used the binding and robot for quite some time now and came up with a few issues that i don’t know how to handle well.
The robot creates a new map everytime it runs.
That causes closed doors to get recognized as a wall and when i try to clean the room that was closed during the last cleaning cycle the robot does not find its way …
I had the idea to first command the robot to go close to the door and then (hopefully) it sees that the door is open again, creates a new map/way inside the room i want to clean and then start the area cleaning function.
How do you handle this?

Biggest problem:
My vacuum is located in the bathroom and the door is normally closed.
When i clean the bathroom and the door is closed (area bathroom) then the robot recognized it is locked inside a room and when i try to clean other rooms later it does not manage to leave the room although the door is obviously open now …

Anyone else having “UNINTILIAZED” states on yeelights and roborocks?

This mostly means the binding is not installed or not started. Have you recently upgraded?

Yes, I did the 2.4 stable upgrade.
Can I fix it by manually adding an older .jar?

Edit:
Sorry for wasting time, the addon really just got deinstalled for whatever reason

Did you install the official binding via the addons section? It is jncluded in OH 2.4 now

yes, the official.
It was included before too :slight_smile:
Yeelights are working perfectly again, are there Channels like RSSI or SSID which are not shown in the PaperUI thing view?

There are channels like rssi (basically all the network related channels and the command channel) that only show in paperui when you click the ‘show more’ button as they’re marked as advanced.

Thanks to all of you for this amazing topic! :sunglasses:

If you have problems getting the tokens out, I did, it seems even the old version of the app doesnt store the tokens anymore, you can maybe use this method, see https://community.home-assistant.io/t/get-the-xiaomi-home-token/53500/13
It worked for me. :slight_smile:

When I add things, I get this error:

2018-12-28 10:03:44.343 [hingStatusInfoChangedEvent] - 'miio:basic:Powerstrip2' changed from UNINITIALIZED to INITIALIZING

2018-12-28 10:03:44.346 [hingStatusInfoChangedEvent] - 'miio:basic:Powerstrip2' changed from INITIALIZING to OFFLINE

==> /var/log/openhab2/openhab.log <==

2018-12-28 10:03:45.327 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:

java.lang.NullPointerException: null

at org.openhab.binding.miio.internal.Utils.hexStringToByteArray(Utils.java:40) ~[?:?]

at org.openhab.binding.miio.handler.MiIoBasicHandler.initializeData(MiIoBasicHandler.java:237) ~[?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

at java.lang.Thread.run(Thread.java:748) [?:?]

2018-12-28 10:03:45.343 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:

java.lang.NullPointerException: null

at org.openhab.binding.miio.internal.Utils.hexStringToByteArray(Utils.java:40) ~[?:?]

at org.openhab.binding.miio.handler.MiIoBasicHandler.initializeData(MiIoBasicHandler.java:237) ~[?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

at java.lang.Thread.run(Thread.java:748) [?:?]

==> /var/log/openhab2/events.log <==

2018-12-28 10:03:54.340 [me.event.ThingUpdatedEvent] - Thing 'miio:basic:Powerstrip1' has been updated.

2018-12-28 10:03:54.346 [me.event.ThingUpdatedEvent] - Thing 'miio:basic:Powerstrip1' has been updated.

2018-12-28 10:03:54.361 [hingStatusInfoChangedEvent] - 'miio:basic:Powerstrip1' changed from OFFLINE to ONLINE

2018-12-28 10:03:54.462 [me.event.ThingUpdatedEvent] - Thing 'miio:basic:Powerstrip1' has been updated.

==> /var/log/openhab2/openhab.log <==

2018-12-28 10:03:54.465 [INFO ] [ing.miio.handler.MiIoAbstractHandler] - Mi Device model zimi.powerstrip.v2 identified as: Mi Power-strip v2 (zimi.powerstrip.v2). Matches thingtype miio:basic

==> /var/log/openhab2/events.log <==

2018-12-28 10:03:54.472 [me.event.ThingUpdatedEvent] - Thing 'miio:basic:Powerstrip1' has been updated.

my things:

Thing miio:basic:Powerstrip1 “Powerstrip1” [ host=“192.168.1.113”, token=“xx” ]
Thing miio:basic:Powerstrip2 “Powerstrip2” [ host=“192.168.1.115”, token=“xx” ]

Does anybody know why??

everything works as it is supposed to though. :slight_smile:

… or in fact not. after adding about 10 things to my mio binding, I get this error on all things:

2018-12-28 10:21:15.576 [hingStatusInfoChangedEvent] - 'miio:basic:Powerstrip1' changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): maximum number of DatagramSockets reached

I found a thread there somebody had the same problem, he ran this command to find errors:

$ ss -s
Total: 254 (kernel 0)
TCP:   28 (estab 9, closed 6, orphaned 0, synrecv 0, timewait 6/0), ports 0

Transport Total     IP        IPv6
*         0         -         -
RAW       1         0         1
UDP       46        10        36
TCP       22        9         13
INET      69        19        50
FRAG      0         0         0

I run 2.4 stable on openhabian.

This is indeed a bug… The binding assumes that it has the device ID from the discovery.
As you define it with .thing files it goes wrong.

I think the quick work around is to either also define the device ID in the thing file, or have the thing being discovered (you can still have your items defined by file)

1 Like

Unfortunately my Yeelight devices are without function. I have installed OH 2.4 and reinstalled the MIIO Binding. The three devices are recognized, I added the token, online, see screen shot. I have created the items. The items are not visible in Control and do not work via Sitemap.
Schlafzimmer: Yeelight Ceiling V1
Wohnzimmer: Yeelight Ceiling V3
ColorLamp V1
What is my mistake?

Switch YeelightLEDCeilingLampSchlafzimmer_power "Schlafzimmer" {channel="miio:generic:04A1E5E5:power"}
Number YeelightLEDCeilingLampSchlafzimmer_brightness "Schlafzimmer Brightness" {channel="miio:generic:04A1E5E5:brightness"}
Number YeelightLEDCeilingLampSchlafzimmer_colorTemperature "Schlafzimmer Color Temperature" {channel="miio:generic:04A1E5E5:colorTemperature"}

Switch YeelightLEDCeilingLampWohnzimmer_power "Wohnzimmer Deckenlampe" {channel="miio:generic:05E2397B:power"}
Number YeelightLEDCeilingLampWohnzimmer_brightness "Wohnzimmer Brightness" {channel="miio:generic:05E2397B:brightness"}
Number YeelightLEDCeilingLampWohnzimmer_colorTemperature "Wohnzimmer Color Temperature"{channel="miio:generic:05E2397B:colorTemperature"}

Switch YeelightLEDColorLamp_power "Lampe Power" {channel="miio:generic:0371FF48:power"}
Number YeelightLEDColorLamp_brightness "Lampe Brightness" {channel="miio:generic:0371FF48:brightness"}
Color YeelightLEDColorLamp_color "Lampe Color" {channel="miio:generic:0371FF48:rgbColor"}

sitemap default label=“Joe4RG” {

Frame {
	Switch item=YeelightLEDCeilingLampWohnzimmer_power label="Wohnzimmer Licht" icon="light"
	Slider item=YeelightLEDCeilingLampWohnzimmer_brightness label="Wohnzimmer Helligkeit" icon="light"
	Slider item=YeelightLEDCeilingLampWohnzimmer_colorTemperature label="Wohnzimmer Lichtfarbe" icon="light"

	Switch item=YeelightLEDColorLamp_power label="Cara Licht" icon="light"
	Slider item=YeelightLEDColorLamp_brightness label="Cara Helligkeit" icon="light"
	Colorpicker item=YeelightLEDColorLamp_color label="Cara Color" icon="colorwheel"

	Switch item=YeelightLEDCeilingLampSchlafzimmer_power label="Schlafzimmer Licht" icon="light"
	Slider item=YeelightLEDCeilingLampSchlafzimmer_brightness label="Schlafzimmer Helligkeit" icon="light"
	Slider item=YeelightLEDCeilingLampSchlafzimmer_colorTemperature label="Schlafzimmer Lichtfarbe" icon="light"
	}	

}

2018-12-28 16:25:43.296 [home.event.InboxAddedEvent] - Discovery Result with UID ‘miio:generic:04A1E5E5’ has been added.
2018-12-28 16:25:43.298 [home.event.InboxAddedEvent] - Discovery Result with UID ‘miio:generic:05E2397B’ has been added.
2018-12-28 16:25:43.301 [home.event.InboxAddedEvent] - Discovery Result with UID ‘miio:generic:0371FF48’ has been added.
2018-12-28 16:25:43.330 [me.event.InboxRemovedEvent] - Discovery Result with UID ‘miio:generic:04A1E5E5’ has been removed.
2018-12-28 16:25:43.359 [hingStatusInfoChangedEvent] - ‘miio:generic:04A1E5E5’ changed from UNINITIALIZED to INITIALIZING
2018-12-28 16:25:43.374 [hingStatusInfoChangedEvent] - ‘miio:generic:04A1E5E5’ changed from INITIALIZING to OFFLINE
2018-12-28 16:25:43.419 [me.event.InboxRemovedEvent] - Discovery Result with UID ‘miio:generic:05E2397B’ has been removed.
2018-12-28 16:25:43.429 [hingStatusInfoChangedEvent] - ‘miio:generic:05E2397B’ changed from UNINITIALIZED to INITIALIZING
2018-12-28 16:25:43.431 [hingStatusInfoChangedEvent] - ‘miio:generic:05E2397B’ changed from INITIALIZING to OFFLINE
2018-12-28 16:25:43.433 [me.event.InboxRemovedEvent] - Discovery Result with UID ‘miio:generic:0371FF48’ has been removed.
2018-12-28 16:25:43.436 [hingStatusInfoChangedEvent] - ‘miio:generic:0371FF48’ changed from UNINITIALIZED to INITIALIZING
2018-12-28 16:25:43.437 [hingStatusInfoChangedEvent] - ‘miio:generic:0371FF48’ changed from INITIALIZING to OFFLINE
2018-12-28 16:25:53.388 [hingStatusInfoChangedEvent] - ‘miio:generic:04A1E5E5’ changed from OFFLINE to ONLINE
2018-12-28 16:25:53.445 [hingStatusInfoChangedEvent] - ‘miio:generic:05E2397B’ changed from OFFLINE to ONLINE
2018-12-28 16:25:53.447 [hingStatusInfoChangedEvent] - ‘miio:generic:0371FF48’ changed from OFFLINE to ONLINE
2018-12-28 16:33:21.813 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampWohnzimmer_power’ received command ON
2018-12-28 16:33:21.816 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampWohnzimmer_power predicted to become NULL
2018-12-28 16:33:23.927 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampWohnzimmer_brightness’ received command 100
2018-12-28 16:33:23.929 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampWohnzimmer_brightness predicted to become NULL
2018-12-28 16:33:26.571 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampWohnzimmer_colorTemperature’ received command 100
2018-12-28 16:33:26.573 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampWohnzimmer_colorTemperature predicted to become NULL
2018-12-28 16:33:28.492 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampWohnzimmer_brightness’ received command 52
2018-12-28 16:33:28.494 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampWohnzimmer_brightness predicted to become NULL
2018-12-28 16:33:30.062 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampWohnzimmer_colorTemperature’ received command 55
2018-12-28 16:33:30.064 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampWohnzimmer_colorTemperature predicted to become NULL
2018-12-28 16:33:35.011 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDColorLamp_power’ received command ON
2018-12-28 16:33:35.012 [nt.ItemStatePredictedEvent] - YeelightLEDColorLamp_power predicted to become NULL
2018-12-28 16:33:40.054 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDColorLamp_brightness’ received command 100
2018-12-28 16:33:40.056 [nt.ItemStatePredictedEvent] - YeelightLEDColorLamp_brightness predicted to become NULL
2018-12-28 16:33:43.735 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDColorLamp_color’ received command 1,87,100
2018-12-28 16:33:43.739 [nt.ItemStatePredictedEvent] - YeelightLEDColorLamp_color predicted to become NULL
2018-12-28 16:33:44.540 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDColorLamp_color’ received command 1,87,100
2018-12-28 16:33:44.541 [nt.ItemStatePredictedEvent] - YeelightLEDColorLamp_color predicted to become NULL
2018-12-28 16:33:44.841 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDColorLamp_color’ received command 359,91,100
2018-12-28 16:33:44.842 [nt.ItemStatePredictedEvent] - YeelightLEDColorLamp_color predicted to become NULL
2018-12-28 16:33:45.143 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDColorLamp_color’ received command 355,99,100
2018-12-28 16:33:45.145 [nt.ItemStatePredictedEvent] - YeelightLEDColorLamp_color predicted to become NULL
2018-12-28 16:33:45.444 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDColorLamp_color’ received command 355,99,100
2018-12-28 16:33:45.445 [nt.ItemStatePredictedEvent] - YeelightLEDColorLamp_color predicted to become NULL
2018-12-28 16:33:49.982 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampSchlafzimmer_power’ received command ON
2018-12-28 16:33:49.984 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampSchlafzimmer_power predicted to become NULL
2018-12-28 16:33:52.320 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampSchlafzimmer_brightness’ received command 80
2018-12-28 16:33:52.322 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampSchlafzimmer_brightness predicted to become NULL
2018-12-28 16:33:53.395 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampSchlafzimmer_brightness’ received command 100
2018-12-28 16:33:53.397 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampSchlafzimmer_brightness predicted to become NULL
2018-12-28 16:33:55.528 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampSchlafzimmer_colorTemperature’ received command 100
2018-12-28 16:33:55.531 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampSchlafzimmer_colorTemperature predicted to become NULL
2018-12-28 16:33:56.811 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampSchlafzimmer_colorTemperature’ received command 55
2018-12-28 16:33:56.813 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampSchlafzimmer_colorTemperature predicted to become NULL
2018-12-28 16:33:58.291 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDCeilingLampSchlafzimmer_brightness’ received command 48
2018-12-28 16:33:58.293 [nt.ItemStatePredictedEvent] - YeelightLEDCeilingLampSchlafzimmer_brightness predicted to become NULL
2018-12-28 16:33:59.903 [ome.event.ItemCommandEvent] - Item ‘YeelightLEDColorLamp_brightness’ received command 55
2018-12-28 16:33:59.906 [nt.ItemStatePredictedEvent] - YeelightLEDColorLamp_brightness predicted to become NULL

wrt to the yeelight, pls set the binding logging to debug (see very first topic on how) and see if there are proper responses to the commands.
if not, most likely your tokens are not the right ones

Happy New Year. The lamps work. The Token have changed by the FW update. Thanks for your support.

On a ceiling light I’m trying to make the Set Scene {channel=“miio:basic:CeilingBedRoom:customScene”} function work. I tried with numbers and commands like Sun, ТV, Warm, Night but I get no reaction. I also tried with numbers though the channel should be a string.
Did any of you make it work?