Xiaomi Gateway 3 binding (ZNDMWG03LM)


I have been using the Xiaomi Mi IO binding for a while now and I love it. I also had Dexter’s binding working, but since moving to 3.2 this is not working anymore as it’s only compiled for 3.1.

The Xiaomi Mi IO binding detects all my devices, but there’s no token (not a problem as I can get that), but more importantly, there’s no ip address. This is because they are linked to my new Xiaomi gateway 3. Is there anyway I can get these to work?

For some others I do have an ip address, but the token is wrong (ab1bffb355b721ac02160cfd). When I replace it with the one I have got using ibackup, it still says it’s wrong (91254407cce963577825093a0cd837e63770482038666e1c250e57508bb0f975).

Any help or pointers would be greatily appreciated :wink:



Can you please check the error message in logs?
I’ve just upgraded my installation to 3.2M2 and didn’t have to replace the binding - everything works as it was before.
Just in case - I’ve compiled it once again - binaries are here

I’ve also added support for Xiaomi Motion Sensor RTCGQ01LM.

Still trying to figure out how to merge my binding with miio. Takes much more time than I expected, so I will be adding new devices by request to my binding.

1 Like

I didn’t get any errors as the inbox items where created.

They just show up without token or IP address or like this.

Sorry, I meant this part of the issue.

Secondly, please describe what devices you have, which are found/working and what is not working as you expect.

Is this the screenshot of the gateway or a connected device to the gateway? In either case they should have a different type like ‘Xiaomi Mi Gateway Device’ or ‘Xiaomi Mi Lumi Gateway subdevice’ if you are using the latest binding from marcel_verpaalen

Also please try to REPLACE the binding with this one.
I have added a direct request to the gateway to receive all connected devices. It will show up in the logs like this after the binding installation:

2021-09-24 09:53:19.707 [INFO ] [internal.handler.MiIoAbstractHandler] - Found devices count: 5
2021-09-24 09:53:19.709 [INFO ] [internal.handler.MiIoAbstractHandler] - Devices: {"code":0,"result":[{"did":"lumi.158d00015a9347","model":"lumi.sensor_magnet.v2","num":1,"total":5},{"did":"lumi.158d0001df4c87","model":"lumi.sensor_motion.aq2","num":2,"total":5},{"did":"lumi.158d000288ce59","model":"lumi.sensor_magnet.v2","num":3,"total":5},{"did":"lumi.158d000288cee1","model":"lumi.sensor_magnet.v2","num":4,"total":5},{"did":"lumi.158d00028a13c4","model":"lumi.sensor_magnet.v2","num":5,"total":5}],"id":3607}

It will show what Zigbee devices the gateway is aware of.

openhab.log (64.7 KB)
Thanks mate.
Here’s the log, I will have a look at the devices list tomorrow, but this a screenshot of my inbox:

Some of them are duplicates, and I was able to get one version of them working, others are just showing up once i.e. light sensor and they show up like the example above or without ip and token.

Is your openhab version 3.2.0M1?
I can see in the logs that it still tries to load org.openhab.binding.miio-2.5.4-SNAPSHOT.jar for some reason. Please check your addons folder if you have a copy of this file there. I can’t see any mentions of xiaomigatewayv3 binding.

Try to follow this post if you would like to try miio binding with new supported features.
All your connected to the gateway sensors should be miio:lumi: type, not a generic as far as I know.

The last screenshot is from mihome binding.

xiaomigatewayv3, miio and mihome are three separate bindings, they are not connected to each other.
As miio works fine and already have a cloud integration, I am looking into merging xiaomigatewayv3 into miio. So, as for now I can try to answer questions related to this topic. Unfortunately I have no knowledge of mihome binding.

I’ve added AutoDiscovery of the connected to the Gateway Zigbee devices to the miio binding. Download here.

If anyone is using marcel’s updated version of binding (from miio-lumiGatewayDevicesv3 branch)- please replace it with beta2 version as it should find all connected devices automatically.

1 Like

Thanks for looking into this. I will play around with the different bindings this weekend and come back.

For now, I have uninstalled the binding in the UI (forgot about that), and deleted all the things.
Rebooted and added the bridge for the new things. I have some things were I can’t select a bridge, and others where the information is in the wrong format:

I have uploaded my log again where it shows which ones where added and which ones where skipped.
openhab.log (95.1 KB)


So I have got the supported products working with the Miio bridge, I am getting this error for the xiaomigateway binding

2021-09-26 10:43:47.933 [ERROR] [Events.Framework ] - FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.xiaomigatewayv3 [317]
Unresolved requirement: Import-Package: org.openhab.core.io.transport.mqtt

at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1845) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1838) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1743) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1665) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) [org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345) [org.eclipse.osgi-3.16.200.jar:?]

Do you have MQTT binding installed? If no - try to install it from UI->Settings->Bindings.

From your logs I can see that you have 5 devices connected to the gateway:
lumi.sensor_magnet.v2 (id: lumi.158d000244eb0f) - Aqara Motion Sensor RTCGQ11LM
lumi.sensor_magnet.v2 (id: lumi.158d000244eff7)
lumi.sensor_magnet.v2 (id: lumi.158d0002455e45)
lumi.sen_ill.mgl01 (id: 255583899) - Xiaomi, Light Sensor, GZCGQ01LM
lumi.sen_ill.mgl01 (id: 255583899)

Is this correct?

Hi, totally forgot.
So I have installed the MQTT binding and now I was able to see the binding and scan. I was able to add the things but they don’t post any status.

Let me know if you need anything else besides the log file.

Pimopenhab Xiaomi.log (30.1 KB)

Everything seems file.
MiIo binding doesn’t send any updates via the direct connection now, but xiaomigatewayv3 should work with the Aqara Motion Sensor (RTCGQ11LM).
Motion sensor sends only event when it happened (so the state of the channel will be opened all the time). You need to add Metadata Expire with the ‘update state’ set to ‘CLOSED’ after a delay that you choose. Then you will see when a motion happened by receiving ‘OPEN’ state.


I have done this, but nothing happens. So strange as the log works.