Mi(Xiaomi) Smart home bindings?

same problem :frowning:

@dimalo could you please help me
Right now I have:
OpenHab -> 2.1.0 - release build - (last stable version)
MiHome -> 195 | Active | 80 | 2.2.0.201707150819 | Xiaomi Mi Smart Home Binding

Seems all is configured correctly, but I see in logs:

23:35:24.281 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Plug_Active' received command ON
23:35:24.284 [WARN ] [ihome.handler.XiaomiActorPlugHandler] - Can't handle command ON on channel mihome:sensor_plug:158d00015f33a2:inUse

And switch not work :frowning:
What you can suggest?

Hi!
First of all, inUse is not to switch the plug, its ā€œpowerā€.
if that does not works, please try OH 2.2.0 with 2.2.0 bindingā€¦

Same here just with the Aquara one button switch (86sw1) no reaction when pressing.
(OpenHab 2.1 with official mihome binding from paper ui)

I confirm :frowning:

Is the new square aqara temp/humidity/pressure sensor working now with latest snapshot version of this binding?

IĀ“m on openhab 2.2 snapshot and made apt-get update/upgrade today to build 2.2.0 #1023 but still no automatic discovery of new devices. I can see the new sensors in the myhome app but not in paper ui.

canā€™t get the Smart Plug (ZigBee Version) to work.
only get an error

any idea or the same problem?

2017-08-24 21:35:41.076 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occurred while calling handler: java.lang.NullPointerException
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at org.eclipse.smarthome.core.common.SafeMethodCaller.executeDirectly(SafeMethodCaller.java:220)[98:org.eclipse.smarthome.core:0.9.0.b5]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:189)[98:org.eclipse.smarthome.core:0.9.0.b5]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:83)[98:org.eclipse.smarthome.core:0.9.0.b5]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:67)[98:org.eclipse.smarthome.core:0.9.0.b5]
	at org.eclipse.smarthome.core.thing.internal.ThingManager.receiveCommand(ThingManager.java:374)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
	at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:47)[98:org.eclipse.smarthome.core:0.9.0.b5]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:192)[98:org.eclipse.smarthome.core:0.9.0.b5]
	at org.eclipse.smarthome.core.internal.events.OSGiEventManager$1.call(OSGiEventManager.java:1)[98:org.eclipse.smarthome.core:0.9.0.b5]
	at org.eclipse.smarthome.core.common.SafeMethodCaller$CallableWrapper.call(SafeMethodCaller.java:181)[98:org.eclipse.smarthome.core:0.9.0.b5]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: java.lang.NullPointerException
	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.toJsonValue(XiaomiBridgeHandler.java:319)[181:org.openhab.binding.mihome:2.1.0]
	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.sendCommandToBridge(XiaomiBridgeHandler.java:257)[181:org.openhab.binding.mihome:2.1.0]
	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.sendCommandToBridge(XiaomiBridgeHandler.java:239)[181:org.openhab.binding.mihome:2.1.0]
	at org.openhab.binding.mihome.handler.XiaomiBridgeHandler.writeToDevice(XiaomiBridgeHandler.java:266)[181:org.openhab.binding.mihome:2.1.0]
	at org.openhab.binding.mihome.handler.XiaomiActorPlugHandler.execute(XiaomiActorPlugHandler.java:42)[181:org.openhab.binding.mihome:2.1.0]
	at org.openhab.binding.mihome.handler.XiaomiDeviceBaseHandler.handleCommand(XiaomiDeviceBaseHandler.java:97)[181:org.openhab.binding.mihome:2.1.0]
	at org.eclipse.smarthome.core.thing.internal.ThingManager$4.call(ThingManager.java:377)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
	at org.eclipse.smarthome.core.thing.internal.ThingManager$4.call(ThingManager.java:1)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.executeDirectly(SafeMethodCaller.java:218)[98:org.eclipse.smarthome.core:0.9.0.b5]
... 12 more

I am still waiting for it, but is anybody running that Xiaomi Wifi Power Strip with six outputs (https://www.gearbest.com/electronics-gadgets/pp_310701.html ) in openhab?

I did not find it in any binding or thread. Probably a waste of money? Should have looked before - these gearbest-flash salesā€¦ :confused:

Thank you in advance.

Edit: Found a thread with very few comments: Binding for Xiaomi wifi plug and power strips - Xiaomi Mi IO Binding ; guess it was a waste of money.

Edit 2: The Xiaomi Robot Vacuum Binding should help: Xiaomi Robot Vacuum Binding ; just to inform anybody who reads this :slight_smile:

I think you need to download the jar manually from
https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.mihome/2.2.0-SNAPSHOT/

I have 4 of them working

1 Like

Not working with this too.

I uninstalled the old binding manually, then changed the addons.cfg and after that copied the jar to the addons-folder and made a complete server reboot.

No new devicesā€¦

i have made a mihome.things file - could this be the error? Or can i have a mixed setup? Some devices configured with mihome.things and some with paper ui?

DonĀ“t know how i can get the device-id of the new temp sensors without paper ui auto discovery?ā€™

Now it works. I had to wait some timeā€¦

But another question:

I get pressure in kPa (maybe 99.2 kPa).

In germany pressure is measured in mbar.

Do i have to change this with a rule or is there a simpler way?

Thank you so much!!! This makes the Smart Plug (ZigBee) to work perfectly!!!

The same here in Denmark, it is only a factor 10 difference, but having a rule setting multiplying with 10 for a virtual item would be overdoing it, I think

I also had my smart plugs stop working after an update. I found the problem was that the channel naming had changed from my old version. So you can try removing and adding one unit to see if the channels are different.

I got my gateway, couple buttons, and a few door and motion sensors today. Everything works well through the app.
I canā€™t get OH to connect to the gateway. Iā€™ve tried both the 2.1 and marketplace bindings, manually adding the gateway, upgraded to 2.2 snapshot (from 2.1). At one point I was getting some debug info when doing a discovery or adding the gateway manually. Since 2.2 I donā€™t even seem to get that.

Developer mode is enabled. Iā€™ve tried disabling and reenabling just to make sure it wasnā€™t stuck somewhere.
It doesnā€™t seem like anyone else has run into this problem.

Hey, I have the exact same kind of issue with 2.1 or 2.2 binding versions but both displays nothing on logs.
Iā€™m able to ping the gateway and triple checked that dev mode and network functions are enable in ā€œMi Homeā€ app.

I tried to manually add a ā€œXiaomi Bridgeā€ with infos given in the app and then ā€œXiaomi Gatewayā€ but the 1st one is blocked in ā€œinitializingā€ state, the other one wait for the 1st to finish as they gateway seems to depend of a bridge.

Iā€™m out of idea now :confused:

I tried the same and get the same initializing. Took me a bit to figure out I needed to add the bridge instead of the gateway.

When setting the log level, is the correct name org.openhab.binding.xiaomi? I thought thatā€™s what I had done before, but Iā€™m not getting anything now. I even went so far as to do a complete removal of OH2 and reinstall. Iā€™ve had that clear up odd issues in the past but no luck this time.

I talked with another user which implemented Xiaomi smart home stuff last week and he didnā€™t had issues like us. Weird.

I retried the procedure with 2.1 revision and have still the same issue. I also regenerated developper key multiple time (and clicked on confirm) but nothing to do, still in ā€œInitializingā€ state.

Here are my logs :

20:29:42.527 [INFO ] [smarthome.event.ThingAddedEvent     ] - Thing 'mihome:bridge:110cc149' has been added.
20:29:42.547 [INFO ] [me.event.ThingStatusInfoChangedEvent] - 'mihome:bridge:110cc149' changed from UNINITIALIZED to INITIALIZING
20:30:20.197 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - HttpChannelOverHttp@773dfe56{r=2,c=false,a=IDLE,uri=/rest/thing-types/mihome:bridge} messageComplete
20:30:20.197 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - HttpChannelOverHttp@773dfe56{r=2,c=false,a=IDLE,uri=/rest/thing-types/mihome:bridge} handle enter
20:30:20.197 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - HttpChannelOverHttp@773dfe56{r=2,c=false,a=DISPATCHED,uri=/rest/thing-types/mihome:bridge} action REQUEST_DISPATCH
20:30:20.197 [DEBUG] [org.eclipse.jetty.server.Server     ] - REQUEST GET /rest/thing-types/mihome:bridge on HttpChannelOverHttp@773dfe56{r=2,c=false,a=DISPATCHED,uri=/rest/thing-types/mihome:bridge}
20:30:20.197 [DEBUG] [ax.web.service.spi.model.ServerModel] - Matching [/rest/thing-types/mihome:bridge]...
20:30:20.197 [DEBUG] [ax.web.service.spi.model.ServerModel] - Path [/rest/thing-types/mihome:bridge] matched to {pattern=/rest/.*,model=ServletModel{id=org.ops4j.pax.web.service.spi.model.ServletModel-11,name=org.ops4j.pax.web.service.spi.model.ServletModel-11,urlPatterns=[/rest/*],alias=/rest,servlet=com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge@59afbac1,initParams={},context=ContextModel{id=org.ops4j.pax.web.service.spi.model.ContextModel-10,name=,httpContext=DefaultHttpContext [bundle=com.eclipsesource.jaxrs.publisher_5.3.1.201602281253 [9], contextID=default],contextParams={},virtualHosts={},connectors={}}}}
20:30:20.197 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=com.eclipsesource.jaxrs.publisher_5.3.1.201602281253 [9], contextID=default]}
20:30:20.197 [DEBUG] [.jetty.server.handler.ContextHandler] - context=||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=com.eclipsesource.jaxrs.publisher_5.3.1.201602281253 [9], contextID=default]}
20:30:20.198 [DEBUG] [eclipse.jetty.servlet.ServletHandler] - servlet |/rest|/thing-types/mihome:bridge -> org.ops4j.pax.web.service.spi.model.ServletModel-11@b9f03e58==com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge,-1,true
20:30:20.198 [DEBUG] [ce.jetty.internal.HttpServiceContext] - Handling request for [/rest/thing-types/mihome:bridge] using http context [DefaultHttpContext [bundle=com.eclipsesource.jaxrs.publisher_5.3.1.201602281253 [9], contextID=default]]
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ o.e.j.s.h.ContextHandler@4be33c31{/static,null,AVAILABLE}
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=org.jupnp.transport.impl.osgi.DisableAuthenticationHttpContext@692a1af2}
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.core_2.1.0 [166], contextID=default]}
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.ui.dashboard_2.1.0 [170], contextID=default]}
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.core.audio_0.9.0.b5 [99], contextID=default]}
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui_0.9.0.b5 [136], contextID=default]}
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui.icon_0.9.0.b5 [137], contextID=default]}
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui.basic_0.9.0.b5 [176], contextID=default]}
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.eclipse.smarthome.ui.paper_0.9.0.b5 [177], contextID=default]}
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.ui.habmin_2.1.0 [197], contextID=default]}
20:30:20.199 [DEBUG] [.jetty.server.handler.ContextHandler] - scope null||/rest/thing-types/mihome:bridge @ HttpServiceContext{httpContext=DefaultHttpContext [bundle=org.openhab.ui.habpanel_2.1.0 [179], contextID=default]}
20:30:20.199 [DEBUG] [org.eclipse.jetty.server.Server     ] - RESPONSE /rest/thing-types/mihome:bridge  200 handled=true

@pboos May you please help us to debug it ?

EDIT : @PointandClick is your server wired to your LAN ? Itā€™s my case and during my researches Iā€™ve found that about Xiaomi Gateway and Domoticz :

If you experience problems and are connecting your Domoticz server through a LAN cable, try connecting Domoticz through WiFi instead.

Donā€™t know if it could be the reason of our issue but there is nothing else to test actually :frowning:

I have OH running on an Ubuntu Server VM, so yes a wired connection.

It seems some have had issues with certain models of wireless routers. I have a Unifi AP, which someone over on the Home Assistant community says works for them. None the less, I tried connecting my gateway to an old WRT54g running dd-wrt and got the same result. Iā€™ve also seen it mentioned that the wireless security might cause issues I tried wpa2-tkip, wpa2-aes, and wpa2-tkip+aes with no change.

I have an install of Home Assistant that I was testing some time ago. I fired it up and added the xiaomi component and got nothing but an ā€œinvalid configā€ which makes me think itā€™s a problem with the gateway. Or, I guess, me and HAā€™s screwy yaml config file.