openhab/org.openhab.binding.zigbee

Reminder for newer Z-Smart systems versions

Closed this issue · 2 comments

In the ZigBeeCoordinatorHandler the order of initializing the ZigbeeNetworkManager and adding extensions to it has to be changed, because is is now checked that the network is in INITIALIZING state before adding extensions:

ZigBeeDiscoveryExtension discoveryExtension = new ZigBeeDiscoveryExtension();
discoveryExtension.setUpdatePeriod(meshUpdateTime);
networkManager.addExtension(discoveryExtension);
networkManager.addExtension(new ZigBeeIasCieExtension());
networkManager.addExtension(new ZigBeeOtaUpgradeExtension());
// Add any listeners that were registered before the manager was registered
synchronized (nodeListeners) {
for (ZigBeeNetworkNodeListener listener : nodeListeners) {
networkManager.addNetworkNodeListener(listener);
}
}
synchronized (announceListeners) {
for (ZigBeeAnnounceListener listener : announceListeners) {
networkManager.addAnnounceListener(listener);
}
}
// Initialise the network
switch (networkManager.initialize()) {
case SUCCESS:
break;
case BAD_RESPONSE:
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, ZigBeeBindingConstants.OFFLINE_BAD_RESPONSE);
return;
case COMMUNICATION_ERROR:
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, ZigBeeBindingConstants.OFFLINE_COMMS_FAIL);
return;
default:
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE,
ZigBeeBindingConstants.OFFLINE_INITIALIZE_FAIL);
return;
}

The same applies if we want to add all supported clusters to the network manager, this has to be done AFTER initializing the network manager as well.

Thanks Stefan,
Yes, this is understood and I will mop this up over Christmas when I migrate to the new ZSS libraries.

Have a good Christmas.

Cheers
Chris

Closed by #517