I have ordered a CC2531 usb stick and want to add several Xiaomi sensors. Maybe later I am going to order some tradfri, osram or other devices. I want to integrate all of these zigbee devices to OH.
As far as I understood there are two possibilities after flashing the stick with the right firmware:
use the OH zigbee binding
use zigbee2mqtt
All of the mentioned devices should work with both variants. So, what ist the benifit of zigbee2mqtt?
This should also be the case for most ZigBee devices. The binding is designed to automatically detect the channels a device provides, and to add them. “Support” is only required if the device doesn’t report its services correctly.
Thanks @chris for the info on the zigbee binding. I’m more a DIY person, and like knowing/seeing all the in’s and out, hence the reason for choosing zigbee2mqtt route.
For zigbee2mqtt you will need to use mqtt and most likely a transformation. The rule option is completely up to you and how you plan to use the devices.
Here’s a zigbee2mqtt item example:
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)]" }
This is one, of about 7 mqtt items, that I haven’t converted to the new 2.4 mqtt version but I have plan to do so in the near future. I’ve already found and bookmarked a topic that provides a good example.
Notice at the end of the Switch item I’m using the expire binding to automatically turn the light off after 2 hours so no rules need for this device to do what I need.
The great thing about OH is the flexibility to work and do whatever your home automation needs may be. Use a rule, the expire binding, zigbee2mqtt, the zigbee binding or a little of both.
Best of luck and hope you find what works best for you.