[SOLVED] Xiaomi Mi Smart Home Binding - gateway problem

I try to run my new xiaomi grateway and aqara door sensor but after 2 hours of fighting I think it is just too much for me. Can anyone help me with this one? I have no idea what is wrong. What I have done so far:

  1. on my mi home mobile app I added gateway and sensor. I enabled communication and got password.
  2. I installed Xiaomi Mi Smart Home Binding on my OH2
  3. Xiaomi Gateway has been found so I added it. As soon as I added it 1 more thing has been found - Xiaomi Mi Smart Home Gateway (I don’t know why 2 devices are found)
  4. I updated Xiaomi Gateway and typed password from developer mode in mobile app.
  5. Thing is added in Control pane but any sliders etc wont affect on a gateway - I am not able to change light for instance.

My goal is to add door sensor which is visible and it is working fine in mobile app but OH2 doesn’t see it - through binging, none things has been found.
I checked logs and there are some exceptions

2018-12-08 20:55:23.709 [ERROR] [org.openhab.binding.mihome ] - FrameworkEvent ERROR - org.openhab.binding.mihome
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.mihome [206]
Another singleton bundle selected: osgi.identity; type=“osgi.bundle”; version:Version=“”; osgi.identity=“org.openhab.binding.mihome”; singleton:=“true”
at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]
2018-12-08 20:55:24.060 [ERROR] [discovery.XiaomiItemDiscoveryService] - Unknown discovered model: sensor_magnet.aq2
2018-12-08 20:55:28.752 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Connecting to serial port ‘/dev/ttyACM0’
2018-12-08 20:55:28.780 [INFO ] [ing.zwave.handler.ZWaveSerialHandler] - Serial port is initialized
2018-12-08 20:55:28.798 [INFO ] [mmandclass.ZWaveSecurityCommandClass] - Update networkKey
2018-12-08 20:55:28.836 [INFO ] [ve.internal.protocol.ZWaveController] - Starting ZWave controller
2018-12-08 20:55:28.839 [INFO ] [ve.internal.protocol.ZWaveController] - ZWave timeout is set to 5000ms. Soft reset is false.
2018-12-08 20:55:32.136 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 1: Node found
2018-12-08 20:55:32.140 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 2: Node found
2018-12-08 20:55:32.142 [INFO ] [age.SerialApiGetInitDataMessageClass] - NODE 3: Node found
2018-12-08 20:55:32.145 [INFO ] [age.SerialApiGetInitDataMessageClass] - ZWave Controller using Controller API
2018-12-08 20:55:32.147 [INFO ] [age.SerialApiGetInitDataMessageClass] - ZWave Controller is Primary Controller
2018-12-08 20:55:32.150 [INFO ] [age.SerialApiGetInitDataMessageClass] - ------------Number of Nodes Found Registered to ZWave Controller------------
2018-12-08 20:55:32.152 [INFO ] [age.SerialApiGetInitDataMessageClass] - # Nodes = 3
2018-12-08 20:55:32.154 [INFO ] [age.SerialApiGetInitDataMessageClass] - ----------------------------------------------------------------------------

Does anyone know what is going on and what I am doing wrong here?

You haven’t mentioned putting the app into developer mode, getting the developer key and configuring the gateway with the developer key.

If you haven’t done these you can’t control the devices, just detect them.

Here is the link to the documentation, how to do it is included in the setup instructions

I have done it, I followed instruction from that link.

Check via Karaf (bundle:list) if you have more than one binding installed. Remove the unwanted. Clear the cache.

Please have a look here:

If might be that you bricked your gateway by doing the update (at least bricked when it comes to OH control)

With respect to two instances of the gateway: The first gateway you see is the bridge (used to communicate with all attached devices), the second one is the gateway as thing (with all its controllable stuff like light and sound)

I cleared the cache,I checked I have only 1 Xiaomi Mi Smart Home Binding. I tried to reinstall it but in PaperUI when I clicked uninstall, status of this binding has changed to “removing” or something and it was like that for ever. I restarted OH2 by console command. Now I have this binding listed on my binding list but on a page where you can install bindings it is listed as “Install” so it is not installed. what the heck?
@bartsnijder what do you mean bricked? Can you shed more light on this? It is working fine in Xiaomi app, I can operate it, it even shows status of my door sensor. My definition of “brick” is that device is dead. Connection between OH-gateway is software, not hardware so it cannot be bricked - at least not permanently.

Any ideas?

That’s what the remark said, it’s dead with respect to OH communication. It seems that all gateway devices that have text on the back in a circle shape do not with with oh anymore when on latest fw
Operation with xiaomi app is always fine

I was able to make it running. There was a problem with binding. @sihui comment helped me - I checked and there was another instance of binding. I uninstalled the binding but it was not completely uninstalled. And this made me thinking and checking everything. It occurred that I had .jar in addons folder. I removed it, installed binding again and door sensor was discovered.
I have no idea how to build a nice dashboard and rules for instance “trigger alarm (blink light and play sound) if door sensor is open when it is night (I press a button or something to activate night)”. This is my next step and knowing OH2 I know that I will have a epic campaign with it, it is not user friendly at all.

Thanks everyone for help!

1 Like