diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRErrorStatus.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRErrorStatus.java index 3d14c32afaa94..a197777038b33 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRErrorStatus.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRErrorStatus.java @@ -44,6 +44,10 @@ public enum DSMRErrorStatus { * Serial port doesn't support the configured settings. */ PORT_NOT_COMPATIBLE(true), + /** + * Serial port time out or illegal state. + */ + PORT_PORT_TIMEOUT(false), /** * Reading data from the serial port failed. */ diff --git a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialConnector.java b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialConnector.java index 550325e00ca2c..5e7dbb014f36d 100644 --- a/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialConnector.java +++ b/bundles/org.openhab.binding.dsmr/src/main/java/org/openhab/binding/dsmr/internal/device/connector/DSMRSerialConnector.java @@ -172,6 +172,10 @@ public void open(final DSMRSerialSettings portSettings) { logger.warn("Possible bug because a new serial port value was set during opening new port."); errorStatus = DSMRErrorStatus.PORT_INTERNAL_ERROR; } + } catch (final IllegalStateException ise) { + logger.debug("Failed communicating, probably time out", ise); + + errorStatus = DSMRErrorStatus.PORT_PORT_TIMEOUT; } catch (final IOException ioe) { logger.debug("Failed to get inputstream for serialPort", ioe);