Zigbee binding

zigbee
beginners
Tags: #<Tag:0x00007f0146862600> #<Tag:0x00007f01468624c0>

(joris) #1546

Hello all

I am sure this question had come up multiple times, but there are 1500 posts and I am unable to find the answer so I ask again…

Are xiaomi mi/aqara devices compatible with this binding? I seem to remember that there was some kind of non compliance with the zigbee standard that did not immediately let them be compatible, but had that changed?

Thanks all


(Rgabo74) #1547

Hi Chris and All,

I had a working CC2531 configuration on openhabian OH2.2 until I upgraded to OH2.4 M5. Since then my CC2530 coordinator thing goes offline immediately after discovery or configuration. Based on the log it cannot open the serial device, but the device exists and permissions already checked. Please advise what could be wrong. Debug logs follow.

Thanks a lot!

2018-11-14 22:33:13.641 [DEBUG] [nal.ZigBeeNetworkStateSerializerImpl] - Loading ZigBee network state: Start.
2018-11-14 22:33:16.171 [DEBUG] [nal.ZigBeeNetworkStateSerializerImpl] - Loading ZigBee network state: Done.
2018-11-14 22:33:16.195 [DEBUG] [bee.internal.ZigBeeNetworkDiscoverer] - Network discovery task starting
2018-11-14 22:33:09.081 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: Configuration update: Processing zigbee_initialise -> true
2018-11-14 22:33:09.139 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: Configuration update: Ignored zigbee_channel as no change
2018-11-14 22:33:09.196 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: Configuration update: Ignored zigbee_panid as no change
2018-11-14 22:33:09.250 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: Configuration update: Ignored zigbee_znp_magicnumber as no change
2018-11-14 22:33:09.319 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: Configuration update: Ignored zigbee_linkkey as no change
2018-11-14 22:33:09.370 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: Configuration update: Ignored zigbee_extendedpanid as no change
2018-11-14 22:33:09.411 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: Configuration update: Ignored zigbee_networkkey as no change
2018-11-14 22:33:10.540 [DEBUG] [nal.ZigBeeNetworkStateSerializerImpl] - Saving ZigBee network state: Start.
2018-11-14 22:33:10.728 [DEBUG] [nal.ZigBeeNetworkStateSerializerImpl] - Saving ZigBee network state: Done.
2018-11-14 22:33:10.784 [DEBUG] [bee.internal.ZigBeeNetworkDiscoverer] - Network discovery task shutdown
2018-11-14 22:33:10.835 [DEBUG] [.cc2531.network.ZigBeeNetworkManager] - Already CLOSED
2018-11-14 22:33:10.885 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - ZigBee network [zigbee:coordinator_cc2531:17aa09ea] closed.
2018-11-14 22:33:10.931 [DEBUG] [.zigbee.cc2531.handler.CC2531Handler] - Initializing ZigBee CC2531 serial bridge handler.
2018-11-14 22:33:10.965 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Initializing ZigBee network [zigbee:coordinator_cc2531:17aa09ea].
2018-11-14 22:33:11.030 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Channel 11
2018-11-14 22:33:11.081 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - PANID 17915
2018-11-14 22:33:11.136 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - EPANID 651B3EF9F4972DE2
2018-11-14 22:33:11.229 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Network Key 53074B21B0A6B66B1931F2507410A170
2018-11-14 22:33:11.272 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Link Key 5A6967426565416C6C69616E63653039
2018-11-14 22:33:11.337 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Network Key String 53074B21B0A6B66B1931F2507410A170
2018-11-14 22:33:11.412 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Network key final array 53074B21B0A6B66B1931F2507410A170
2018-11-14 22:33:11.488 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Link Key String 5A6967426565416C6C69616E63653039
2018-11-14 22:33:11.532 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Initialising network
2018-11-14 22:33:11.913 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Link key final array 5A6967426565416C6C69616E63653039
2018-11-14 22:33:12.056 [DEBUG] [.zigbee.cc2531.handler.CC2531Handler] - ZigBee CC2531 Coordinator opening Port:'/dev/ttyACM0' PAN:45fb, EPAN:651B3EF9F4972DE2, Channel:11
2018-11-14 22:33:12.213 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Scheduling ZigBee start
2018-11-14 22:33:13.290 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - ZigBee network starting
2018-11-14 22:33:13.319 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Initialising ZigBee coordinator
2018-11-14 22:33:13.352 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - Adding supported cluster 1280
2018-11-14 22:33:13.382 [DEBUG] [com.zsmartsystems.zigbee.ZigBeeNode ] - ClusterMatcher starting
2018-11-14 22:33:13.403 [DEBUG] [com.zsmartsystems.zigbee.ZigBeeNode ] - ClusterMatcher adding cluster IAS_ZONE
2018-11-14 22:33:13.431 [DEBUG] [tsystems.zigbee.ZigBeeNetworkManager] - Adding supported cluster 25
2018-11-14 22:33:13.459 [DEBUG] [com.zsmartsystems.zigbee.ZigBeeNode ] - ClusterMatcher adding cluster OTA_UPGRADE
2018-11-14 22:33:13.481 [DEBUG] [e.dongle.cc2531.ZigBeeDongleTiCc2531] - CC2531 transport initialize
2018-11-14 22:33:13.546 [DEBUG] [ding.zigbee.handler.ZigBeeSerialPort] - Connecting to serial port [/dev/ttyACM0] at 115200 baud, flow control FLOWCONTROL_OUT_RTSCTS.
2018-11-14 22:33:13.589 [ERROR] [ding.zigbee.handler.ZigBeeSerialPort] - Serial Error: Port /dev/ttyACM0 does not exist.
2018-11-14 22:33:13.621 [ERROR] [.cc2531.network.ZigBeeNetworkManager] - Failed to open the dongle.

(Chris Jackson) #1548

I can only suggest the standard things here, and at least some of them you have done -:

Check permissions again
Check that the symlinks are correct
Check that the port names are provided on the java command line

These sort of serial port issues are one of the most common problems I see, but unfortunately there’s not a lot I can do as it is a system/OS issue - sorry


(Pedro Garcia) #1549

Same error after upgrading OH2.3 to OH2.4 M5 on a rpi2. I still have to test before upgrading my rpi3 with my “big” environment, but I confirm this happening at least on rpi2.

It does not seem to be related to the binding itself. Same problem with both cc2531 and telegesis dongles, same “serial error: port /dev/ttyACM0 does not exist” (/dev/ttyUSB0 with my telegesis).

Solution (at least for my rpi2): installed liblockdev. It seems to be needed by the native part of nrjavaserial. It is not (or I could not find it) in my rasbpian distro, so I just downloaded and compiled it. Now it is working for me. How to compile if you do not find a binary package for your distro:

cd /tmp
wget http://ftp.de.debian.org/debian/pool/main/l/lockdev/lockdev_1.0.3.orig.tar.gz
tar zxvf lockdev_1.0.3.orig.tar.gz
cd lockdev-1.0.3/
make
make install
cd /usr/lib
ln -s /usr/local/lib/liblockdev.1.0.3.so
ln -s liblockdev.1.0.3.so liblockdev.so.1
ln -s liblockdev.so.1 liblockdev.so

And then restart openhab. Hope this helps, as it took me several hours googling without really finding a solution :slight_smile:

As a prove that it is now being used, so at least this has something to do with the issue :slight_smile: :

#> fuser /usr/local/lib/liblockdev.1.0.3.so
/usr/local/lib/liblockdev.1.0.3.so: 29759m

#> ps -ef | grep 29759
openhab  29759     1  8 05:13 ?        00:12:23 /usr/lib/java/jre8/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 ...

Pedro


[SOLVED] USB device no longer exists after upgrading OpenHab 2.3.0 -> 2.4.0-M5
RaZberry changes adress.. very strange!
(Rgabo74) #1550

This solved the problem straight away. On my end this hapened on a Pi1B+ device.
Thanks lot, Pedro! Also Chris, thanks for the suggestions!
Gabor


(stephan) #1551

Hi Chris,
I use your binding (Ubuntu 18.04.1, OH 2.4.0 #1430, binding 2.4.0.201811172043) with an XBEE stick and ubisys devices (came from conbee, deconz and hue-binding). Most things work great out of the box
But I have some questions:

  • It shows “Current firmware version: 01100161 Unknown”, probably meaning that the binding doesn’t know if a newer version exists. Is it possible to update the ubisys firmware with this configuration and if it’s possible would you please describe hot to do it?
  • D1 shows 3 switch channels: After reading the technical reference I belive that the first switch is a “virtual” one, representing the actual state of the lamp. The second and third ones should represent the “inputs”. Is this correct? I don’t get the second and third to work (triggering rules, changes in sitemap). The only thing happening is the following log info. Do you have any hint how to “read and use” them?

16:52:47.334 [DEBUG] [.converter.ZigBeeConverterSwitchOnoff] - 001FEE00000025F1: ZigBee command receiveds ToggleCommand [On/Off: 17692/3 -> 0/1, cluster=0006, TID=1A]
16:54:58.572 [DEBUG] [.converter.ZigBeeConverterSwitchOnoff] - 001FEE00000025F1: ZigBee command receiveds ToggleCommand [On/Off: 17692/3 -> 0/1, cluster=0006, TID=1E]
16:55:02.891 [DEBUG] [.converter.ZigBeeConverterSwitchOnoff] - 001FEE00000025F1: ZigBee command receiveds ToggleCommand [On/Off: 17692/3 -> 0/1, cluster=0006, TID=1F]

  • The Current and Voltage channels can be read easily but the Total Active Power channel never gets updated (see screenshot). I defined all three item manually as numbers. Is this a known problem or may I send you logs?
  • Following the reference manual, the S1 allows to change the “input” from on vs. off to toggle. Can this be done, e.g. with some karaf command?

Thanks very much in advance


(Chris Jackson) #1552

Correct - the binding provides the latest firmware version, and as there is no known firmware available, the UI displays the status as UNKNOWN.

Is there firmware available?

It requires a firmware provider - this is an OSGi service that provides the firmware. I can create one reasonably easily if needed, and you can provide the firmware (or a link to it).

I’m not sure - there’s no hard rules about how this works in ZigBee (or ZWave either!).

I think the issue here is that the Toggle command is being used, and if I remember correctly, this isn’t interpreted by the binding (at the moment).

It’s not a known problem, so please feel free to provide logs of this data being received. Note that it’s also possible the device doesn’t provide this data - the binding looks at what the device says it supports, but it’s possible it doesn’t actually update the data. Logs will be helpful though.

No - not at the moment at least. It is something that we can likely add (can you provide a link to the manual for this device please).


(Jared Frank) #1553

Chris - can you point me to maybe a working branch that I can use chris’s script to get the fix for the PR above ( [Protect ASH layer against exceptions higher up the stack] (https://github.com/zsmartsystems/com.zsmartsystems.zigbee/pull/424)) ? Its looking like I’ll need to try to go that route until the next master branch release comes out. Thanks for your help - also I did notice btw that the most recent master release fixed the CT temperature reversal on some of my newer bulbs that I was experiencing so thank you for that as well!

Regards,
Jared


(Chris Jackson) #1554

I guess you mean Scotts script? (ie @5iver). I believe that this will (by default) download the latest released version of the binding and the libraries.

The only thing I’m not 100% sure of is if they are compatible still - I think so, but it’s possible there is a change.

I will see if I can do an update soon - certainly before 2.4 is released which I guess is in about a months time (based on previous releases).


(Scott Rushworth) #1555

The script will let you choose either master or development branches for the Zigbee libraries. I just upgraded to the latest dev libraries (1.1.4), and everything seems to be running OK.


(Jared Frank) #1556

I was a bit nervous to do the dev branch - but you are correct. I just grabbed those and so far so good. Thanks so much for all you guys do! I’ll let you know if I find any bugs :slight_smile:


(stephan) #1557

Hi Chris,
your reactions are incredibly fast - but also the support team of ubisys is very fast and probably helped us a lot:

Is there firmware available?
not a regular one, but the support team gave me a “beta” which is not public now. I have sent it directly to your mail.

Following the reference manual, the S1 allows to change the “input” from on vs. off to toggle. Can this be done, e.g. with some karaf command?
No - not at the moment at least. It is something that we can likely add (can you provide a link to the manual for this device please).
The public technical reference for s1 is:
https://www.ubisys.de/downloads/ubisys-s1-technical-reference.pdf
I have also sent you an integrators guide that is for non-public use but may help you.

It’s not a known problem, so please feel free to provide logs of this data being >received. Note that it’s also possible the device doesn’t provide this data - the >binding looks at what the device says it supports, but it’s possible it doesn’t >actually update the data. Logs will be helpful though.

I have integrated the channels manually as items:
Number EsszimmerCurrent “Current [%.1f]” {channel=“zigbee:device:196b67a4:001fee00000025f1:001FEE00000025F1_4_current”}
Number EsszimmerVoltage “Voltage [%.1f]” {channel=“zigbee:device:196b67a4:001fee00000025f1:001FEE00000025F1_4_voltage”}
Number EsszimmerPower “Power [%.1f]” {channel=“zigbee:device:196b67a4:001fee00000025f1:001FEE00000025F1_4_activepower”}
and the results in the paperUI are as follows
Logs are added to the mail…


(Brycebba) #1558

I have a XBee S2C I am trying to get working but I cant seem to find anything in this thread on how to do that. No matter what format I put in the port number field I always get a message saying
“OFFLINE Failed to initialize ZigBee transport layer”

I am using a waveshare UART Xbee adapter and I am able to access the XBee module in XCTU on my laptop. Not sure what information would be helpful


(Chris Jackson) #1559

The S2 should work fine. Probably the issue is related to serial port access (permissions, or Java configuration) as this is the most common problem with bindings using serial. Search the forum for more information on serial configuration that might be relevant to your system.

This post just above may also help -:

You can try enabling debug logging to see more of what is happening.


(stephan) #1560

Hi Chris,
sorry for asking again:

  • Are you planning to integrate an update-mechanism for ubisys devices. Do you need additional informations or are the references I sent you sufficient?
  • Did you find an option to change the “toggling” of the switch channels 2 and 3 with this binding in the documents?

Thanks a lot again!


(Arno) #1561

I also use a Ubisys device. I had already contacted them about using it with an on/off switch installation. It is configurable, is in the technical reference manual. However, this is not implemented in the binding right now.

I resorted to a hardware hack; I inserted some foam in the switches so that they will not stay in the “on” position. Thus I converted them to toggle switches.

I also had the problem that I could not act on input. I used the following rule, that looks why the output changed instead:

rule "Bedroom lights on according wall switch"
    //Switch lights according to ceiling light
when 
    Item WandschalterSchlafzimmer_Deckenlicht_SwitchOnoff changed or
    Item WandschalterSchlafzimmer_Deckenlicht_SwitchOnoff received command
then
    if ( receivedCommand === null ) { //if it changed without a command, it was the wall switch
        if (WandschalterSchlafzimmer_Deckenlicht_SwitchOnoff.state == ON) {
            logInfo("Deckenlicht","Deckenlicht an mit Schalter")
            if (Sun_Daylight == ON) {
                gColorSZ.sendCommand("45,10,100")
            }
            else{
                gColorSZ.sendCommand("45,40,50")
            }
        }

        else if (WandschalterSchlafzimmer_Deckenlicht_SwitchOnoff.state == OFF) {
            logInfo("Deckenlicht","Deckenlicht aus mit Schalter")
            gColorSZ.sendCommand("45,40,0")
        }
    }
end

(stephan) #1562

Hi Arno,
thanks for that idea - but it only seems to work on switches already “connected” to a lamp - others show no reaction on openhab. Anyway I ordered an usb-stick from ubisys to use their software to change inputs until this may be possible in the zigbee binding somewhere in the future.
What a pity chris doesn’t reply about the integrators guide I sent him. Does this give him additional informations?
Arno, is there an option to contact you directly, e.g. by mail as you also live in Germany?


(Chris Jackson) #1563

Sorry - I’ve been extremely busy over the past few days. I will look at this when I get time - I’m aware of the issue, and it requires some updates to the binding to implement such changes. I try to support this as best as I can, but sometimes there are other things that I need to do!


(stephan) #1564

Hi Chris,
thanks for your reply and the great work you do for this fantastic project!!!
Do you habe an ubisys device to do the testing or should I send you one?
Stephan


(Chris Jackson) #1565

I have a bunch of them - UbiSys sent me some a while back so I have (roughly) one of each of their devices. (thanks anyway).