Does openHAB work with zigbee2mqtt sniffers

I want to know whether or not, openHAB works with zigbe2mqtt sniffers. (Is it possible to connect these devices to openHAB? So that the traffic can be captured in openHAB)

Yes, I recently started using zigbee2mqtt with a cc2531 stick and seems to work good.

1 Like

Can you teach me how should I go about implementing it ? (Can you provide me with some tutorials or resources, videos, etc)

Will you be using the same CC2531 Stick?

I haven’t bought it yet. But yes, I will use CC2531.

Here’s a guide for setup and use.

Start with click on “Getting Started”:grinning:

I have already read the document. But it is not mentioned how can I connect these sniffers to openHAB. Is there an special binding for this in openHAB?

Once the USB stick has been flashed and the bridge up and running, then reset your devices and the USB stick will detect them. Now on OH, install the MQTT addon binding and configure your item to communicate via mqtt. Also, be sure to check what devices are supported so you know up front what will work.

FYI My USB stick and bridge is installed on a separate RPI (not the RPI I am running OH on) but from what I have read it will work on the same machine as your OH.

Here’s an example of an item. Note the long description name can be changed, something I may do in the future.

Switch MyLight "My Light"    <light> ["Lighting"] { mqtt=">[pibroker:zigbee/0xb0ce1814030ac279/set:command:*:JS(setZigbeeState.js)],<[pibroker:zigbee/0xb0ce1814030ac279:state:JSONPATH($.state)]", expire="120m,command=OFF" }
Dimmer MyLight_Level "My Light Level"    <light> ["Lighting"] { mqtt=">[pibroker:zigbee/0xb0ce1814030ac279/set:command:*:JS(setZigbeeBrightness.js)],<[pibroker:zigbee/0xb0ce1814030ac279:state:JS(getZigbeeBrightness.js)]" }

My approach is totally different. What I want to do is that I want to connect these sniffers directly to openHAB. I don’t want to use MQTT binding in between. I want openHAB application to recognize these sniffers directly, so that I can use openHAB’s various bindings. Is this approach possible ?

Zigbee2mqtt is a way to communicate with OH without the need of a separate hub or hubs. OH will not recognize the devices automatically, that’s were the bridge install comes into play. The bridge and USB stick does all device detection. From here you will have to use mqtt to send and receive info from OH to the bridge. The bridge then relays the info via the USB stick to end device.

Using Zigbee2mqtt does not limit you from using other bindings. Think of it as a way to control devices that are not supported by an OH binding. The item above is a Sengled light bulb, there is no binding for direct control of this bulb. I could buy a hub and install the supported binding but really that’s only doing the same thing as Zigbee2mqtt, acting as a bridge.

There’s basically two ways to use the CC2531 with openhab:

  1. Dongle => zigbee2mqtt => mqtt broker => mqtt-binding => openhab
  2. Dongle => zigbee-binding => openhab

The 2nd one sounds like what you’re asking for, but note that it doesn’t involve mqtt at all, which I think is the source of confusion here. Unfortunately you can’t assume that all zigbee2mqtt-compatible devices will work with zigbee-binding, but the compatibility’s pretty good and there’s no harm in giving it a try.

Either way you’re limited to 1 binding per hub/bridge*, and the CC2531 counts, so anything you connect through it will share the same binding (either mqtt-binding or zigbee-binding).

*Not strictly true, as some bridges do allow multiple connections.