diff --git a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/handler/HydrawiseControllerHandler.java b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/handler/HydrawiseControllerHandler.java index 3b24fc5818f99..087b939ba7d18 100644 --- a/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/handler/HydrawiseControllerHandler.java +++ b/bundles/org.openhab.binding.hydrawise/src/main/java/org/openhab/binding/hydrawise/internal/handler/HydrawiseControllerHandler.java @@ -274,9 +274,15 @@ private void updateController(Controller controller) { private void updateZones(List zones) { AtomicReference anyRunning = new AtomicReference(false); AtomicReference anySuspended = new AtomicReference(false); - int i = 1; for (Zone zone : zones) { - String group = "zone" + (i++); + // there are 12 relays per expander, expanders will have a zoneNumber like: + // 10 for expander 0, relay 10 = zone10 + // 101 for expander 1, relay 1 = zone13 + // 212 for expander 2, relay 12 = zone36 + // division of integers in Java give whole numbers, not remainders FYI + int zoneNumber = ((zone.number.value / 100) * 12) + (zone.number.value % 100); + + String group = "zone" + zoneNumber; zoneMaps.put(group, zone); logger.trace("Updateing Zone {} {} ", group, zone.name); updateGroupState(group, CHANNEL_ZONE_NAME, new StringType(zone.name));