Zigbee binding

Sorry, but I need this as a log file - the PDF can’t be processed using the tools I have. If you can provide it as a log file, but rename the filename to PDF? Alternatively, maybe you can put it somewhere like dropbox?

I don’t use the CC2531 so am not in a good position to advise on this other than what is written in the documentation. Maybe someone else can answer this.

On what is in the documentation, but it is not complete as it relies on people providing this information.

Done.
openhab.log.pdf (607.2 KB)

Hi @Kergilo

Most devices will work with the Pro-Secure_Standard, but others (such as Xiaomi devices) will only join with the LinkKeyJoin version (at least in my experience).

If you plan to use ZigBee for a big network (both by extension or by number of devices), or for something other than tweaking, I would advise you not to use the cc2531:

  • Limited number of devices (due to RAM constraints)
  • Poor antenna and Tx/Rx power

I switched to the LRS version of the Telegesis dongle, and the usabilty and stability of my network has nothing to do (in the good sense) with when I was using the cc2531 dongle.

Pedro

Where can I check this?

I will look about the telegesis dongle. Do I need to install the firmware like I did with the cc2531?

Which dongle do you use? The telegesis one?

Trial and error… :slight_smile:

I think it comes with a useable firmware (mine did), but in any case you do not need a separate programmer.

Pedro

What is the constraint here? Is it really a constraint on the coordinator (normally not) or just the number of end devices and routers that the coordinator can allow to connect directly? This is a normal limitation of every coordinator and it doesn’t limit the overall number of devices that may reside on the network.

I use Telegesis and Ember. Telegesis is probably the best right now as there are a few issues with Ember, but in the longer term, Ember is expected to be better as Telegesis will likely not be updated to support ZigBee 3 (although I’m not 100% sure of that, but I don’t think Silabs will be updating the firmware. The hardware is the same (ie the Telegesis dongle is actually an Ember chipset).

Telegesis does not require firmware to be loaded - it comes pre-loaded (Ember does require firmware loading).

I suppose that you are talking about the ETRX357 LRS (Telegesis) and the EM358 (Ember) right?.
Do they work well in windows and linux/raspberry?

Is hard to find the Ember firmware?

Yes - either the LRS or the standard version (NG I think).

There are a few options - EM358x and EM357. Both are still available, but if you buy the MeshConnect USB stick, then they do not come with any firmware and they are not easy to program. I can program them if needed.

Yes, there is also a RPi daughter board from EleLabs -:

This comes programmed.

Yes - unfortunately it’s not available without the developers kit. I can make it available though, and once programmed once, the binding is able to perform firmware updates.

It is a limitation in the number of routes the cc2531 can hold in memory. When the amount of devices grows, it cannot remember more than 10-20 routes so it needs to start discovering routes for mostly everything. It should be OK, but again when the network is too big I saw route discovery storms producing noticeable lags when sending commands (when not lost due to timeouts).

Also, even if keeping low the size of the routing tables, when the amount of devices grow I started to see memory errors in the dongle responses. As the stack is closed code, I cannot debug further than that.

With the firmware settings I compiled it is somehow better, but again at about 30-something devices I start getting memory errors from time to time.

This, together with its poor Tx/Rx perfomance, made my network unusable, so I moved to Telegesis.

Pedro

That gave me an idea and I tried to install that firmware. It works :grin:
The problem now is that I can’t see the data of the sensors (temperature/humidity and door state). I have done the following:

ITEM:

Number Sensor1_Temperatura "Temperatura" { channel="zigbee:device:9db67dc9:00158d00020097a3:00158D00020097A3_1_measurement_temperature" } 
Number Sensor1_Humedad "Humedad" {channel="zigbee:device:9db67dc9:00158d00020097a3:00158D00020097A3_1_measurement_relativehumidity"}
Number Sensor1_Nivel_Bateria "Nivel de la bateria 1" {channel="zigbee:device:9db67dc9:00158d00020097a3:00158D00020097A3_1_battery_level"}

Contact Sensor2_Puerta "Sensor de puerta" {channel="zigbee:device:9db67dc9:000d6f000fa0d813:000D6F000FA0D813_1_ias_contactportal1"}
Number Sensor2_Nivel_Bateria "Nivel de la bateria 2" {channel="zigbee:device:9db67dc9:000d6f000fa0d813:000D6F000FA0D813_1_battery_level"}

SITEMAP:

    Frame label="Prueba de Zigbee" 
    {
        Text item=Sensor2_Puerta label="Sensor de la puerta" icon="wallswitch"
        Text item=Sensor2_Nivel_Bateria label="Nivel de la bateria 2" icon="energy"

        Text item=Sensor1_Temperatura label="Temperatura" icon="temperature"
        Text item=Sensor1_Humedad label="Humedad"
        Text item=Sensor1_Nivel_Bateria label="Nivel de la bateria 1" icon="energy"
    }

Is the linking like I did?

When you look at these “things” in the UI, are the channels present, and are the devices shown as ONLINE ?

Yes, they are.
image

Could you please turn on debugging then and show the logs?

Updated: I see in your sitemap that you may not be showing the values even if these exist.

Could you first add to all the labels for Number items something like:

label="Humedad [%.1f]"

Please note the “[%.1f]

Yes, I believe so.

I’m not so keen on this. It means we go back to the OH1 style of defining devices and require users to configure everything manually. For starters, this goes against OH2 principals which allows everything to be defined through the UI, and secondly it means that people need to understand more about ZigBee, clusters etc and it’s much less “plug and play”.

Fundamentally, the two ideas are the same - it’s just a question of where the data is defined. I want to keep the number of statically defined devices to a minimum, but I think where they are defined, they should be done in a way that doesn’t require the user to be a ZigBee expert.

I think for this specific device, if I understand correctly, all we need to do is to add extra clusters to the endpoint that were not defined in the simple descriptor. If so, I will have a look at this, but I think that the method you’ve proposed initially should be fine.

It’s big so I uploaded it to mediafire.
http://www.mediafire.com/file/slmdeoeec4ooim1/openhab.log/file

I did but nothing changes:

The strangest thing is that I can see some values on HABmin:

  • Device 1

  • Device 2

I have also seen that it has a huge delay. I was opening and closing the door sensor and it’s about 1 to 3 seconds of delay between I do that and I can see it in HABmin. Is that normal?

The logfile does show the data being received and updated -:



There are two devices in here, but both seem to have updates.

The fact that HABmin is displaying the data, and the log indicates that data is received, seems to point at an issue outside of the binding…

I pressed both devices buttom “refresh item” on HABmin and now I can see all the values on HABmin and on the BasicUI. If both devices change their states I can see them too. I don’t know why I needed to push this buttom but it works so I’m happy now :smile:
Thank you for you help ^^

1 Like

Sorry about asking too much but I really don’t understand what’s happening.

I tried to restart openhab to check if all was still working good but it wasn’t. I couldn’t see any data of any device. Then I tried to refresh them and nothing. After that I tried to unplug the battery on each one and plug in again and now I can see all datas. Why is that?. I thought I could see all datas from the beggining or if I hit refresh buttom.

I also tried to include another zigbee device. I did the same as with the others, it was online and on but I couldn’t see any data. I unplugged the battery and plugged in again and now I can see the battery level but not the contact state. What’s happening? :persevere:
Here is my log file:

What could be? Wifi interference? I tried to change channel but nothing changed.

PS1: Do I need to include all devices again when I restart the openhab server?
PS2: If I hit refresh button I should see all new datas right? You can see that I tried many times and nothing changed
PS3: If I can include the Zigbee device, it’s because it has the security that I have in my dongle firmware right?
(CC2531ZNP-Pro-Secure_LinkKeyJoin)

EDIT 1:
I restarted the openhab server again to check it and now I have the following:


What that means?

In future can you provide times that these issues are occurring? If I look at this log, it runs for many hours, and I’m seeing messages with the contact state, but I can’t tell if these messages are happening when you are not seeing them in the UI. This means we can’t decide if this is a UI or system configuration issue, or a binding issue.

I do see contact state updates in this log though.

You shouldn’t.

Not necessarily. Often battery devices don’t respond to the refresh as they sleep most of the time. In theory, ZigBee devices are meant to wake up quite often to poll, but many don’t, and most Chinese devices don’t tend to implement this.

So, no, don’t expect to get an update from battery devices when you send a refresh.

Yes, most ZigBee HA1.2 devices use a standard key (the so called ZigBeeAlliance09 key), so if you can include, then it means the security is working.

I don’t know, sorry. I don’t know where this error has come from, but it looks like a low level issue (eg file system, port access, …).

edit: Note that you can also display the logs using the log viewer on my website. This displays the low level packets that the binding is receiving and sending - it has some limitations, but in general it can show you what the binding receives, so if the UI isn’t updating, but you see the STATE UPDATE messages, then it means the binding is receiving the messages and passing them to OH.

not sure what happened
out of the blue the zigbee binding is not working anymore

image

21:35:49.057 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.zigbee.cc2531.handler.CC2531Handler@1ed4d4e': com/zsmartsystems/zigbee/security/ZigBeeKey
java.lang.NoClassDefFoundError: com/zsmartsystems/zigbee/security/ZigBeeKey
	at org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler.initialize(ZigBeeCoordinatorHandler.java:232) ~[?:?]
	at org.openhab.binding.zigbee.cc2531.handler.CC2531Handler.initialize(CC2531Handler.java:45) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor337.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [99:org.eclipse.smarthome.core:0.10.0.201808011124]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [99:org.eclipse.smarthome.core:0.10.0.201808011124]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
	at java.lang.Thread.run(Thread.java:745) [?:?]
21:35:49.060 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'zigbee:coordinator_cc2531:164b376e862' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
21:35:49.131 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'zigbee:coordinator_cc2531:164b376e862' changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): com/zsmartsystems/zigbee/security/ZigBeeKey
21:35:49.127 [ERROR] [home.core.thing.internal.ThingManager] - Exception occurred while initializing handler of thing 'zigbee:coordinator_cc2531:164b376e862': com/zsmartsystems/zigbee/security/ZigBeeKey
java.lang.NoClassDefFoundError: com/zsmartsystems/zigbee/security/ZigBeeKey
	at org.openhab.binding.zigbee.handler.ZigBeeCoordinatorHandler.initialize(ZigBeeCoordinatorHandler.java:232) ~[?:?]
	at org.openhab.binding.zigbee.cc2531.handler.CC2531Handler.initialize(CC2531Handler.java:45) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor337.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [99:org.eclipse.smarthome.core:0.10.0.201808011124]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [99:org.eclipse.smarthome.core:0.10.0.201808011124]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
	at java.lang.Thread.run(Thread.java:745) [?:?]