ZigBee binding updates

In the coming days, I hope to be able to merge some changes into the ZigBee binding. Most of these won’t really impact anyone (hopefully - if all goes well!), but the network status file (saved into the network.xml file in the userdata/zigbee folder) will be changed to use a different format. Instead of saving all data into a single file (which caused performance problems - especially on low end machines), I now save each node into a separate file. This change may mean that devices stop working - hopefully they will come back and be rediscovered by themselves, and you can help this by turning lights off/on which will cause the device to send out a message allowing it to be rediscovered.

Battery devices can be more problematic since they are sleeping and they may need to be woken up manually to allow rediscovery.

Sorry for the inconvenience with this, but it should I hope improve performance considerably.

There are a number of other changes in the code which should improve performance and robustness. If you’ve been running a recent snapshot of the Z-Smart Systems library, then most of these will already be included (for example the improved transaction management), but if you find any issues, please let me know.

Cheers
Chris

6 Likes

Note that this is now merged along with a number of other updates…

Status from here:
I gave it a shot a coupple of hours ago using 5ivers manual update script. It installed lib 1.2.1. I believe thats it.

All my installed devices changed to status “Gone”. So I deleted them, and re-added them one by one.

The two Philips Hue devices, Dimmer Switch and motion sensor are running fine (thats the Philips SML001 which we talked about in another thread which may suffer from network/interference problems).
The Xiaomi Aqara door/window sensor runs fine. (tapping the button on the device several times will during scanning will add it correctly. But there still doesnt seem to be a battery channel, only a switch channel. I dont know if it even has a battery channel, but I would suspect it does, since a battery device without a battery channel is not such a great idea).
The Trust motion sensor is running fine. (this has always been a troubbled device)
And the Osram plug is running fine as well, (this has been given me lots of troubble lately).

I havn´t tried any of the Xiaomi MI door/window sensors, yet.

I´ll let it run and see what happens. If everything goes like it used to, the Trust sensor as well as the Osram plug will turn to offline within a coupple a days, (mayb even a few hours) and never return back online. The philips hue devices may or may not work for longer, and maybe they wont even survive a restart of openhab. The Xiaomi Aqara sensor have been the most stable devices in several months - Go figure!! :face_with_raised_eyebrow:

Oh, forgot to mention… I have the DEBUG log running allright.

1 Like

New status, which is abnormal from my previous experiences…
Everything seems to work fine even after 3 days. Thats something I cant say I have been experienced before. Thats good news.
One thing I have noticed though… It seems like the devices change state to offline, (I guess it´s kind of deep sleep), and as soon as they get activated, they´ll change to online, and the new state will change allright.
This is the logfile (tail log):

2019-08-01 22:09:36.558 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE
2019-08-01 22:16:08.688 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from ONLINE to OFFLINE
2019-08-01 22:18:16.209 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from OFFLINE to ONLINE
2019-08-01 22:25:11.884 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from ONLINE to OFFLINE
2019-08-01 22:33:14.751 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from OFFLINE to ONLINE
2019-08-01 22:36:56.321 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from ONLINE to OFFLINE
2019-08-01 22:38:14.382 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from OFFLINE to ONLINE
2019-08-01 22:44:43.950 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from ONLINE to OFFLINE
2019-08-01 22:58:12.732 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from OFFLINE to ONLINE
2019-08-01 23:09:31.342 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from ONLINE to OFFLINE
2019-08-01 23:13:11.397 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from OFFLINE to ONLINE
2019-08-01 23:13:26.917 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:7cb03eaa00a05370' changed from OFFLINE to ONLINE
2019-08-01 23:18:39.134 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from ONLINE to OFFLINE
2019-08-01 23:23:18.045 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from OFFLINE to ONLINE
2019-08-01 23:24:23.175 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from ONLINE to OFFLINE
2019-08-01 23:28:09.945 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from OFFLINE to ONLINE
2019-08-01 23:28:39.342 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from ONLINE to OFFLINE
2019-08-01 23:40:40.389 [hingStatusInfoChangedEvent] - 'zigbee:philips_sml001:68d9cf9c:0017880102139d00' changed from OFFLINE to ONLINE
2019-08-01 23:43:56.962 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:7cb03eaa00a05370' changed from ONLINE to OFFLINE
2019-08-01 23:46:19.516 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from OFFLINE to ONLINE
2019-08-01 23:46:30.310 [hingStatusInfoChangedEvent] - 'zigbee:philips_rwl021:68d9cf9c:001788011032a21b' changed from OFFLINE to ONLINE
2019-08-01 23:46:55.777 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE
2019-08-01 23:47:02.584 [hingStatusInfoChangedEvent] - 'zigbee:philips_rwl021:68d9cf9c:001788011032a21b' changed from ONLINE to OFFLINE
2019-08-01 23:47:05.196 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from OFFLINE to ONLINE
2019-08-01 23:47:17.748 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE
2019-08-01 23:47:41.178 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from OFFLINE to ONLINE
2019-08-01 23:47:42.293 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE
2019-08-01 23:48:02.627 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from OFFLINE to ONLINE
2019-08-01 23:48:02.642 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from OFFLINE to ONLINE
2019-08-01 23:48:02.653 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE
2019-08-01 23:48:02.699 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE
2019-08-01 23:48:26.826 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from OFFLINE to ONLINE
2019-08-01 23:48:28.435 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE
2019-08-01 23:48:48.560 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from OFFLINE to ONLINE
2019-08-01 23:48:55.102 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE
2019-08-01 23:49:21.200 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from OFFLINE to ONLINE
2019-08-01 23:49:40.933 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE
2019-08-01 23:49:49.980 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from OFFLINE to ONLINE
2019-08-01 23:50:03.643 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE
2019-08-01 23:50:09.746 [hingStatusInfoChangedEvent] - 'zigbee:philips_rwl021:68d9cf9c:001788011032a21b' changed from OFFLINE to ONLINE
2019-08-01 23:50:11.815 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from OFFLINE to ONLINE
2019-08-01 23:50:17.488 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d000236eb75' changed from OFFLINE to ONLINE
2019-08-01 23:50:22.034 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:7cb03eaa00a05370' changed from OFFLINE to ONLINE
2019-08-01 23:50:25.961 [hingStatusInfoChangedEvent] - 'zigbee:device:68d9cf9c:00158d00019533d3' changed from ONLINE to OFFLINE

I havn´t tried, but I believe this can become a problem, if someone has a rule running to check for the things status.

Beside this, it seems to be very stable this time.

1 Like

Absolutely :slight_smile: . I won’t celebrate just yet, but at least it’s promising.

Thanks - I think I’ve seen this here as well so I’ll take a look at this. This timeout is a feature that DT added a little while ago and may not be fully fleshed out under all circumstances.

Yes, this is correct - if a device is OFFLINE, then openHAB will block all commands being sent to the binding, so the binding will not send the commands to the device.

It´s alot better than I have seen since… Hmm, I was about to say ever, but I think I recall a short periode in openhab 2.4 where things worked for a longer periode :slight_smile:

So its a timeout causing the device to go offline?
For the Philips Hue motion sensor, and the Trust sense, something trigger it to turn online again by itself. if its a device like the Philips Dimmer Switch. I press one of the buttons, it turn to online, and the trigger comes through fine. Same goes for the Xiaomi Aqara door/window sensor. If I force the contact, it will turn to online state. They´re simply waking up from the “dead”, (sounds like a bad movie :slight_smile: ).

The system uses a timer that is twice the reporting period, or twice the polling period (plus a little bit of margin for good luck). I need to check why this is happening so can’t really comment too much at the moment, but it should be set to ONLINE whenever an update is received (which should be at the reporting rate), and will be set OFFLINE if there is no reports when expected.

If you have a debug log (since you said this was running above), then I’m happy to take a look. I will be travelling over the coming days so can spend some time reviewing logs rather than watching the inflight entertainment :wink:

Lets see if I can make these uploads…
Otherweise I´ll poste more messages. Or mayby mail it to you…

zigbee logging1.rar.txt (923.6 KB)

zigbee logging2.rar.txt (814.6 KB)

zigbee logging3.rar.txt (791.7 KB)

zigbee logging4.rar.txt (760.5 KB)

zigbee logging5.rar.txt (793.8 KB)

Thanks - I’ve grabbed these and will try and look at them tomorrow on the flight…

Take your time… You probably dont need all of them, as the on/offline issue seems to be very common… But you shouldn´t be bored on your flight :slight_smile:

I managed to crash the Zigbee connection just before I went to bed :frowning: I installed another binding (ipcamera) as well as ffmpeg, then zigbee stopped working (without any notice). I then removed ffmpeg again, (and also did an autoremove of pakckages not in use which may have been a huge mistake). After that I cant even get the Zigbee binding to accept the USB port anymore… Pretty weird…
I´ll be struggling with it during the weekend and hopefully get things working again.

I’ve had a look at the OFFLINE issue and I think I see a problem - it’s not super obvious, and I suspect it’s a thread synchronisation issue so will wait to get it reviewed by the guy who wrote that part of the code.

Sounds good Chris…
I got the Zibee up running again, (had to start all over by removing the coordinator, I still havnt found the reason)… And it has been running fine again for 2 days, (except the on/offline issue ofcouse).