]> git.basschouten.com Git - openhab-addons.git/commitdiff
[miele] Allow hostname as gateway network address (#13147)
authorJacob Laursen <jacob-github@vindvejr.dk>
Wed, 20 Jul 2022 14:13:16 +0000 (16:13 +0200)
committerGitHub <noreply@github.com>
Wed, 20 Jul 2022 14:13:16 +0000 (16:13 +0200)
* Allow hostname as gateway network address
* Document configuration parameters for things
* Add message for bridge communication error

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
bundles/org.openhab.binding.miele/README.md
bundles/org.openhab.binding.miele/src/main/java/org/openhab/binding/miele/internal/handler/MieleBridgeHandler.java
bundles/org.openhab.binding.miele/src/main/resources/OH-INF/i18n/miele.properties

index 31a69d669952e998b754b973b4a5e46bfe2512e1..b2fb5b4bff24edc985fa6783b1d2b2c300dcaa38 100644 (file)
@@ -43,26 +43,24 @@ discovery.miele:removalGracePeriod=30
 
 ## Thing Configuration
 
-Each appliance needs the device UID as a configuration parameter.
-The UID is nowhere to be found on the appliances, but since the discovery works quite reliably, a manual configuration is not needed.
+### Thing Configuration for Miele XGW3000
 
-Once you got hold of the IDs, a manual configuration looks like this:
+| Configuration Parameter | Description   |
+|-------------------------|---------------|
+| ipAddress               | Network address of the Miele@home gateway |
+| interface               | Network address of openHAB host interface where the binding will listen for multicast events coming from the Miele@home gateway. |
+| userName                | Name of a registered Miele@home user. |
+| password                | Password for the registered Miele@home user. |
+| language                | Language for state, program and phase texts. Leave blank for system language. |
 
-```
-Bridge miele:xgw3000:dilbeek [ipAddress="192.168.0.18", interface="192.168.0.5"] {
-Things:
-Thing fridgefreezer freezer [uid="00124b000424be44#2"]
-Thing hood hood [uid="001d63fffe020685#210"]
-Thing fridge fridge [uid="00124b000424bdc0#2"]
-Thing oven oven [uid="001d63fffe020390#210"]
-Thing oven microwave [uid="001d63fffe0206eb#210"]
-Thing hob hob [uid="00124b000424bed7#2"]
-Thing dishwasher dishwasher [uid="001d63fffe020683#210"]
-Thing tumbledryer dryer [uid="001d63fffe0200ba#210"]
-Thing washingmachine washingmachine [uid="001d63fffe020505#210"]
-Thing coffeemachine coffeemachine [uid="001d63fffe020505#190"]
-}
-```
+### Thing Configuration for appliance
+
+| Configuration Parameter | Description   |
+|-------------------------|---------------|
+| uid                     | Unique identifier for specific appliance on the gateway. |
+
+Each appliance needs the device UID as a configuration parameter.
+The UID is nowhere to be found on the appliances, but since the discovery works quite reliably, a manual configuration is not needed.
 
 ## Channels
 
index bb14464e4295a372298af760c52a6175148f6909..eaae358d296c38525830a6b7b2ad64d68f8e9545 100644 (file)
@@ -137,11 +137,6 @@ public class MieleBridgeHandler extends BaseBridgeHandler {
                     "@text/offline.configuration-error.ip-multicast-interface-not-set");
             return false;
         }
-        if (!IP_PATTERN.matcher((String) config.get(HOST)).matches()) {
-            updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.CONFIGURATION_ERROR,
-                    "@text/offline.configuration-error.invalid-ip-gateway [\"" + config.get(HOST) + "\"]");
-            return false;
-        }
         if (!IP_PATTERN.matcher((String) config.get(INTERFACE)).matches()) {
             updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.CONFIGURATION_ERROR,
                     "@text/offline.configuration-error.invalid-ip-multicast-interface [\"" + config.get(INTERFACE)
@@ -210,17 +205,20 @@ public class MieleBridgeHandler extends BaseBridgeHandler {
                 }
             } catch (MieleRpcException e) {
                 Throwable cause = e.getCause();
+                String message;
                 if (cause == null) {
-                    logger.debug("An exception occurred while polling an appliance: '{}'", e.getMessage());
+                    message = e.getMessage();
+                    logger.debug("An exception occurred while polling an appliance: '{}'", message);
                 } else {
+                    message = cause.getMessage();
                     logger.debug("An exception occurred while polling an appliance: '{}' -> '{}'", e.getMessage(),
-                            cause.getMessage());
+                            message);
                 }
                 if (lastBridgeConnectionState) {
                     logger.debug("Connection to Miele Gateway {} lost.", host);
                     lastBridgeConnectionState = false;
                 }
-                updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR);
+                updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR, message);
             }
         }
     };
index 1a04ee1c89001c111e5b1f1a9af2d38cf78cfdce..2fc16547e37fe661b183798370a3f68950c30934 100644 (file)
@@ -128,7 +128,6 @@ channel-type.miele.waterConsumption.description = Water consumption by the curre
 offline.configuration-error.bridge-missing = Bridge is missing
 offline.configuration-error.ip-address-not-set = Cannot connect to the Miele gateway: host IP address is not set.
 offline.configuration-error.ip-multicast-interface-not-set = Cannot connect to the Miele gateway: multicast interface is not set.
-offline.configuration-error.invalid-ip-gateway = Invalid IP address for the Miele@Home gateway: {0}
 offline.configuration-error.invalid-ip-multicast-interface = Invalid IP address for the multicast interface: {0}
 offline.configuration-error.invalid-language = Invalid language: {0}
 offline.configuration-error.uid-not-set = Appliance ID is not set