Zigbee binding

Yes theoretically, it can.

Supports forming simple centralized security networks as Coordinator and Trust Center
http://www.ubisys.de/downloads/ubisys-s2-technical-reference.pdf

Edit: Just asked Ubisys support what they think about my scenario, will report back what they think.

Interesting - how do you set the keys?

Just another point - whatever device you use as the coordinator won’t change your problem. You will still need to configure bindings between the two devices somehow. The coordinator doesn’t really do a lot in a ZigBee network in this respect.

Could you post some experiences / instructions on how you got it working? I find it very interesting to have a combined zigbee/z-wave dongle and be able to use it.

As I understand, this device simply provides two com ports so you can use the zwave and zigbee as if it were two sticks. The Zigbee dongle supports the Ember NCP, so you need to use the Ember coordinator bridge.

There’s really not much to setup. A 4.x kernel will include the drivers needed, or download the drivers for Windows (https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers). Find your serial port. Mine came up with Zigbee on ttyUSB1 (COM4 in Windows), Zwave on ttyUSB0 (COM3 in Windows). In the OH ZB binding, chose the Ember coordinator and be sure to set the baud rate to 57600. My Centralite outlet is very consistent in coming online. The GE Link Bulbs seem to take a while. Sometimes they need a power cycle to get them online. You might find some helpful device specific information (like using the Aeon Backup Tool software to restore a zstick to the HUSBZB-1) in this thread::

That is pretty much what Ubisys replied. The Ubisys and Hue devices will still communicate even without a coordinator. To keep functionality, bindings need to be configured. The Ubisys hub does this. From your answer I figure that Openhab does not?

No - it’s not something I’ve currently added. Most of the code is implemented to do it, but it’s not currently possible…

Ok that’s good enough for me. So zigbee could do what I want, and I`m not buying into the wrong technology. I can first see how well it works as is. At least there is a path to the required functionality, should I need it.

And thanks for this binding. It relieves a great weakness of most zigbee offerings - cross compatibility. The ubisys S2 component is essential to my setup, openhab is the most flexible way to control it. I am planning to use it together with a hue color lamp, hue lightstrips, lightify plug, and the hue motion sensor (hope you get this working).

Did anyony try if the binding works with the XBee series 2?

https://www.digi.com/products/xbee-rf-solutions/2-4-ghz-modules/xbee-zigbee#specifications

They seam to have an Silicon Labs EM357 SoC chip which should be compatible, but there are many variations and also programmable boards.

Does anyone have experience with those boards?

The Ember chips can be reprogrammed to do whatever the user wants so unless it offers the standard Ember firmware (which I doubt) I would be careful saying it “should” be compatible. My guess is that they have implemented their own firmware as the data sheet states it uses AT mode (which is NOT part of the Ember firmware).

Of course, I’m not sure, but I just remind anyone to be careful as I suspect this is not using standard Ember firmware.

Hi @Chris,
back from holidays, I’ve started on using the zigbee binding again…
I’m currently on 2.1.0:

212 | Active   |  80 | 2.1.0                  | ZigBee Binding

Of course I have some topics to share and/or to ask: :wink:

Osram bulb colortemp range:
This isn’t an issue anymore. I’ve updated the Osram bulbs/strips to R.01020413 and the “Surface” ceiling lamps to R.01020412. Done so, all devices now react on 0 til 100 percent colortemp. So this is “fixed”.

Status update/status gathering of zigbee nodes?
Is there something new worth to check out? Since I’m on the release 2.1.0 currently, should I move to snapshot?

“bundle:restart” crashes openHAB
When I modify a zigbee thing, this thing is getting considered “offline” afterwards - although beeing still reachable/controllable via openHAB. To “fix” this wrong state, I do restart the binding via Karaf console. This crashes openHAB completely.

Zigbee routing table/neighbor table is empty
Neighbors and routes are shown in HABmin only on the coordinator (CC2531). All others show neither neighbors nor routes. Is this normal? Since all my zigbee nodes have logical type “router”, I’d expect, they should know their neighboring node and have routes as well.

@chris Just had a look at your Github repo. Great work! I just wonder where are the original source code for the JARs in “com.zsmartsystems.zigbee…”? I recognize some of the code from zigbee4java, but there seem to be differences.

They are all there. Go to my github repo - look at the organisations and click on zsmartsystems - or maybe just search for zsmartsystems in github. It’s certainly not hidden.

Yes - it is very different now to zigbee4java. The maintainer of that repo went AWOL for a few months late last year when I was doing a lot of development and while I could have merged my changes as I had admin rights, I didn’t feel comfortable as the API was heavily changed to make it more object oriented. I think my PRs are still open in zigbee4java but things moved too far without any response that there’s no way back now.

Feel free to contribute :slight_smile: .

Ah, thanks! I was looking under “cdjackson” on github, but didn’t think as far as to look for a “zsmartsystems” org :slight_smile:

I am still figuring out the CC2531 device and ZLL/ZHA protocols and I wrote a Python interface to control Trådfri bulbs and started looking at Xiaomi Mi sensors just to learn how it works, but then I found your code a much nicer starting point for experimenting now that I understand the basics of the ZNP stack.

@chris Does the Zigbee binding (Linear HUSBZB-1) work with any of these?

  • Ikea tradfri motion sensor - $24.99
  • Iris motion sensor - $24.99
  • SmartThings motion sensor - $39.99

Found an old post for the IRIS sensor.

@chris I don’t know if you received my messages. Can you provide the firmware for the EM358 USB Stick somewhere?

Dear Chris

Thank you for the continuing to update the zigbee binding much appreciated.

I have downloaded your latest release (1/Sept/2017) and imported it into my development environment. It is quite obvious that you have made significant enhancements from the initial release and it is now much quicker to discover the dongle and zigbee devices. (So by the way I have solved my dongle reset problem mentioned to you a few months ago – needed to undock and dock the dongle every time I start openhab – by using a 1k5 pull up resistor attached to 3.3V and D+ at the dongle.)

The previous version successfully discovered all my develco devices

  1. Motion Sensor – MOSZB-130 (occupation, temperature, motion)
  2. Smart Relay 30A – ZSMR-101
  3. Smart Plug – ZHWR-202.

However the latest version discovers devices 1 and 2 above but do not discover the ZHWR202. Using the Paper UI and looking at the properties of the dongle after a few minutes of operation, I noticed that the ZHWR202 devices are present in the zigbee_neighbors table. Still they never appear in the inbox, even if I reset them to factory mode, and allow them to rejoin the network.

To discover what is happening with communication to these devices I enabled com.zsmartsystems.zigbee logging and analyzed the log.

The ZHWR202 responds as follows:
• TX CMD: IeeeAddressRequest [0/0 -> 49858/0, cluster=0001, TID=5D, nwkAddrOfInterest=49858, requestType=1, startIndex=0]
• RX CMD: IeeeAddressResponse [49858/0 -> 0/0, cluster=8001, TID=NULL, status=SUCCESS, ieeeAddrRemoteDev=0015BC001D0245AB, nwkAddrRemoteDev=49858, numAssocDev=0, startIndex=null, nwkAddrAssocDevList=[]]
• TX CMD: NodeDescriptorRequest [0/0 -> 49858/0, cluster=0002, TID=5E, nwkAddrOfInterest=49858]
• RX CMD: NodeDescriptorResponse [49858/0 -> 0/0, cluster=8002, TID=NULL, status=NOT_SUPPORTED, nwkAddrOfInterest=null, nodeDescriptor=null]
• (repetition removed)
• 49858: Discovery request NODE_DESCRIPTOR failed. Wait before retry.
• 49858: Ending node discovery

Thus it appears that the device does not successfully complete the discovery process and fails on the second ZDO node descriptor request.

I have analyzed the Technical manual for the ZHWR202 and it indicates the following with regards to ZigBee Device Object (ZDO)
• Application profile Id 0x0000
• Application device Id 0x0000
• Supports all mandatory clusters.

I have to assume that the device is working according to the ZIGBEE SPECIFICATION. Do you have any suggestions how we can make these devices work with your binding??

I can’t figure out how to add devices using your code. I must have missed something fundamental here. I even tried the command-line version (ZigBeeConsoleMain). I run it using the arguments CC2531 /dev/cu.usbmodem1421 230400 16 0 0 00000000000000000000000000000000 true and then use “join enable” to enable network inclusion, but I fail to include any devices. I tried the following devices:
IKEA Trådfri Remote
IKEA Trådfri E27 Bulb
Xiaomi Mi Temp/Pressure/Humidity sensor.

When using zigbee4java, device inclusion works (command line java -jar ./legacy-modules/zigbee-console-javase/target/zigbee-console-javase-3.1.0-SNAPSHOT.jar /dev/cu.usbmodem1421 16 0 true)

Output from zigbee4java:

ZigBee API permit join enable ... [OK]
> 23:00:45 189  INFO   Device announcement received - Network Address: #5919, IEEE Address: 00:15:8D:00:01:A3:66:62
Node added: 00:15:8D:00:01:A3:66:62 (#5919)
> 23:00:45 190  WARN   Created node object for #5919 (00:15:8D:00:01:A3:66:62) that was not available on the network
23:00:45 935  INFO   Device announcement received - Network Address: #5919, IEEE Address: 00:15:8D:00:01:A3:66:62
23:00:45 936  INFO   Device announcement received - Network Address: #5919, IEEE Address: 00:15:8D:00:01:A3:66:62
Device added: 00:15:8D:00:01:A3:66:62/1 (#5919)
Node discovered: 00:15:8D:00:01:A3:66:62 (#5919)
> 23:01:01 451  WARN   Unknown command ID: 0x45c9
23:01:04 384  INFO   Device announcement received - Network Address: #5919, IEEE Address: 00:15:8D:00:01:A3:66:62
23:01:04 384  INFO   Device announcement received - Network Address: #5919, IEEE Address: 00:15:8D:00:01:A3:66:62
23:01:04 830  INFO   Device announcement received - Network Address: #5919, IEEE Address: 00:15:8D:00:01:A3:66:62
> list
0) 00:15:8D:00:01:A3:66:62/1 [56765] : Thermostat

However, the Trådfri remote fails (I did not yet investigate why, and I am not that interested in getting zigbee4java running as I prefer to use with your code instead)

> 23:09:08 139  WARN   ZDO_NODE_DESC_REQ FAILED on #35312 (00:0B:57:FF:FE:23:75:85)
23:09:15 487  INFO   Device announcement received - Network Address: #56765, IEEE Address: 00:15:8D:00:01:A3:66:62
23:09:15 487  INFO   Device announcement received - Network Address: #56765, IEEE Address: 00:15:8D:00:01:A3:66:62
23:09:16 038  INFO   Device announcement received - Network Address: #56765, IEEE Address: 00:15:8D:00:01:A3:66:62
23:09:16 150  WARN   ZDO_POWER_DESC_REQ FAILED on #35312 (00:0B:57:FF:FE:23:75:85)
23:09:34 437  WARN   ZDO_ACTIVE_EP_REQ FAILED on #35312 (00:0B:57:FF:FE:23:75:85)
23:09:34 438  WARN   Node #35312 (00:0B:57:FF:FE:23:75:85) removed from network because no endpoints have been discovered

After including from zigbee4java, I seem to get ZigbeeConsoleMain to see the devices (if I don’t reset), e.g.

23:13:05.556  DEBUG  RX CMD: IeeeAddressResponse [2106/0 -> 0/0, cluster=8001, TID=NULL, status=UNKNOWN, ieeeAddrRemoteDev=null, nwkAddrRemoteDev=null, numAssocDev=null, startIndex=null, nwkAddrAssocDevList=[]]
23:13:12.027  DEBUG  <-- AF_INCOMING_MSG (FE 1C 44 81 00 00 02 04 3A 08 01 01 00 8D 00 67 82 00 00 00 08 18 0C 0A 00 00 29 18 0B 3A 08 1D 86)
23:13:12.027  DEBUG  Received Async Cmd: Packet: subsystem=null, length=28, apiId=44 81, data=FE 1C 44 81 00 00 02 04 3A 08 01 01 00 8D 00 67 82 00 00 00 08 18 0C 0A 00 00 29 18 0B 3A 08 1D 86, checksum=86, error=false
23:13:12.113  DEBUG  RX CMD: ReportAttributesCommand [Temperature measurement: 2106/1 -> 0/1, cluster=0402, TID=0C, reports=[Attribute Report: attributeDataType=SIGNED_16_BIT_INTEGER, attributeIdentifier=0, attributeValue=2840]]
23:13:12.113  DEBUG  <-- AF_INCOMING_MSG (FE 1C 44 81 00 00 05 04 3A 08 01 01 00 8D 00 74 82 00 00 00 08 18 0D 0A 00 00 21 8C 1E 3A 08 1D 1A)
23:13:12.114  DEBUG  Received Async Cmd: Packet: subsystem=null, length=28, apiId=44 81, data=FE 1C 44 81 00 00 05 04 3A 08 01 01 00 8D 00 74 82 00 00 00 08 18 0D 0A 00 00 21 8C 1E 3A 08 1D 1A, checksum=1A, error=false
23:13:12.114  DEBUG  RX CMD: ReportAttributesCommand [Relative humidity measurement: 2106/1 -> 0/1, cluster=0405, TID=0D, reports=[Attribute Report: attributeDataType=UNSIGNED_16_BIT_INTEGER, attributeIdentifier=0, attributeValue=7820]]
23:13:12.115  DEBUG  <-- AF_INCOMING_MSG (FE 25 44 81 00 00 03 04 3A 08 01 01 00 8D 00 7F 82 00 00 00 11 18 0E 0A 00 00 29 E3 03 14 00 28 FF 10 00 29 DE 26 3A 08 1D 4C)
23:13:12.115  DEBUG  Received Async Cmd: Packet: subsystem=null, length=37, apiId=44 81, data=FE 25 44 81 00 00 03 04 3A 08 01 01 00 8D 00 7F 82 00 00 00 11 18 0E 0A 00 00 29 E3 03 14 00 28 FF 10 00 29 DE 26 3A 08 1D 4C, checksum=4C, error=false
23:13:12.115  DEBUG  RX CMD: ReportAttributesCommand [Pressure measurement: 2106/1 -> 0/1, cluster=0403, TID=0E, reports=[Attribute Report: attributeDataType=SIGNED_16_BIT_INTEGER, attributeIdentifier=0, attributeValue=995, Attribute Report: attributeDataType=SIGNED_8_BIT_INTEGER, attributeIdentifier=20, attributeValue=-1, Attribute Report: attributeDataType=SIGNED_16_BIT_INTEGER, attributeIdentifier=16, attributeValue=9950]]
23:13:14.237  DEBUG  Ieee Address for 2106 returned null

But I can’t get inclusion to work. The only output that I see is:

> join enable
23:17:02.045  DEBUG  Permit join for 255 seconds.
23:17:02.046  DEBUG  TX CMD: ManagementPermitJoiningRequest [0/0 -> 65532/0, cluster=0036, TID=12, permitDuration=255, tcSignificance=true]
23:17:02.046  DEBUG  ->  AF_DATA_REQUEST (Packet: subsystem=null, length=13, apiId=24 01, data=FE 0D 24 01 FC FF 00 00 36 00 12 30 1F 03 00 FF 01 DD, checksum=DD, error=false) 
23:17:02.056  DEBUG  <-  AF_DATA_SRSP (FE 01 64 01 00 64)
Permit join enable broadcast success.

> 

In comparison, zigbee4java does this:

join enable

DEBUG ZigBeeApi - Sending permit join with data: -1
DEBUG ZigBeeApi - Sending permit join with data: -1
DEBUG CommandInterfaceImpl - -> ZDO_MGMT_PERMIT_JOIN_REQ (Packet: length = 5, apiId = 0x25 0x36, full data = 0xfe 0x05 0x25 0x36 0x0f 0xfc 0xff 0xff 0x01 0xe4, checksum = 0xe4, error = false, errorMessage = null) 
DEBUG CommandInterfaceImpl - -> ZDO_MGMT_PERMIT_JOIN_REQ (Packet: length = 5, apiId = 0x25 0x36, full data = 0xfe 0x05 0x25 0x36 0x0f 0xfc 0xff 0xff 0x01 0xe4, checksum = 0xe4, error = false, errorMessage = null) 
DEBUG CommandInterfaceImpl - <- ZDO_MGMT_PERMIT_JOIN_REQ_SRSP ([254, 1, 101, 54, 0, 82])
DEBUG CommandInterfaceImpl - <- ZDO_MGMT_PERMIT_JOIN_REQ_SRSP ([254, 1, 101, 54, 0, 82])
DEBUG CommandInterfaceImpl - <-- ZDO_MGMT_PERMIT_JOIN_RSP ([254, 3, 69, 182, 0, 0, 0, 240])
DEBUG CommandInterfaceImpl - <-- ZDO_MGMT_PERMIT_JOIN_RSP ([254, 3, 69, 182, 0, 0, 0, 240])
DEBUG CommandInterfaceImpl - -> ZDO_MGMT_PERMIT_JOIN_REQ (Packet: length = 5, apiId = 0x25 0x36, full data = 0xfe 0x05 0x25 0x36 0x02 0x00 0x00 0xff 0x01 0xea, checksum = 0xea, error = false, errorMessage = null) 
DEBUG CommandInterfaceImpl - -> ZDO_MGMT_PERMIT_JOIN_REQ (Packet: length = 5, apiId = 0x25 0x36, full data = 0xfe 0x05 0x25 0x36 0x02 0x00 0x00 0xff 0x01 0xea, checksum = 0xea, error = false, errorMessage = null) 
DEBUG CommandInterfaceImpl - <-- ZDO_MGMT_PERMIT_JOIN_RSP ([254, 3, 69, 182, 0, 0, 0, 240])
DEBUG CommandInterfaceImpl - <-- ZDO_MGMT_PERMIT_JOIN_RSP ([254, 3, 69, 182, 0, 0, 0, 240])
DEBUG CommandInterfaceImpl - <- ZDO_MGMT_PERMIT_JOIN_REQ_SRSP ([254, 1, 101, 54, 0, 82])
DEBUG CommandInterfaceImpl - <- ZDO_MGMT_PERMIT_JOIN_REQ_SRSP ([254, 1, 101, 54, 0, 82])
ZigBee API permit join enable ... [OK]
> DEBUG CommandInterfaceImpl - <-- ZDO_MGMT_PERMIT_JOIN_RSP ([254, 3, 69, 182, 0, 0, 0, 240])
DEBUG CommandInterfaceImpl - <-- ZDO_MGMT_PERMIT_JOIN_RSP ([254, 3, 69, 182, 0, 0, 0, 240])
DEBUG CommandInterfaceImpl - <-- ZDO_MGMT_PERMIT_JOIN_RSP ([254, 3, 69, 182, 0, 0, 0, 240])
DEBUG CommandInterfaceImpl - <-- ZDO_MGMT_PERMIT_JOIN_RSP ([254, 3, 69, 182, 0, 0, 0, 240])

I probably fail to understand some difference between the two programs. @chris Could you please spot some obvious error that I am making?

To get Ikea products to work you need to use the firmware named “CC2531ZNP-Pro-Secure_LinkKeyJoin.hex” for CC2531 due to it seems to not be fully compliant with ZLL. There is new firmwares out that should fix this but products out there are probably still based on their old firmware! (https://www.smarthomegeeks.co.uk/news/ikea-tradfri-hue-work-together-now/)

To joint the remote i…

  1. Open Zigbee network
  2. Press link key at back of remote 4 times quickly, reset confirmed by red led blink
  3. Remove battery a few seconds and put it back again while zigbee network is still open.

//Mattias