diff --git a/bundles/org.openhab.binding.haywardomnilogic/src/main/java/org/openhab/binding/haywardomnilogic/internal/handler/HaywardBridgeHandler.java b/bundles/org.openhab.binding.haywardomnilogic/src/main/java/org/openhab/binding/haywardomnilogic/internal/handler/HaywardBridgeHandler.java index ebaba9f9e..8e3d1d991 100644 --- a/bundles/org.openhab.binding.haywardomnilogic/src/main/java/org/openhab/binding/haywardomnilogic/internal/handler/HaywardBridgeHandler.java +++ b/bundles/org.openhab.binding.haywardomnilogic/src/main/java/org/openhab/binding/haywardomnilogic/internal/handler/HaywardBridgeHandler.java @@ -101,7 +101,6 @@ public class HaywardBridgeHandler extends BaseBridgeHandler { @Override public void initialize() { - updateStatus(ThingStatus.UNKNOWN); initializeFuture = scheduler.schedule(this::scheduledInitialize, 1, TimeUnit.SECONDS); return; } @@ -143,7 +142,10 @@ public class HaywardBridgeHandler extends BaseBridgeHandler { return; } - updateStatus(ThingStatus.ONLINE); + if (this.thing.getStatus() != ThingStatus.ONLINE) { + updateStatus(ThingStatus.ONLINE); + } + logger.debug("Succesfully opened connection to Hayward's server: {} Username:{}", config.endpointUrl, config.username); @@ -350,6 +352,7 @@ public class HaywardBridgeHandler extends BaseBridgeHandler { commFailureCount++; return; } + updateStatus(ThingStatus.ONLINE); } catch (HaywardException e) { logger.debug("Hayward Connection thing: Exception during poll: {}", e.getMessage()); } catch (InterruptedException e) { @@ -424,15 +427,15 @@ public class HaywardBridgeHandler extends BaseBridgeHandler { int status = httpResponse.getStatus(); String xmlResponse = httpResponse.getContentAsString(); - List statusMessages = evaluateXPath("/Response/Parameters//Parameter[@name='StatusMessage']/text()", - xmlResponse); - if (!(statusMessages.isEmpty())) { - statusMessage = statusMessages.get(0); - } else { - statusMessage = httpResponse.getReason(); - } - if (status == 200) { + List statusMessages = evaluateXPath( + "/Response/Parameters//Parameter[@name='StatusMessage']/text()", xmlResponse); + if (!(statusMessages.isEmpty())) { + statusMessage = statusMessages.get(0); + } else { + statusMessage = httpResponse.getReason(); + } + if (logger.isTraceEnabled()) { logger.trace("Hayward Connection thing: {} Hayward http command: {}", getCallingMethod(), urlParameters); @@ -444,7 +447,8 @@ public class HaywardBridgeHandler extends BaseBridgeHandler { if (logger.isDebugEnabled()) { logger.debug("Hayward Connection thing: {} Hayward http command: {}", getCallingMethod(), urlParameters); - logger.debug("Hayward Connection thing: {} Hayward http response: {}", getCallingMethod(), status); + logger.debug("Hayward Connection thing: {} Hayward http response: {} {}", getCallingMethod(), + status, xmlResponse); } return ""; } diff --git a/bundles/org.openhab.binding.haywardomnilogic/src/main/resources/OH-INF/thing/bridge.xml b/bundles/org.openhab.binding.haywardomnilogic/src/main/resources/OH-INF/thing/bridge.xml index 1b5c8f953..51d0a9086 100644 --- a/bundles/org.openhab.binding.haywardomnilogic/src/main/resources/OH-INF/thing/bridge.xml +++ b/bundles/org.openhab.binding.haywardomnilogic/src/main/resources/OH-INF/thing/bridge.xml @@ -13,7 +13,7 @@ url - https://app1.haywardomnilogic.com/HAAPI/HomeAutomation/API.ashx + https://www.haywardomnilogic.com/HAAPI/HomeAutomation/API.ashx The URL of the Hayward API Server