[miele] Allow hostname as gateway network address (#13147)

* 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>
This commit is contained in:
Jacob Laursen 2022-07-20 16:13:16 +02:00 committed by GitHub
parent da3ec664e5
commit d2670e40cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 27 deletions

View File

@ -43,27 +43,25 @@ discovery.miele:removalGracePeriod=30
## Thing Configuration
### Thing Configuration for Miele XGW3000
| 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. |
### 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.
Once you got hold of the IDs, a manual configuration looks like this:
```
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"]
}
```
## Channels
### Raw values

View 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);
}
}
};

View 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