Zigbee binding

From the log, everything from the device looks fine. It is sending notifications ok, but the binding isn’t converting them to the channel for some reason. I’m not sure why this is - I’ll probably add some more debug in to try and work out what’s happening, but at the moment CI is not working, so I can’t update the binding :frowning: .

I wonder what have been the reason for this change in my system… Though it has always run very unstable (going offline quite often and needed to be re-added). But I have not experience this kind of issues before.
When i updated to the latest lib and binding, it was running pretty stable for several days. And then, when I tried to solve these fatal problems regarding Grafana, this sensor just changed behaviour.

Weird!

It’s probably not related. Be careful to link things together, and keep an open mind :wink:

On my system, this is highly difficult :face_with_raised_eyebrow: Sometime I feel everything is releate, when one fail appear, another will follow, even though they´re not related.
Whenever I get the time, I will start all over on with a clean install, and perhaps some other hardware than the Rpi. My main problem is, I bought this damn Elelabs Zigbee shield which only connects to the Rpi (or PIO interface). So I would have to have yet another Zigbee coordinator. On the other hand, I´m sick and tired of USB devices and Linux… Every time I add a new devices some other devices give an error. I have tried with symlinks, but for some reason I can´t seem to find, they´re not all working…

Did I ever mention I hate Linux :grin:

don’t know if I should start new thread, but wanted to share some thoughts/feedback and had some questions on zigbee/OH. I have a programming background (not afraid of low-level stuff), but zigbee-protocol is very new to me, so forgive me obvious questions/comments, and please correct me if you think I didn’t get the point :slightly_smiling_face:

This weekend I’ve set up some experimental OH-installation with zigbee (TI CC2531-stick), Ikea Tradfri remote (5btn) & gledopto RGBW (http://www.gledopto.com/pd.jsp?id=38#pfc={“groupIds”%3A[1]%2C"lid"%3A1%2C"sc"%3A{“key”%3A"name"%2C"desc"%3Afalse}}&_jcp=3_1 ) but with a single color strip connected to the white channel (some left-over).

Summary of what I tested/results:

  1. flash FW _Standard.hex to stick (as mentioned on the binding page)
  2. attempted to add Tradfri Remote (manual says press link button > 10 sec to pair, internet says press 4x quickly, the last at least responded with flashing led on the remote, maybe the first is for some association, when the device already joined the network?)
    => I saw it’s mac-address in the properties of the cc2531-thing, but was not able to get it in the inbox
  3. flash FW _LinkKeyJoin.hex
    => Now a new device was added to the inbox, but it only had 1 channel (switch-type), and I didn’t manage to see incomming commands
    => After some more removing/re-adding the device suddenly I got multiple channels (switch, 2x battery and another, I guess it was level). I don’t know why I had multiple channels this time. Put the device closer? Wait longer?
  4. Since I couldn’t get to something usefull, I decided to remove all things and first add the RGBW-controller. All went pretty well, I got 4 channels: 2x level/dimmer, 1x colorTemperature/dimmer and 1x Color. And I successfully sent commands from OH to the device, I also verified the color by connecting the strip to the red channel and results were acceptable.
  5. I tried to add the remote again, but only got the switch channel again, so didn’t test anything else.
  6. I associated the remote directly to the LED-controller, now I could On/Off and set level from remote and from OH. However OH only updates the brightness of the color channel (but maybe that’s an issue between ikea-remote & gledopto?) all other dimmer/levels remain unchanged (can only be used to send on/off/level to the controller).

So my questions:
-Are the remotes expected to be usable as Input/sensors? If not, where does the switch channel come from?
-Which FW should be used on the CC2531 ? currently I seem to have better results with the LinkKeyJoin.hex

And Feedback:
-First impression is that GLEDOPTO could be added to the compatibility list, but needs some corrections? (Is an additional log needed to verify some stuff?)
Tnx

This is an ongoing addition at the moment.

This is the way the binding works. It searches the zigbee services that the device reports, and creates channels based on this. If the device reports that it supports a switch, then the binding will report and provide this.

This can end up with some channels that are not optimum, or maybe even don’t do anything. However, it has the huge advantage that devices will mostly work off the shelf without having to write custom handler, which is a major bind in a system like ZigBee where there are thousands of devices on the market.

@Kim_Andersen I am going to do a binding and library update this evening. Please can you update tomorrow night and if the occupancy sensor still doesn’t work, then please provide the log again (from the binding startup).

1 Like

I will… I will be pulling the binding and lib using @5iver script, when you´re ready. (I´m sitter here the next coupple of hours).

I meant to add, we need to enable trace logging, and disable some other logging…

log:set TRACE com.zsmartsystems.zigbee.zigbeenode
log:set TRACE com.zsmartsystems.zigbee.zigbeeendpoint
log:set TRACE com.zsmartsystems.zigbee.zcl.zclcluster
log:set INFO com.zsmartsystems.zigbee.dongle.ember.internal.ash

This just enables a couple of extra lines of logging, and also removes the ASH logging for now as that creates a lot of noise in the log…

I probably won’t get the binding update tonight, but the library should be done shortly (20 minutes or so). The openhab repos seem to have some sort of CI issue at the moment, so I need to get this resolved first…

I guess you want to disable DEBUG loglevel for com.zsmartsystems.zigbee then?

I ´m still learning this logging thing… This is how my logging is now, which I believe DEBUG log everything in com.zsmartsystems.zigbee.

# Zigbee
log4j2.logger.ZSmart.name = com.zsmartsystems.zigbee
log4j2.logger.ZSmart.level = DEBUG
log4j2.logger.ZSmart.additivity = false
log4j2.logger.ZSmart.appenderRefs = ZSmart
log4j2.logger.ZSmart.appenderRef.ZSmart.ref = ZIGBEE

If my understandings are correct I´ll have to change it to something like this:

# Zigbee
log4j2.logger.ZSmart.name = com.zsmartsystems.zigbee.zigbeenode
log4j2.logger.ZSmart.level = TRACE
log4j2.logger.ZSmart.additivity = false
log4j2.logger.ZSmart.appenderRefs = ZSmart
log4j2.logger.ZSmart.appenderRef.ZSmart.ref = ZIGBEE

# Zigbee
log4j2.logger.ZSmart.name = com.zsmartsystems.zigbee.zigbeeendpoint
log4j2.logger.ZSmart.level = TRACE
log4j2.logger.ZSmart.additivity = false
log4j2.logger.ZSmart.appenderRefs = ZSmart
log4j2.logger.ZSmart.appenderRef.ZSmart.ref = ZIGBEE

# Zigbee
log4j2.logger.ZSmart.name = com.zsmartsystems.zigbee.zcl.zclcluster
log4j2.logger.ZSmart.level = TRACE
log4j2.logger.ZSmart.additivity = false
log4j2.logger.ZSmart.appenderRefs = ZSmart
log4j2.logger.ZSmart.appenderRef.ZSmart.ref = ZIGBEE

# Zigbee
log4j2.logger.ZSmart.name = com.zsmartsystems.zigbee.dongle.ember.internal.ash
log4j2.logger.ZSmart.level = INFO
log4j2.logger.ZSmart.additivity = false
log4j2.logger.ZSmart.appenderRefs = ZSmart
log4j2.logger.ZSmart.appenderRef.ZSmart.ref = ZIGBEE

Is this correct…

I´ll still debug the zigbee binding, right?

No - leave that as debug level otherwise we loose a bunch of logging. I just want to increase logging in specific classes (and stop in in the ASH layer).

Yes, I think this looks ok…

Thanks.

Done… Do you want an sample? :smile:

Sure - why not :slight_smile:

If you want to update the libraries, this could already be useful… Latest version is now 1.1.9.

Hang on… The log files is still debug logging… I´m not sure why… Do I need to restart openhab?

I’m not 100% sure - possibly it might be needed if you are changing the definition. You could change them using the karaf console and the commands I posted above, and this should work without a restart.

Just did… It´s just that the logfile just shows [DEBUG] logs. I thought that would be [TRACE]

EDIT. The ash seem to be gone… So I guess its okay…
Here is a sample, (last few minutes of the log)

zigbee_log.rar.txt (341.6 KB)

It’s probably ok - without the new libraries we won’t see any TRACE level logging anyway, so we’ll hopefully see this after the update.

Hmm just ran the script… I get this warning, and it doesnt seem to run:

2019-01-13 22:34:57.473 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.zigbee.ember-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zigbee.ember [268]
  Unresolved requirement: Import-Package: com.zsmartsystems.zigbee.dongle.ember
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]

Got the same error for all coordinators I think

2019-01-13 22:34:57.494 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.zigbee.telegesis-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zigbee.telegesis [269]
  Unresolved requirement: Import-Package: com.zsmartsystems.zigbee.dongle.telegesis
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]
2019-01-13 22:34:57.545 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.zigbee.telegesis-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zigbee.telegesis [269]
  Unresolved requirement: Import-Package: com.zsmartsystems.zigbee.dongle.telegesis
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]
2019-01-13 22:34:57.567 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.zigbee.ember-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zigbee.ember [268]
  Unresolved requirement: Import-Package: com.zsmartsystems.zigbee.dongle.ember
	at org.eclipse.osgi.container.Module.start(Module.java:444) ~[?:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [10:org.apache.felix.fileinstall:3.6.4]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [10:org.apache.felix.fileinstall:3.6.4]

I’m not sure - are these bundles listed if you list the bundles in karaf?

Yep!

openhab> bundle:list -s |grep -i zig
262 x Active    x  80 x 1.1.9                  x com.zsmartsystems.zigbee
263 x Active    x  80 x 2.5.0.201901121331     x org.openhab.binding.zigbee
264 x Active    x  80 x 2.5.0.201901121331     x org.openhab.binding.zigbee.xbee
265 x Active    x  80 x 2.5.0.201901121331     x org.openhab.binding.zigbee.cc2531
266 x Active    x  80 x 1.1.9                  x com.zsmartsystems.zigbee.dongle.cc2531
267 x Active    x  80 x 1.1.9                  x com.zsmartsystems.zigbee.dongle.xbee
268 x Installed x  80 x 2.5.0.201901121331     x org.openhab.binding.zigbee.ember
269 x Installed x  80 x 2.5.0.201901121331     x org.openhab.binding.zigbee.telegesis
openhab>

I could try an restart?