Zigbee binding

Cool, I’ll order a zigbee stick in preparation. Which one do you recommend that is usb?

Would this one work:
NEW: ConBee, 2.4 GHz ZigBee USB ZigBee gateway in a compact format with certified drivers for operating systems https://www.amazon.com/dp/B01FDWOIHK/ref=cm_sw_r_cp_apa_BJH9yb6ZH85CK

Or should I get this one:
TEXAS INSTRUMENTS CC2531EMK CC2531, ZIGBEE, USB DONGLE, EVALUATION KIT https://www.amazon.com/dp/B00DK2B3XI/ref=cm_sw_r_cp_apa_PKH9ybA16GPAA

I would be interested in the most future-proof recommended dongle too.

TI dongle from China you can get for $10-15. Its way overpriced on amazon.

The first one is not currently supported.

The 2531 will be ok so the second one is fine. A small word of warning though - these TI dongles may not come with appropriate firmware loaded, and getting this loaded can be painful.

I’ve not had the chance to look at the SmartThings sensors yet - my initial attempt at joining them wasn’t successful, but I would need to look a bit deeper to work out why…

Hi Chris, i have a flashed 2531 dongle with the TI zstack on it and a second dongle as sniffer.
Would be nice to have the compiled binding to test some devices.
Is it ready for use?

Br mickel

Hi Chris ,
There is interesting board for RaspBee - ZigBee addon for Raspberry Pi with Firmware -
https://www.amazon.com/dp/B00E6300DO?psc=1 . Raspberry Pi+ this board will make one very good candidate for openHAB universal Gateway. Do you think it will work with the new binding ?

Thanks

No - not at the moment as it uses a different API… Unlike ZWave where there is a standard API for all controllers you can buy, ZWave has different interfaces for each manufacturer. However I have already been in contact with Dresden (which I think make this?) about their controllers so I’m hoping to get some information and might look to add support in future.

I’ve been working on ironing out some issues with the Ember stick. I know there’s a couple of initialisation issues with the TI stick which I will need to resolve first.

Is there anything one could help you with? I’m not a Java developer (last time I really programmed in Java was in university), but pretty fluent in embedded C/C++.

I’ll take a look at trying to get the TI stick up and running again tonight - I don’t think there’s much to do and I’m probably only missing a command or two.

As a matter of interest, did you get the Xiaomi sensors to work with the TI stick?

Regarding SmartThings sensors - I’ve not got them to work. It looks like they are making a request back to the ST hub once they are associated, and when this doesn’t get a response they are chucked out of the network - I’ll probably take a look at this next weekend. The ST (CentraLite) plug works fine.

Well, I guess I got something working here.
I enabled networking joining in the zigbee-gateway-server and "listen"ed. Using the Secure_LinkKeyJoin.hex firmware I then get attribute reports when pushing the button or nearing the magnet to the door sensor.

That’s what I get:
Received: On/off - Report Attributes Command 45701/1 -> 0/1 tid=35, reports=[Attribute Report attributeDataType=16, attributeIdentifier=0, attributeValue=false]
Received: On/off - Report Attributes Command 45701/1 -> 0/1 tid=36, reports=[Attribute Report attributeDataType=16, attributeIdentifier=0, attributeValue=true]
Received: On/off - Report Attributes Command 34564/1 -> 0/1 tid=8, reports=[Attribute Report attributeDataType=16, attributeIdentifier=0, attributeValue=false]
Received: On/off - Report Attributes Command 34564/1 -> 0/1 tid=9, reports=[Attribute Report attributeDataType=16, attributeIdentifier=0, attributeValue=true]

But the devices are not listed in the devicelist:

> devicelist
         0/1   <label>              Coordinator
         0/2   <label>              Coordinator
         0/3   <label>              Coordinator

The Secure_Standard.hex doesn’t do anything. Well, not nothing. I can see packets passed around with the sniffer, but no attribute reports or joined devices listed.

Probably just the standard problem with battery devices in Zigbee :frowning: . At least if you got that far the key exchange probably worked.

I’ve got one of the temp/humidity sensors coming - I’ve been testing with a (reasonably!) wide range of devices over the past few weeks for the project I’ve been working on, but haven’t tried the Xiaomi sensors yet.

Ah, totally forgot about the temp/hum sensor. Here’s what happens when letting it join:

22:32:37 669 WARN Unknown command ID: 0x45c9
Received: Basic - Report Attributes Command 35956/1 → 0/1 tid=0, reports=[Attribute Report attributeDataType=66, attributeIdentifier=5, attributeValue=lumi.sensor_ht, Attribute Report attributeDataType=32, attributeIdentifier=1, attributeValue=2]
Received: Basic - Report Attributes Command 35956/1 → 0/1 tid=1, reports=[Attribute Report attributeDataType=66, attributeIdentifier=65281, attributeValue=!�
!�!$d)>
e!�
!]

22:32:45 609 ERROR Error AF message listener notify.
java.lang.IllegalArgumentException: No sender EndPoint 1 with cluster 1026.
at org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer.getSenderEndpointProfileId(ApplicationFrameworkLayer.java:136)
at org.bubblecloud.zigbee.v3.zcl.ZclCommandTransmitter.notify(ZclCommandTransmitter.java:137)
at org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerImpl$AFMessageListenerFilter.receivedAsynchronousCommand(ZigBeeNetworkManagerImpl.java:1782)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.notifyAsynchronousCommand(CommandInterfaceImpl.java:372)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.handlePacket(CommandInterfaceImpl.java:148)
at org.bubblecloud.zigbee.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:116)
at java.lang.Thread.run(Thread.java:745)
22:32:45 610 ERROR Error AF message listener notify.
java.lang.IllegalArgumentException: No sender EndPoint 1 with cluster 1029.
at org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer.getSenderEndpointProfileId(ApplicationFrameworkLayer.java:136)
at org.bubblecloud.zigbee.v3.zcl.ZclCommandTransmitter.notify(ZclCommandTransmitter.java:137)
at org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerImpl$AFMessageListenerFilter.receivedAsynchronousCommand(ZigBeeNetworkManagerImpl.java:1782)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.notifyAsynchronousCommand(CommandInterfaceImpl.java:372)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.handlePacket(CommandInterfaceImpl.java:148)
at org.bubblecloud.zigbee.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:116)
at java.lang.Thread.run(Thread.java:745)
22:32:49 057 ERROR Error AF message listener notify.
java.lang.IllegalArgumentException: No sender EndPoint 1 with cluster 1026.
at org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer.getSenderEndpointProfileId(ApplicationFrameworkLayer.java:136)
at org.bubblecloud.zigbee.v3.zcl.ZclCommandTransmitter.notify(ZclCommandTransmitter.java:137)
at org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerImpl$AFMessageListenerFilter.receivedAsynchronousCommand(ZigBeeNetworkManagerImpl.java:1782)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.notifyAsynchronousCommand(CommandInterfaceImpl.java:372)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.handlePacket(CommandInterfaceImpl.java:148)
at org.bubblecloud.zigbee.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:116)
at java.lang.Thread.run(Thread.java:745)
22:32:49 058 ERROR Error AF message listener notify.
java.lang.IllegalArgumentException: No sender EndPoint 1 with cluster 1029.
at org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer.getSenderEndpointProfileId(ApplicationFrameworkLayer.java:136)
at org.bubblecloud.zigbee.v3.zcl.ZclCommandTransmitter.notify(ZclCommandTransmitter.java:137)
at org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerImpl$AFMessageListenerFilter.receivedAsynchronousCommand(ZigBeeNetworkManagerImpl.java:1782)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.notifyAsynchronousCommand(CommandInterfaceImpl.java:372)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.handlePacket(CommandInterfaceImpl.java:148)
at org.bubblecloud.zigbee.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:116)
at java.lang.Thread.run(Thread.java:745)
Device added:
35956/1 null
22:32:52 707 ERROR Error AF message listener notify.
java.lang.IllegalArgumentException: No sender EndPoint 1 with cluster 1026.
at org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer.getSenderEndpointProfileId(ApplicationFrameworkLayer.java:136)
at org.bubblecloud.zigbee.v3.zcl.ZclCommandTransmitter.notify(ZclCommandTransmitter.java:137)
at org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerImpl$AFMessageListenerFilter.receivedAsynchronousCommand(ZigBeeNetworkManagerImpl.java:1782)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.notifyAsynchronousCommand(CommandInterfaceImpl.java:372)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.handlePacket(CommandInterfaceImpl.java:148)
at org.bubblecloud.zigbee.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:116)
at java.lang.Thread.run(Thread.java:745)
22:32:52 710 ERROR Error AF message listener notify.
java.lang.IllegalArgumentException: No sender EndPoint 1 with cluster 1029.
at org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer.getSenderEndpointProfileId(ApplicationFrameworkLayer.java:136)
at org.bubblecloud.zigbee.v3.zcl.ZclCommandTransmitter.notify(ZclCommandTransmitter.java:137)
at org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerImpl$AFMessageListenerFilter.receivedAsynchronousCommand(ZigBeeNetworkManagerImpl.java:1782)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.notifyAsynchronousCommand(CommandInterfaceImpl.java:372)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.handlePacket(CommandInterfaceImpl.java:148)
at org.bubblecloud.zigbee.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:116)
at java.lang.Thread.run(Thread.java:745)
22:32:58 940 ERROR Error AF message listener notify.
java.lang.IllegalArgumentException: No sender EndPoint 1 with cluster 1026.
at org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer.getSenderEndpointProfileId(ApplicationFrameworkLayer.java:136)
at org.bubblecloud.zigbee.v3.zcl.ZclCommandTransmitter.notify(ZclCommandTransmitter.java:137)
at org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerImpl$AFMessageListenerFilter.receivedAsynchronousCommand(ZigBeeNetworkManagerImpl.java:1782)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.notifyAsynchronousCommand(CommandInterfaceImpl.java:372)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.handlePacket(CommandInterfaceImpl.java:148)
at org.bubblecloud.zigbee.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:116)
at java.lang.Thread.run(Thread.java:745)
22:32:58 941 ERROR Error AF message listener notify.
java.lang.IllegalArgumentException: No sender EndPoint 1 with cluster 1029.
at org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer.getSenderEndpointProfileId(ApplicationFrameworkLayer.java:136)
at org.bubblecloud.zigbee.v3.zcl.ZclCommandTransmitter.notify(ZclCommandTransmitter.java:137)
at org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerImpl$AFMessageListenerFilter.receivedAsynchronousCommand(ZigBeeNetworkManagerImpl.java:1782)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.notifyAsynchronousCommand(CommandInterfaceImpl.java:372)
at org.bubblecloud.zigbee.network.impl.CommandInterfaceImpl.handlePacket(CommandInterfaceImpl.java:148)
at org.bubblecloud.zigbee.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:116)
at java.lang.Thread.run(Thread.java:745)
devicelist
0/1 Coordinator
0/2 Coordinator
0/3 Coordinator
35956/1 null

So, I guess it also does something. It even seems to be listed as a device now. But on the other hand, somethings in the gateway doesn’t like it… But I won’t bother any further for now, as I guess you are more familiar with the internals.

I’ve created a binding here. I’ll get it added to the marketplace in the coming days (it will take some time to get it approved I guess).

This will require the serial driver to also be installed through karaf -:

feature:install openhab-transport-serial

You should then be able to create a CC2531 coordinator and hopefully it will find devices ;).

This is pretty much a complete rewrite from the previous binding, and while it’s undergone a reasonable amount of testing recently, I’ve not focussed on device control features, so there could well be issues.

This should currently support switches, bulbs, color and temperature clusters at the moment - I’ll look to add more clusters once we see these are running well.

Let me know how it goes - you can raise issues here (there’s no source there yet - another job to get sorted in the next week or so), or discuss on the forum (I’m sure there will be issues :wink: ) -:

2 Likes

Please note that you are not allowed to upload it to the marketplace as long as it isn’t yet open source - so I hope that this can happen soon!

I have installed the binding, but when I add the zigbee controller it never goes online! Can I enable more logging from the binding to find out why this happens? I am using TI2531 with firmware CC2531ZNP-Pro-Secure_Standard.hex from Z-Stack Home 1.2.2a.44539.

Best Regards,
Mattias

I’m kinda in the same boat as @elevation

events.log:
2017-05-05 22:10:54.529 [hingStatusInfoChangedEvent] - ‘zigbee:coordinator_cc2531:f58e4c23’ changed from UNINITIALIZED to INITIALIZING
2017-05-05 22:10:54.536 [hingStatusInfoChangedEvent] - ‘zigbee:coordinator_cc2531:f58e4c23’ changed from INITIALIZING to OFFLINE

openhab.log:
2017-05-05 22:10:56.288 [INFO ] [ndler.ZigBeeCoordinatorCC2531Handler] - Serial port [/dev/ttyACM0] is initialized.

The sniffer also doesn’t show any activity on the air.

Here’s the JSON config:

  "zigbee:coordinator_cc2531:f58e4c23": {
    "class": "org.eclipse.smarthome.core.thing.internal.BridgeImpl",
    "value": {
      "label": "CC2531EMK Coordinator",
      "channels": [],
      "configuration": {
        "properties": { 
          "zigbee_port": "/dev/ttyACM0",
          "zigbee_channel": 11.0,
          "zigbee_initialise": true,
          "zigbee_panid": 20294.0,  
          "zigbee_extendedpanid": 1.26632787071893811E18,
          "zigbee_networkkey": "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"
        }
      }, 
      "properties": {},
      "uid": {
        "segments": [
          "zigbee",  
          "coordinator_cc2531",
          "f58e4c23"
        ]
      }, 
      "thingTypeUID": {
        "segments": [  
          "zigbee",    
          "coordinator_cc2531"
        ]
      }  
    }    
  },     

I had to patch the JSON config by hand, because the PAN ID I manually entered, didn’t get stored. The extended PAN ID somehow got generated. The network key and the PAN ID is what was working with the zigbee4java server gateway. By the way: Is anything from zigbee4java needed by the addon?

There’s some pretty strange stuff in there.

This is very strange - this should automatically be reset to false - the fact that it’s true makes me think that things aren’t initialising properly.

What else is in the log other than what you posted? Are there any exceptions - any other debug messages at all?

I checked the code - it’s not possible for the initialisation method to complete and leave this set to true. So this tells me there almost certainly must be an exception being thrown - hopefully it’s logged.

Another strange one is the key - this can’t be all zeros. Again, I think something must be stopping this being set to a random value.

Just for comparison - this is the configuration of my TI dongle -:

      "configuration": {
        "properties": {
          "zigbee_port": "/dev/tty.usbmodem1421",
          "zigbee_channel": -1,
          "zigbee_initialise": false,
          "zigbee_extendedpanid": 2358408284790126592,
          "zigbee_networkkey": "1B 30 2B 6D 9A D0 67 06 17 7B BB 34 66 2A C1 33",
          "zigbee_panid": 59292
        }
      },

Bottom line - need to see what the debug logging shows…