Zigbee-Binding + Qivicon USB Stick + Xiaomi Aqara Devices... no successful discovery?

I am trying to use the Zigbee binding to connect Xiaomi Aqara Switches to OH using a Qivicon (Telegesis?) USB Stick. But I just cannot get it to work. What I did so far (Raspberry Pi 3 + Raspbian + OH install via apt):

  1. Installed the Zigbee Binding via PaperUI
  2. Plugged in the USB Stick
  3. Added the OH User to linux dialout/tty group
  4. Found the USB stick via thing discovery (it is shown as online)
  5. Tried to discover the Xiaomi switches via thing discovery (by resetting the switches and pressing the button every few seconds)

Nothing pops up in the inbox. I also don’t see any messages in the debug log of the binding:

10:04:56.149 [DEBUG] [org.openhab.binding.zigbee           ] - BundleEvent [unknown:512] - org.openhab.binding.zigbee
10:04:56.243 [DEBUG] [org.openhab.binding.zigbee           ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=132, service.bundleid=228, service.scope=bundle, component.name=org.openhab.binding.zigbee.discovery.ZigBeeDiscoveryService, component.id=29} - org.openhab.binding.zigbee
10:04:56.254 [DEBUG] [org.openhab.binding.zigbee           ] - BundleEvent STARTING - org.openhab.binding.zigbee
10:04:56.261 [DEBUG] [org.openhab.binding.zigbee           ] - BundleEvent STARTED - org.openhab.binding.zigbee
10:04:56.275 [DEBUG] [gbee.discovery.ZigBeeDiscoveryService] - Starting ZigBeeDiscoveryService
10:04:56.324 [DEBUG] [org.openhab.binding.zigbee           ] - ServiceEvent REGISTERED - {org.openhab.binding.zigbee.internal.converter.ZigBeeChannelConverterFactory}={service.id=133, service.bundleid=228, service.scope=bundle, component.name=org.openhab.binding.zigbee.internal.converter.ZigBeeChannelConverterFactory, component.id=30} - org.openhab.binding.zigbee
10:04:56.527 [DEBUG] [org.openhab.binding.zigbee           ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=134, service.bundleid=228, service.scope=bundle, component.name=org.openhab.binding.zigbee.internal.ZigBeeHandlerFactory, component.id=31} - org.openhab.binding.zigbee
10:04:56.556 [DEBUG] [org.openhab.binding.zigbee           ] - ServiceEvent REGISTERED - {org.openhab.binding.zigbee.discovery.ZigBeeDiscoveryParticipant}={service.id=135, service.bundleid=228, service.scope=bundle, component.name=org.openhab.binding.zigbee.dis                               covery.internal.ZigBeeDefaultDiscoveryParticipant, component.id=32} - org.openhab.binding.zigbee
10:04:56.579 [DEBUG] [org.openhab.binding.zigbee           ] - ServiceEvent REGISTERED - {org.openhab.binding.zigbee.converter.ZigBeeChannelConverterProvider}={service.id=136, service.bundleid=228, service.scope=bundle, component.name=org.openhab.binding.zigbee                               .internal.converter.ZigBeeDefaultChannelConverterProvider, component.id=33} - org.openhab.binding.zigbee
10:04:56.655 [DEBUG] [org.openhab.binding.zigbee.cc2531    ] - BundleEvent [unknown:512] - org.openhab.binding.zigbee.cc2531
10:04:56.674 [DEBUG] [org.openhab.binding.zigbee.cc2531    ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=137, service.bundleid=229, service.scope=bundle, component.name=org.openhab.binding.zigbee.cc2531.internal.CC2531HandlerFactory, component.id=34} - org.openhab.binding.zigbee.cc2531
10:04:56.682 [DEBUG] [org.openhab.binding.zigbee.cc2531    ] - BundleEvent STARTING - org.openhab.binding.zigbee.cc2531
10:04:56.689 [DEBUG] [org.openhab.binding.zigbee.cc2531    ] - BundleEvent STARTED - org.openhab.binding.zigbee.cc2531
10:04:56.705 [DEBUG] [org.openhab.binding.zigbee.ember     ] - BundleEvent [unknown:512] - org.openhab.binding.zigbee.ember
10:04:56.732 [DEBUG] [org.openhab.binding.zigbee.ember     ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.usbserial.UsbSerialDiscoveryParticipant}={service.id=138, service.bundleid=230, service.scope=bundle, component.name=org.openhab.binding.zigbee.ember.internal.discovery.ZigBeeEmberUsbSerialDiscoveryParticipant, component.id=35} - org.openhab.binding.zigbee.ember
10:04:56.739 [DEBUG] [org.openhab.binding.zigbee.ember     ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=139, service.bundleid=230, service.scope=bundle, component.name=org.openhab.binding.zigbee.ember.                               internal.EmberHandlerFactory, component.id=36} - org.openhab.binding.zigbee.ember
10:04:56.748 [DEBUG] [org.openhab.binding.zigbee.ember     ] - BundleEvent STARTING - org.openhab.binding.zigbee.ember
10:04:56.754 [DEBUG] [org.openhab.binding.zigbee.ember     ] - BundleEvent STARTED - org.openhab.binding.zigbee.ember
10:04:56.771 [DEBUG] [org.openhab.binding.zigbee.telegesis ] - BundleEvent [unknown:512] - org.openhab.binding.zigbee.telegesis
10:04:56.798 [DEBUG] [org.openhab.binding.zigbee.telegesis ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=140, service.bundleid=231, service.scope=bundle, component.name=org.openhab.binding.zigbee.telege                               sis.internal.TelegesisHandlerFactory, component.id=37} - org.openhab.binding.zigbee.telegesis
10:04:56.805 [DEBUG] [org.openhab.binding.zigbee.telegesis ] - BundleEvent STARTING - org.openhab.binding.zigbee.telegesis
10:04:56.811 [DEBUG] [org.openhab.binding.zigbee.telegesis ] - BundleEvent STARTED - org.openhab.binding.zigbee.telegesis
10:04:56.829 [DEBUG] [org.openhab.binding.zigbee.telegesis ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.usbserial.UsbSerialDiscoveryParticipant}={service.id=141, service.bundleid=231, service.scope=bundle, component.name=org.openhab.bin                               ding.zigbee.telegesis.internal.discovery.ZigBeeTelegesisUsbSerialDiscoveryParticipant, component.id=38} - org.openhab.binding.zigbee.telegesis
10:04:56.834 [DEBUG] [org.openhab.binding.zigbee.xbee      ] - BundleEvent [unknown:512] - org.openhab.binding.zigbee.xbee
10:04:56.850 [DEBUG] [org.openhab.binding.zigbee.xbee      ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=142, service.bundleid=232, service.scope=bundle, component.name=org.openhab.binding.zigbee.xbee.i                               nternal.XBeeHandlerFactory, component.id=39} - org.openhab.binding.zigbee.xbee
10:04:56.857 [DEBUG] [org.openhab.binding.zigbee.xbee      ] - BundleEvent STARTING - org.openhab.binding.zigbee.xbee
10:04:56.863 [DEBUG] [org.openhab.binding.zigbee.xbee      ] - BundleEvent STARTED - org.openhab.binding.zigbee.xbee
10:05:49.058 [DEBUG] [org.openhab.binding.zigbee.telegesis ] - ServiceEvent REGISTERED - {org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler}={service.id=326, service.bundleid=231, service.scope=singleton} - org.openhab.binding.zigbee.telegesis
10:05:49.079 [DEBUG] [org.openhab.binding.zigbee.telegesis ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.firmware.FirmwareUpdateHandler}={service.id=327, service.bundleid=231, service.scope=singleton} - org.openhab.binding.zigbee.teleg![qivicon1|470x500](upload://dkBpParrCAX5VbW52rK1hQN60Xz.png) ![qivicon2|607x500](upload://7H0Y8uPW4tTEuiAEyIz4ESAKCOp.png) esis
10:05:49.128 [DEBUG] [ee.telegesis.handler.TelegesisHandler] - Initializing ZigBee Telegesis serial bridge handler.
10:05:49.136 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Initializing ZigBee network [zigbee:coordinator_telegesis:0000033B].
10:05:49.146 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Channel 19
10:05:49.152 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - PANID 1xxxx
10:05:49.157 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - EPANID 492xxxxxxxxxxx
10:05:49.168 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Network Key 75E73E9CE9CB6A255xxxxxxxxxxxx
10:05:49.173 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Link Key 5A6967426565416C6Cxxxxxxxxxxxxx
10:05:49.179 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Config: zigbee_initialise found, initializeNetwork=false
10:05:49.185 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Network Key String 75E73E9CE9CB6A255xxxxxxxxxxxx
10:05:49.195 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Network key final array 75E73E9CE9CB6A255xxxxxxxxxxxx
10:05:49.201 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Link Key String 5A6967426565416Cxxxxxxxxxxxxx
10:05:49.210 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Link key final array 5A6967426565416Cxxxxxxxxxxxxx
10:05:49.268 [DEBUG] [ee.telegesis.handler.TelegesisHandler] - ZigBee Telegesis Coordinator opening Port:'/dev/ttyUSB0' PAN:324a, EPAN:4924DF6xxxxxxxx, Channel:19
10:05:49.291 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Scheduling ZigBee start
10:05:50.814 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - ZigBee network starting
10:05:50.830 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Initialising ZigBee coordinator
10:05:51.185 [DEBUG] [rnal.ZigBeeNetworkStateSerializerImpl] - Loading ZigBee network state: Start.
10:05:51.299 [DEBUG] [rnal.ZigBeeNetworkStateSerializerImpl] - Loading ZigBee network state: Done.
10:05:51.306 [DEBUG] [nding.zigbee.handler.ZigBeeSerialPort] - Connecting to serial port [/dev/ttyUSB0] at 19200 baud, flow control FLOWCONTROL_OUT_NONE.
10:05:51.334 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - null: networkStateUpdated called with state=UNINITIALISED
10:05:51.469 [DEBUG] [nding.zigbee.handler.ZigBeeSerialPort] - Serial port [/dev/ttyUSB0] is initialized.
10:05:53.454 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - ZigBee Initialise: Previous device configuration was: channel=null, PanID=0, EPanId=null
10:05:53.456 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - null: networkStateUpdated called with state=INITIALISING
10:05:53.463 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - Config: zigbee_trustcentremode=TC_JOIN_INSECURE
10:05:54.387 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - ZigBee Initialise done. channel=CHANNEL_19, PanId=12874  EPanId=4924DF6xxxxxxxxx
10:05:54.474 [DEBUG] [gbee.handler.ZigBeeCoordinatorHandler] - 000D6F000xxxxxx: networkStateUpdated called with state=ONLINE
10:05:54.987 [DEBUG] [rnal.ZigBeeNetworkStateSerializerImpl] - Saving ZigBee network state: Start.
10:05:55.218 [DEBUG] [rnal.ZigBeeNetworkStateSerializerImpl] - Saving ZigBee network state: Done.
10:05:55.836 [DEBUG] [rnal.ZigBeeNetworkStateSerializerImpl] - Saving ZigBee network state: Start.
10:05:55.862 [DEBUG] [rnal.ZigBeeNetworkStateSerializerImpl] - Saving ZigBee network state: Done.
10:06:18.147 [DEBUG] [gbee.discovery.ZigBeeDiscoveryService] - Starting ZigBee scan for zigbee:coordinator_telegesis:0000033B
10:07:21.008 [DEBUG] [gbee.discovery.ZigBeeDiscoveryService] - Starting ZigBee scan for zigbee:coordinator_telegesis:0000033B

I also added two screenshots from the configured USB stick in PaperUI if that helps. Since the switches are mentioned in the Zigbee binding documentation as compatible I am not sure what I am doing wrong here. Please help :slight_smile:

Second pic:

Ping. Anyone?
@all who have successful paired Xiaomi devices: which controller are you using?

I use the Conbee II with the Deconz img on a separate pi.]
I use nodered to act as a listener and convert some events to mqtt and others as direct automatons. I only have Xiaomi sensors so cannot compare to any other brand.

Works very well and very quickly (faster than my zwave sensors)… I have just ordered a load of flood sensors (xiaomi) to use… (dont ask)

I will be buying more xiaomi motion sensors and door / window sensors they are simply tiny and fast.

There are lots who use the Conbee with Openhab, I just choose to do everything separately

It is known that Xiaomi sensor are a bit tricky to pair. For pairing they quickly go into sleep mode and thus you must keep them upwake. I don’t have any Xiaomi Zigbee devices, but they are many solutions here on the forum. The following applies for zigbee2mqtt and probably the same for the zigbee binding for the pairing process:

Press and hold the reset button on the device for ± 5 seconds

I already searched most of those threads but I haven’t been successful yet. I would really like to use the OH Zigbee binding directly without having to use zigbee2mqtt as gateway in between if possible. Also, I haven’t found any information about if zigbee2mqtt supporting the Qivicon stick. It is always refered to the CC2531.
What puzzles me is that nothing shows up in my log. Even if the Xiaomi Switch go into sleep mode quickly there should be at least some readings, right?

Yep zigbee2mqtt only works with the CC253X sticks. I also use the Qivicon with the OH Zigbee binding from chris.
For debugging set the logging to

log:set debug org.openhab.binding.zigbee
log:set debug com.zsmartsystems.zigbee
log:set info com.zsmartsystems.zigbee.dongle.ember.internal.ash

and the use https://www.cd-jackson.com/index.php/openhab/zigbee-log-viewer for further investigation of the logs

During my log/pairing test suddenly an unknown zigbee device showed up in the Inbox! So maybe I really was not patient enough…
I added it and it now shows up as online. Unfortunately, there are no channels available. Is this normal behaviour?
I also saved all debug logs and tried to use Chris’ log viewer for further investigation but I am not skilled enough to read it

There is an issue that I’ve just noticed (or realised) recently. Due to the way the binding works, the discovery is in two parts - the initial discovery, and the channel discovery. The device also needs to be awake when the channel discovery occurs - this will happen when the thing is added from the inbox - or when the binding starts.

Try waking up the device during this phase.

Thanks for the reply… since it’s already difficult to wake up Xiaomi devices could you explain exactly the time where I need to do it? Because first it’s shows up in the Inbox (sometimes), then I add it, then the thing is still in the state “Node has not completed discovery”
and THEN after some time (1-5min) it shows as online (screenshot in my last post). And I really cannot push the button for 5min straight :wink:

When you add the device from the inbox as a thing - there is a button that you press in the inbox to do this. Or, if you’ve already done this, it’s probably easiest to remove it and add it back in.

Note that I’m not sure why you keep hiding the MAC address of your device - it’s of no use to anyone and is in no way related to security if that’s what you’re thinking. It’s just a unique identifier.

Thanks for the clarification. I am not familiar with the zigbee protocol and I usually just remove any identifier before posting unique IDs. :wink:

I tried that several times now but the result is always the same. First, the think shows up in the inbox, after adding it, it shows as offline and later as online without channels.
Just to make sure: is it enough for the device to “be awake” if I press a button? Or do I have to put the device in pairing mode again (long-press both buttons for 10s)

This will make it impossible for you to post any logs.

At this point, I would normally suggest to post logs, but…

It will depend on the device.

No - don’t do this - this will reset the device and you will have to start again.

That’s why I wrote “usually”. If it’s not necessary here I won’t do it for those logs, of course.

Ok but I don’t have much choice - the device really has just two buttons, no reset button, etc
(https://www.aqara.com/us/wireless_remote_switch.html). So I guess pressing one of those buttons is the only thing I can do if I don’t wan’t to reset it/enable pairing mode.

I removed the thing again, cleared the log, enabled debug logs and re-paired it (until it showed up as “online”). Find the log attached. openhab_debug.log (437.2 KB)

Also thank you very much for helping me!

Did the debug log help? Any ideas?

FWIW, now the docs contain an extra paragraph about known issues with Xiaomi devices which can be found here:

In particular, there is a lot of information under this link:

Unfortunately, none of these tips have worked for me so far …

1 Like

I have been testing with a number of coordinators, and the Qivicon/Telegesis never worked for me.

The Telegesis stick was implemented for Deutsche Telekom - it works well, but you need to remember that it is old. It is not a Zigbee 3 coordinator, and may therefore not work with a large number of devices out there now…