From 282f9244833a8bbbd46e059e9338481e237f684a Mon Sep 17 00:00:00 2001 From: Chris Jackson Date: Thu, 21 Feb 2019 07:23:45 -0600 Subject: [PATCH] Add Ember concentrator configuration (#397) Signed-off-by: Chris Jackson --- .../ESH-INF/thing/controller_ember.xml | 11 +++++++++++ .../zigbee/ember/handler/EmberHandler.java | 17 +++++++++++++++++ .../ember/internal/EmberConfiguration.java | 1 + org.openhab.binding.zigbee/README.md | 6 ++++++ 4 files changed, 35 insertions(+) diff --git a/org.openhab.binding.zigbee.ember/ESH-INF/thing/controller_ember.xml b/org.openhab.binding.zigbee.ember/ESH-INF/thing/controller_ember.xml index 3ef04e25d..87d0eff57 100644 --- a/org.openhab.binding.zigbee.ember/ESH-INF/thing/controller_ember.xml +++ b/org.openhab.binding.zigbee.ember/ESH-INF/thing/controller_ember.xml @@ -204,6 +204,17 @@ + + + + The type of concentrator used by the coordinator + true + 0 + + + + + diff --git a/org.openhab.binding.zigbee.ember/src/main/java/org/openhab/binding/zigbee/ember/handler/EmberHandler.java b/org.openhab.binding.zigbee.ember/src/main/java/org/openhab/binding/zigbee/ember/handler/EmberHandler.java index fcc17eda4..d238a02d0 100644 --- a/org.openhab.binding.zigbee.ember/src/main/java/org/openhab/binding/zigbee/ember/handler/EmberHandler.java +++ b/org.openhab.binding.zigbee.ember/src/main/java/org/openhab/binding/zigbee/ember/handler/EmberHandler.java @@ -32,7 +32,10 @@ import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspConfigId; import com.zsmartsystems.zigbee.serialization.DefaultDeserializer; import com.zsmartsystems.zigbee.serialization.DefaultSerializer; +import com.zsmartsystems.zigbee.transport.ConcentratorConfig; +import com.zsmartsystems.zigbee.transport.ConcentratorType; import com.zsmartsystems.zigbee.transport.TransportConfig; +import com.zsmartsystems.zigbee.transport.TransportConfigOption; import com.zsmartsystems.zigbee.transport.ZigBeePort; import com.zsmartsystems.zigbee.transport.ZigBeePort.FlowControl; import com.zsmartsystems.zigbee.transport.ZigBeeTransportFirmwareCallback; @@ -142,6 +145,20 @@ public void initialize() { TransportConfig transportConfig = new TransportConfig(); + // Configure the concentrator + // Max Hops defaults to system max + ConcentratorConfig concentratorConfig = new ConcentratorConfig(); + if (config.zigbee_concentrator == 1) { + concentratorConfig.setType(ConcentratorType.HIGH_RAM); + } else { + concentratorConfig.setType(ConcentratorType.LOW_RAM); + } + concentratorConfig.setMaxFailures(8); + concentratorConfig.setMaxHops(0); + concentratorConfig.setRefreshMinimum(60); + concentratorConfig.setRefreshMaximum(3600); + transportConfig.addOption(TransportConfigOption.CONCENTRATOR_CONFIG, concentratorConfig); + startZigBee(dongle, transportConfig, DefaultSerializer.class, DefaultDeserializer.class); Runnable pollingRunnable = new Runnable() { diff --git a/org.openhab.binding.zigbee.ember/src/main/java/org/openhab/binding/zigbee/ember/internal/EmberConfiguration.java b/org.openhab.binding.zigbee.ember/src/main/java/org/openhab/binding/zigbee/ember/internal/EmberConfiguration.java index 98346b7b3..56645f474 100644 --- a/org.openhab.binding.zigbee.ember/src/main/java/org/openhab/binding/zigbee/ember/internal/EmberConfiguration.java +++ b/org.openhab.binding.zigbee.ember/src/main/java/org/openhab/binding/zigbee/ember/internal/EmberConfiguration.java @@ -20,4 +20,5 @@ public class EmberConfiguration { public Integer zigbee_flowcontrol; public Integer zigbee_powermode; public Integer zigbee_childtimeout; + public Integer zigbee_concentrator; } diff --git a/org.openhab.binding.zigbee/README.md b/org.openhab.binding.zigbee/README.md index 390c082e6..9dd32f6c7 100644 --- a/org.openhab.binding.zigbee/README.md +++ b/org.openhab.binding.zigbee/README.md @@ -43,6 +43,12 @@ Once a child is removed from the child table of a router, it will be asked to re Note that ZigBee compliant devices should rejoin the network seamlessly, however some non-compliant devices may not rejoin which may leave them unusable without a manual rejoin. +##### Concentrator Type (zigbee_concentrator) + +The Concentrator is used to improve routing within a ZigBee network, and is especially useful in a network where much of the traffic is sent to or from a central coordinator. If the coordinator has sufficient memory, it can store routing information, thus reducing network traffic. + +If supported, the High RAM concentrator should be used. + ##### Mesh Update Period (zigbee_meshupdateperiod) The binding is able to search the network to get a list of what devices can communicate with other devices. This is a useful diagnostic feature as it allows users to see the links between devices, and the quality of these links. However, this can generate considerable traffic, and some battery devices may not poll their parents often enough to provide these updates, and users may consider that it is better to reduce the period, or disable this feature.