Zigbee binding

I’m hoping that the ConBee won’t be hard to support - I’ve started to implement the dongle and have one arriving today (although I’m in France for a few days). Both ConBee and RaspBee are the same as far as I know so once ConBee is implemented the RaspBee will also work (hopefully!).

There are two things here - polling, and reporting. I’ve not implemented polling, but will do so. In theory though, the bulbs should be configured to send updates on their state when things change - although I’ve not tested this so it might not work ;).

I don’t believe so - I just had a quick look at the cluster and it doesn’t seem to provide this.[quote=“curlyel, post:139, topic:15763”]
Is it possible to scale 0-100 percent to their range?
[/quote]

I think this could be done with some scaling configuration parameters as mentioned earlier.

Agreed - the new converter system should make this possible…

However, I may also remove the switch channel if dimmer is available since in reality both are not required. This should avoid such confusion. Currently I just populate all channels that the device might support, but my thought is to optimise this, and supporting both switch and dimmer channels is not needed I think.

Understood on the battery device complications.

Another battery device for informational purposes: SmartThings SmartSense Multi (Original Model)

Device is recognized and can be added as a Thing, but no Channels are available. When switching states (toggling the magnetic sensor), the following error pops up:

2017-06-26 17:14:09.303 [ERROR] [kManagerImpl$AFMessageListenerFilter] - Error AF message listener notify.
java.lang.ArrayIndexOutOfBoundsException: 6
        at com.zsmartsystems.zigbee.serialization.DefaultDeserializer.readZigBeeType(DefaultDeserializer.java:135)[189:org.openhab.binding.zigbee:2.1.0.20170625                                                                                                            1540]
        at com.zsmartsystems.zigbee.zcl.field.AttributeIdentifier.deserialize(AttributeIdentifier.java:45)[189:org.openhab.binding.zigbee:2.1.0.201706251540]
        at com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer.deserialize(ZclFieldDeserializer.java:70)[189:org.openhab.binding.zigbee:2.1.0.201706251540]
        at com.zsmartsystems.zigbee.zcl.clusters.general.ReadAttributesCommand.deserialize(ReadAttributesCommand.java:76)[189:org.openhab.binding.zigbee:2.1.0.2                                                                                                            01706251540]
        at com.zsmartsystems.zigbee.ZigBeeNetworkManager.receiveZclCommand(ZigBeeNetworkManager.java:600)[189:org.openhab.binding.zigbee:2.1.0.201706251540]
        at com.zsmartsystems.zigbee.ZigBeeNetworkManager.receiveCommand(ZigBeeNetworkManager.java:525)[189:org.openhab.binding.zigbee:2.1.0.201706251540]
        at com.zsmartsystems.zigbee.dongle.cc2531.ZigBeeDongleTiCc2531.notify(ZigBeeDongleTiCc2531.java:262)[189:org.openhab.binding.zigbee:2.1.0.201706251540]
        at com.zsmartsystems.zigbee.dongle.cc2531.network.impl.ZigBeeNetworkManagerImpl$AFMessageListenerFilter.receivedAsynchronousCommand(ZigBeeNetworkManager                                                                                                            Impl.java:1324)[189:org.openhab.binding.zigbee:2.1.0.201706251540]
        at com.zsmartsystems.zigbee.dongle.cc2531.network.impl.CommandInterfaceImpl.notifyAsynchronousCommand(CommandInterfaceImpl.java:382)[189:org.openhab.bin                                                                                                            ding.zigbee:2.1.0.201706251540]
        at com.zsmartsystems.zigbee.dongle.cc2531.network.impl.CommandInterfaceImpl.handlePacket(CommandInterfaceImpl.java:154)[189:org.openhab.binding.zigbee:2                                                                                                            .1.0.201706251540]
        at com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacketParser.run(ZToolPacketParser.java:115)[189:org.openhab.binding.zigbee:2.1.0.20170625                                                                                                            1540]
        at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]

Conbee/Raspbee support would be a good option from a Swedish point of view since they are pretty easy to get here. Do you know if they build upon some bitcloud ncp firmware and would be pretty generic, or will support be limited to just Dresden products.

The API looks specific to Dresden but it’s very simple.

Conbee is available on Amazon in the EU and US at least.

It would be good to see the debug logging around this if possible - you need to enable debug logging on com.zsmartsystems.zigbee.

Hi Chris,
I’m currently trying to include a Philips Livingwhites dimming adaptor:
http://www.philips.de/c-p/6916531PH/livingwhites-adapter

If I’m right, these devices rely on “touchlink”. Up to now, I was not able to discover it even when just millimeters away from the CC2531.

So I’m curious, if “touchlink” join can work with the binding and/or the CC2531 coordinator.

I’ve read, that the Dresden Electronic stuff can do so. Do you know if this is even possible having touchlink devices included using the binding in a zigbee network controlled by a CC2531 and/or ConBEE/RaspBEE?

I also checked for UK, they sell it there as well. Austria indeed seems to be left out. Haven’t found it there on amazon or similar.

The Website says they come with a bootloader and you can make own firmwares, does this help?

Yes - the UK is still part of the EU :slight_smile: .

No - this is 100% not my intention. The plan is to use a standard software so that people do not need to reprogram - they can just use a USB stick that is bought off the shelf.

Most (all I think) ZLL devices can also use standard association methods. Touchlink is only used for ZLL, where HA uses the standard association. If the device only uses touchlink then I don’t think you can use it, but I would be surprised if this was the case given other Philips devices don’t require this.

Touchlink also requires a special security key and I believe that this is not publicly available. Companies have to sign an NDA to get this key so it’s really not available for OS projects.

O.k. thanks for the explanation. I’ve been digging for some more information about these plugs: But all documentation/tutorials I’ve found are referring to touchlink pairing - even when connecting to a HUE bridge.

More than this, there seems to be no way to do a real factory reset of it - only option is an unpair from a remote using touchlink as well :frowning:

Anywway - seems I have to buy something new for it :wink:

This is the same for Hue (AFAIK anyway). I have a touchlink controller just to reset my bulbs :slight_smile: .

Here you go! This time didn’t give the full trace, but the error still shows.

2017-06-28 18:05:47.866 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - RX CMD: ManagementRoutingResponse [0/0 -> 0/0, cluster=8032, TID=NULL, status=SUCCESS, routingTableEntries=1, startIndex=0, routingTableListCount=1, routingTableList=[RoutingTable [destinationAddress=22249, status=DISCOVERY_UNDERWAY, memoryConstrained=false, manyToOne=false, routeRecordRequired=false, nextHopAddress=65534]]]
2017-06-28 18:05:47.875 [DEBUG] [31.network.impl.CommandInterfaceImpl] - <-  AF_DATA_SRSP (FE 01 64 01 00 64)
2017-06-28 18:05:57.353 [DEBUG] [31.network.impl.CommandInterfaceImpl] - <-- AF_INCOMING_MSG (FE 1A 44 81 00 00 00 05 80 FA 01 01 00 6E 00 FD EE 04 00 00 06 19 4C 00 31 00 00 80 FA 1D DC)
2017-06-28 18:05:57.354 [DEBUG] [31.network.impl.CommandInterfaceImpl] - Received Async Cmd: Packet: subsystem=null, length=26, apiId=44 81, data=FE 1A 44 81 00 00 00 05 80 FA 01 01 00 6E 00 FD EE 04 00 00 06 19 4C 00 31 00 00 80 FA 1D DC, checksum=DC, error=false
2017-06-28 18:05:57.354 [ERROR] [kManagerImpl$AFMessageListenerFilter] - Error AF message listener notify.
java.lang.ArrayIndexOutOfBoundsException
2017-06-28 18:05:57.828 [DEBUG] [ee.internal.ZigBeeNetworkMeshMonitor] - 22249: ManagementLqiRequest returned null
2017-06-28 18:05:57.828 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - TX CMD: IeeeAddressRequest [0/0 -> 22249/0, cluster=0001, TID=FF, nwkAddrOfInterest=22249, requestType=1, startIndex=0]
2017-06-28 18:05:57.828 [DEBUG] [31.network.impl.CommandInterfaceImpl] - ->  AF_DATA_REQUEST (Packet: subsystem=null, length=15, apiId=24 01, data=FE 0F 24 01 E9 56 00 00 01 00 FF 30 1F 05 00 E9 56 01 00 FF, checksum=FF, error=false)
2017-06-28 18:05:57.828 [DEBUG] [ee.internal.ZigBeeNetworkMeshMonitor] - 64128: ManagementLqiRequest returned null
2017-06-28 18:05:57.828 [DEBUG] [ee.internal.ZigBeeNetworkMeshMonitor] - 64128: Not updating routing table: type is END_DEVICE
2017-06-28 18:05:57.829 [DEBUG] [ee.internal.ZigBeeNetworkMeshMonitor] - 64128: Ending mesh update
2017-06-28 18:05:57.829 [DEBUG] [ng.zigbee.handler.ZigBeeThingHandler] - D052A8001C140003: Node updated - IEEE=D052A8001C140003, NWK=FA80, Type=END_DEVICE
2017-06-28 18:05:57.844 [DEBUG] [31.network.impl.CommandInterfaceImpl] - <-  AF_DATA_SRSP (FE 01 64 01 00 64)
2017-06-28 18:05:58.335 [DEBUG] [31.network.impl.CommandInterfaceImpl] - <-- AF_INCOMING_MSG (FE 1A 44 81 00 00 00 05 80 FA 01 01 00 69 00 F6 FA 04 00 00 06 19 4D 00 30 00 00 80 FA 1D C4)
2017-06-28 18:05:58.335 [DEBUG] [31.network.impl.CommandInterfaceImpl] - Received Async Cmd: Packet: subsystem=null, length=26, apiId=44 81, data=FE 1A 44 81 00 00 00 05 80 FA 01 01 00 69 00 F6 FA 04 00 00 06 19 4D 00 30 00 00 80 FA 1D C4, checksum=C4, error=false
2017-06-28 18:05:58.335 [ERROR] [kManagerImpl$AFMessageListenerFilter] - Error AF message listener notify.
java.lang.ArrayIndexOutOfBoundsException

Thanks - I’ll take a look at this tonight.

As best as I can tell at the moment, this frame is corrupt.

06 19 4C 00 31 00 00
6 means 6 bytes,
19 4C 00 is the ZCL header
31 00 is an attribute,
00 remaining is too short - it should also be 2 bytes long.

So, either the 6 bytes length is wrong, or something else…

I’ll park this for now - maybe I’m missing something and I’ll take a look at this when I get a chance with the sensor I have here.

OH2.1, zigbee binding 2.2.0.201706290942, HUSBZB-1 (Silicon Labs EM3581, EmberZNet Pro 5.4)

The Coordinator is stuck at Initializing:

2017-06-30 07:30:55.602 [zigbee                    ] - BundleEvent [unknown:512] - org.openhab.binding.zigbee
2017-06-30 07:30:55.617 [zigbee                    ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=org.openhab.binding.zigbee.internal.ZigBeeHandlerFactory, component.id=8, service.id=115, service.bundleid=220, service.scope=bundle} - org.openhab.binding.zigbee
2017-06-30 07:30:55.624 [zigbee                    ] - BundleEvent STARTING - org.openhab.binding.zigbee
2017-06-30 07:30:55.625 [zigbee                    ] - BundleEvent STARTED - org.openhab.binding.zigbee
2017-06-30 07:30:58.218 [zigbee                    ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.core.ConfigOptionProvider, org.eclipse.smarthome.config.core.ConfigDescriptionProvider}={component.name=org.openhab.binding.zigbee.internal.ZigBeeConfigProvider, component.id=9, service.id=182, service.bundleid=220, service.scope=bundle} - org.openhab.binding.zigbee
2017-06-30 07:30:58.242 [zigbee                    ] - ServiceEvent REGISTERED - {org.openhab.binding.zigbee.internal.ZigBeeConfigProvider}={component.name=org.openhab.binding.zigbee.ConfigDescription, component.id=10, service.id=183, service.bundleid=220, service.scope=bundle} - org.openhab.binding.zigbee
2017-06-30 08:50:56.515 [ZigBeeHandlerFactory      ] - Creating coordinator handler for org.eclipse.smarthome.core.thing.internal.BridgeImpl@b5982076
2017-06-30 08:50:56.566 [BeeCoordinatorEmberHandler] - Initializing ZigBee Ember serial bridge handler.
2017-06-30 08:50:56.566 [ZigBeeCoordinatorHandler  ] - Initializing ZigBee network [zigbee:coordinator_ember:f8d7abbc].
2017-06-30 08:50:56.566 [ZigBeeCoordinatorHandler  ] - Channel -1
2017-06-30 08:50:56.567 [ZigBeeCoordinatorHandler  ] - PANID 0
2017-06-30 08:50:56.567 [ZigBeeCoordinatorHandler  ] - EPANID 0000000000000000
2017-06-30 08:50:56.568 [ZigBeeCoordinatorHandler  ] - Key 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2017-06-30 08:50:56.569 [ZigBeeCoordinatorHandler  ] - Initialising network
2017-06-30 08:50:56.569 [ZigBeeCoordinatorHandler  ] - Created random ZigBee PAN ID [8E9A].
2017-06-30 08:51:01.574 [ZigBeeCoordinatorHandler  ] - Created random ZigBee extended PAN ID [7DAFAD7D5A1F3B92].
2017-06-30 08:51:01.653 [ZigBeeCoordinatorHandler  ] - Key String 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2017-06-30 08:51:01.655 [ZigBeeCoordinatorHandler  ] - Key array [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2017-06-30 08:51:01.657 [ZigBeeCoordinatorHandler  ] - Creating random ZigBee network key.
2017-06-30 08:51:01.739 [ZigBeeCoordinatorHandler  ] - Created random ZigBee network key.
2017-06-30 08:51:01.744 [ZigBeeCoordinatorHandler  ] - Key initialised String 36 1C C4 8A 1E 1E 27 7B EB FC 0A D9 96 B2 B6 AA
2017-06-30 08:51:01.745 [ZigBeeCoordinatorHandler  ] - Key initialised array [54, 28, 196, 138, 30, 30, 39, 123, 235, 252, 10, 217, 150, 178, 182, 170]
2017-06-30 08:51:01.745 [ZigBeeCoordinatorHandler  ] - Key final array [54, 28, 196, 138, 30, 30, 39, 123, 235, 252, 10, 217, 150, 178, 182, 170]
2017-06-30 08:51:01.764 [BeeCoordinatorEmberHandler] - ZigBee Coordinator Ember opening Port:'/dev/ttyUSB1' PAN:8e9a, EPAN:7DAFAD7D5A1F3B92, Channel:-1
2017-06-30 08:51:01.767 [ZigBeeCoordinatorHandler  ] - Scheduling ZigBee start
2017-06-30 08:51:02.768 [ZigBeeCoordinatorHandler  ] - ZigBee network starting
2017-06-30 08:51:02.769 [ZigBeeCoordinatorHandler  ] - Initialising ZigBee coordinator
2017-06-30 08:51:02.770 [ZigBeeDiscoveryService    ] - Creating ZigBee discovery service for zigbee:coordinator_ember:f8d7abbc
2017-06-30 08:51:02.771 [ZigBeeDiscoveryService    ] - Activating ZigBee discovery service for zigbee:coordinator_ember:f8d7abbc
2017-06-30 08:51:02.774 [zigbee                    ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=447, service.bundleid=220, service.scope=singleton} - org.openhab.binding.zigbee
2017-06-30 08:51:02.802 [ZigBeeCoordinatorHandler  ] - Key initialise [54, 28, 196, 138, 30, 30, 39, 123, 235, 252, 10, 217, 150, 178, 182, 170]
2017-06-30 08:51:02.803 [ZigBeeDongleEzsp          ] - EZSP dongle initialize.
2017-06-30 08:51:02.805 [BeeCoordinatorEmberHandler] - Connecting to serial port [/dev/ttyUSB1]
2017-06-30 08:51:02.845 [BeeCoordinatorEmberHandler] - Serial port [/dev/ttyUSB1] is initialized.
2017-06-30 08:51:02.871 [AshFrameHandler           ] - Trying to send when not connected.

And OH will crash hard when the binding is stopped (let me know if you’re interested in the core dump):

get_java_var: invalid file descriptor
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007ff7eb8f47d5, pid=2667, tid=0x00007ff7e530a700
#
# JRE version: OpenJDK Runtime Environment (8.0_131-b12) (build 1.8.0_131-b12)
# Java VM: OpenJDK 64-Bit Server VM (25.131-b12 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libNRJavaSerial.so+0x77d5]  read_byte_array+0x55
#
# Core dump written. Default location: /opt/openhab2/userdata/core or core.2667
#
# An error report file with more information is saved as:
# /opt/openhab2/userdata/hs_err_pid2667.log
Compiled method (c2) 1696268 14685  s!   4       gnu.io.RXTXPort$SerialInputStream::read (98 bytes)
 total in heap  [0x00007ff83b1f2c10,0x00007ff83b1f3b38] = 3880
 relocation     [0x00007ff83b1f2d38,0x00007ff83b1f2dd8] = 160
 main code      [0x00007ff83b1f2de0,0x00007ff83b1f33c0] = 1504
 stub code      [0x00007ff83b1f33c0,0x00007ff83b1f3420] = 96
 oops           [0x00007ff83b1f3420,0x00007ff83b1f3428] = 8
 metadata       [0x00007ff83b1f3428,0x00007ff83b1f3498] = 112
 scopes data    [0x00007ff83b1f3498,0x00007ff83b1f38b0] = 1048
 scopes pcs     [0x00007ff83b1f38b0,0x00007ff83b1f3a60] = 432
 dependencies   [0x00007ff83b1f3a60,0x00007ff83b1f3a70] = 16
 handler table  [0x00007ff83b1f3a70,0x00007ff83b1f3ae8] = 120
 nul chk table  [0x00007ff83b1f3ae8,0x00007ff83b1f3b38] = 80

On a positive note, I transferred primary controller from a zstick to the zwave side (using OZW and Zensys), then transferred SIS/SUC, and everything seems good after changing the associations to the new controller!

Please enable debug logging on com.zsmartsystems.zigbee so we can see what’s happening.

Ummm… This is ZWave right? Im not sure I understand the link with the Zigbee crash :confused:

I have the following loggers and appender in org.ops4j.pax.logging.cfg. I must be missing something to provide more logging.

log4j.logger.org.openhab.binding.zigbee = DEBUG, zigbee
log4j.logger.com.zsmartsystems.zigbee = DEBUG, zigbee

log4j.appender.zigbee=org.apache.log4j.RollingFileAppender
log4j.appender.zigbee.layout=org.apache.log4j.PatternLayout
log4j.appender.zigbee.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%-26.26c{1}] - %m%n
log4j.appender.zigbee.file=${openhab.logdir}/zigbee/zigbee.log
log4j.appender.zigbee.append=true
log4j.appender.zigbee.maxFileSize=10MB
log4j.appender.zigbee.maxBackupIndex=40

Yes, zwave… on a combo device. Serial communication is functioning to that side of the stick from OH. So it’s half working! :stuck_out_tongue_winking_eye:

Ok - not sure why I don’t see anything then. Without more information I don’t think I can do anything :frowning: .

You mean you have a single stick with both zwave and zigbee? What is the device?

Here…