From 217a7b693b4ce276876871dbe3d5ab905c0a7779 Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Sun, 11 May 2025 21:58:06 +0100 Subject: [PATCH 01/15] [linktap]Communications timeout configuration [linktap] Addition of timeout config option Signed-off-by: David Goodyear --- bundles/org.openhab.binding.linktap/README.md | 19 +- .../LinkTapBridgeConfiguration.java | 1 + .../internal/LinkTapBindingConstants.java | 1 + .../internal/LinkTapBridgeHandler.java | 23 +- .../linktap/internal/LinkTapHandler.java | 2 +- .../internal/PollingDeviceHandler.java | 2 +- .../internal/TransactionProcessor.java | 10 +- .../linktap/protocol/http/WebServerApi.java | 32 +- .../resources/OH-INF/i18n/linktap.properties | 639 +++++++++--------- .../resources/OH-INF/thing/thing-types.xml | 12 +- 10 files changed, 380 insertions(+), 361 deletions(-) diff --git a/bundles/org.openhab.binding.linktap/README.md b/bundles/org.openhab.binding.linktap/README.md index 2e0099e3a2f9b..01131762a65f9 100644 --- a/bundles/org.openhab.binding.linktap/README.md +++ b/bundles/org.openhab.binding.linktap/README.md @@ -70,14 +70,15 @@ If the gateway cannot publish to openHAB, then the gateway is checked every 2 mi ### Gateway Configuration -| Name | Type | Description | Recommended Values | Required | Advanced | -|-----------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------|----------| -| host | String | The hostname / IP address of the gateway device | | Yes | No | -| username | String | The username if set for the gateway device | | No | No | -| password | String | The password if set for the gateway device | | No | No | -| enableMDNS | Switch | On connection whether the mDNS responder should be enabled on the gateway device | true | No | Yes | -| enforceProtocolLimits | Switch | If true data outside of the allowed ranges against the protocol will be logged and not sent | true | No | Yes | -| enableJSONComms | Switch | false by default for backwards compatibility, if using up to date firmware with no other local network applications set this to true, for more efficient communications | true | No | Yes | +| Name | Type | Description | Recommended Values | Required | Advanced | +|-----------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------|----------| +| host | text | The hostname / IP address of the gateway device | | Yes | No | +| username | text | The username if set for the gateway device | | No | No | +| password | text | The password if set for the gateway device | | No | No | +| enableMDNS | boolean | On connection whether the mDNS responder should be enabled on the gateway device | true | No | Yes | +| enforceProtocolLimits | boolean | If true data outside of the allowed ranges against the protocol will be logged and not sent | true | No | Yes | +| enableJSONComms | boolean | false by default for backwards compatibility, if using up to date firmware with no other local network applications set this to true, for more efficient communications | true | No | Yes | +| gatewayRequestTimeout | integer | For slow or heavily loaded systems this may need increasing, if communication errors are seen (seconds allowed for responses from the gateway) | 3 | No | Yes | **NOTE** When enableMDNS is enabled, upon connection to the gateway option "Enable mDNS responder" is switched on. @@ -153,7 +154,7 @@ There are 4 different areas of channels: - **Device Model**: Q1 ```java -Bridge linktap:gateway:home "LinkTap GW02" [ host="192.168.0.21", enableMDNS=true, enableJSONComms=false, enforceProtocolLimits=true ] { +Bridge linktap:gateway:home "LinkTap GW02" [ host="192.168.0.21", enableMDNS=true, enableJSONComms=false, enforceProtocolLimits=true, gatewayRequestTimeout=3 ] { Thing device TapValve1 "Outdoor Tap 1" [ id="D71BC52E985B1200_1", name="ValveLinker_1", enableAlerts=true ] Thing device TapValve2 "Outdoor Tap 2" [ id="D71BC52E985B1200_2", name="ValveLinker_2", enableAlerts=true ] Thing device TapValve3 "Outdoor Tap 3" [ id="D71BC52E985B1200_3", name="ValveLinker_3", enableAlerts=true ] diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/configuration/LinkTapBridgeConfiguration.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/configuration/LinkTapBridgeConfiguration.java index ce71ff83064c1..68e9e0d6f0420 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/configuration/LinkTapBridgeConfiguration.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/configuration/LinkTapBridgeConfiguration.java @@ -28,4 +28,5 @@ public class LinkTapBridgeConfiguration { public boolean enableMDNS = true; public boolean enableJSONComms = false; public boolean enforceProtocolLimits = true; + public int gatewayRequestTimeout = 3; } diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java index 48d8c1fd76a91..a1fb6acfb7fe5 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java @@ -59,6 +59,7 @@ public class LinkTapBindingConstants { public static final String BRIDGE_CONFIG_MDNS_ENABLE = "enableMDNS"; public static final String BRIDGE_CONFIG_NON_HTML_COMM_ENABLE = "enableJSONComms"; public static final String BRIDGE_CONFIG_ENFORCE_COMM_LIMITS = "enforceProtocolLimits"; + public static final String BRIDGE_CONFIG_ENABLE_LONG_TIMEOUTS = "enableLongTimeouts"; public static final String DEVICE_PROP_DEV_ID = "deviceId"; public static final String DEVICE_PROP_DEV_NAME = "deviceName"; diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java index 731255c0e0f05..f7d14521d2b49 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java @@ -110,6 +110,7 @@ public class LinkTapBridgeHandler extends BaseBridgeHandler { private volatile long lastGwCommandRecvTs = 0L; private volatile long lastMdnsScanMillis = -1L; private volatile boolean readZeroDevices = false; + private volatile int requestTimeout = 3; private String bridgeKey = ""; private IHttpClientProvider httpClientProvider; @@ -143,6 +144,10 @@ public String getLocalizedText(String key, @Nullable Object @Nullable... argumen return Objects.nonNull(result) ? result : key; } + public int getRequestTimeout() { + return requestTimeout; + } + private void startGwPolling() { synchronized (schedulerLock) { cancelGwPolling(); @@ -379,7 +384,7 @@ public String sendSingleApiRequest(final TLGatewayFrame req) throws TransientCom } final String reqData = LinkTapBindingConstants.GSON.toJson(req); logger.debug("{} = APP BRIDGE -> GW -> Request {}", uid, reqData); - final String respData = api.sendRequest(host, reqData); + final String respData = api.sendRequest(host, config.gatewayRequestTimeout, reqData); logger.debug("{} = APP BRIDGE -> GW -> Response {}", uid, respData); final GatewayDeviceResponse gwResponseFrame = LinkTapBindingConstants.GSON.fromJson(respData, GatewayDeviceResponse.class); @@ -429,7 +434,7 @@ private void connect() { final WebServerApi api = WebServerApi.getInstance(); api.setHttpClient(httpClientProvider.getHttpClient()); try { - final Map bridgeProps = api.getBridgeProperities(bridgeKey); + final Map bridgeProps = api.getBridgeProperities(bridgeKey, config.gatewayRequestTimeout); if (!bridgeProps.isEmpty()) { final String readGwId = bridgeProps.get(BRIDGE_PROP_GW_ID); if (readGwId != null) { @@ -439,7 +444,8 @@ private void connect() { currentProps.putAll(bridgeProps); updateProperties(currentProps); } else { - if (!api.unlockWebInterface(bridgeKey, config.username, config.password)) { + if (!api.unlockWebInterface(bridgeKey, config.gatewayRequestTimeout, config.username, + config.password)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, getLocalizedText("bridge.error.check-credentials")); return; @@ -481,13 +487,13 @@ private void connect() { final String servletEp = BindingServlet.getServletAddress(localServerAddr, getLocalizedText("warning.no-http-server-port")); final Optional servletEpOpt = (!servletEp.isEmpty()) ? Optional.of(servletEp) : Optional.empty(); - api.configureBridge(hostname, Optional.of(config.enableMDNS), Optional.of(config.enableJSONComms), - servletEpOpt); + api.configureBridge(hostname, config.gatewayRequestTimeout, Optional.of(config.enableMDNS), + Optional.of(config.enableJSONComms), servletEpOpt); if (Thread.currentThread().isInterrupted()) { return; } - // Ensure we have a response with data in if not schedule a reconnect in 15 seconds, theres no reason + // Ensure we have a response with data in if not schedule a reconnect in 15 seconds, there's no reason // for a gateway with no devices. if (!getGatewayConfigurationFreshCheck()) { logger.debug("{}", getLocalizedText("bridge.info.awaiting-init")); @@ -532,7 +538,7 @@ private void connect() { } private void scheduleReconnect() { - scheduleReconnect(15); + scheduleReconnect(config.gatewayRequestTimeout * 5); } public void attemptReconnectIfNeeded() { @@ -586,7 +592,8 @@ public void handleCommand(final ChannelUID channelUID, final Command command) { private final Object singleCommLock = new Object(); - public String sendRequest(final TLGatewayFrame frame) throws DeviceIdException, InvalidParameterException { + public String sendRequest(final TLGatewayFrame frame, final int reqTimeout) + throws DeviceIdException, InvalidParameterException { // Validate the payload is within the expected limits for the device its being sent to if (config.enforceProtocolLimits) { final Collection errors = frame.getValidationErrors(); diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapHandler.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapHandler.java index 1df6b2229fe53..5bd5d80881265 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapHandler.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapHandler.java @@ -235,7 +235,7 @@ public void handleCommand(final ChannelUID channelUID, final Command command) { strStore.put(DEVICE_CHANNEL_OH_VOLUME_LIMIT, String.valueOf(targetValue)); break; } - } else if (command instanceof StringType stringCmd) { + } else if (command instanceof StringType) { switch (channelUID.getId()) { case DEVICE_CHANNEL_CHILD_LOCK: { sendRequest(new LockReq(Integer.valueOf(command.toString()))); diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/PollingDeviceHandler.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/PollingDeviceHandler.java index 6c8c54c9e7dbc..f9f1575a7f293 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/PollingDeviceHandler.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/PollingDeviceHandler.java @@ -247,7 +247,7 @@ public String sendRequest(TLGatewayFrame frame) throws InvalidParameterException return EMPTY_STRING; } try { - return parentBridgeHandler.sendRequest(frame); + return parentBridgeHandler.sendRequest(frame, parentBridgeHandler.getRequestTimeout()); } catch (final DeviceIdException die) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, getLocalizedText(die.getI18Key())); } diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java index aeaf25b6205f7..1203b4d3ec0e7 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java @@ -205,7 +205,7 @@ public String sendRequest(final LinkTapBridgeHandler handler, final TLGatewayFra int retry = 0; while (triesLeft > 0) { try { - return sendSingleRequest(handler, request); + return sendSingleRequest(handler, handler.getRequestTimeout(), request); } catch (TransientCommunicationIssueException tcie) { // Only retry a water timer status read once, with a 3 second delay if (request.command == CMD_UPDATE_WATER_TIMER_STATUS) { @@ -227,9 +227,9 @@ public String sendRequest(final LinkTapBridgeHandler handler, final TLGatewayFra return ""; } - public String sendSingleRequest(final LinkTapBridgeHandler handler, final TLGatewayFrame request) - throws GatewayIdException, DeviceIdException, CommandNotSupportedException, InvalidParameterException, - TransientCommunicationIssueException { + public String sendSingleRequest(final LinkTapBridgeHandler handler, final int reqTimeout, + final TLGatewayFrame request) throws GatewayIdException, DeviceIdException, CommandNotSupportedException, + InvalidParameterException, TransientCommunicationIssueException { // We need the hostname from the handler of the bridge // Responses can be one of the following types @@ -239,7 +239,7 @@ public String sendSingleRequest(final LinkTapBridgeHandler handler, final TLGate final String payloadJson = GSON.toJson(request); logger.debug("{} = APP -> GW Request {} -> Payload {}", uid, targetHost, payloadJson); - String response = API.sendRequest(targetHost, GSON.toJson(request)); + String response = API.sendRequest(targetHost, reqTimeout, GSON.toJson(request)); logger.debug("{} = APP -> GW Response {} -> Payload {}", uid, targetHost, response.trim()); GatewayDeviceResponse gatewayFrame = GSON.fromJson(response, GatewayDeviceResponse.class); diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java index ebb11b9e9ed4b..677b3554f9b4e 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java @@ -87,7 +87,7 @@ public final class WebServerApi { private static final String FIELD_ADMIN_USER = "admin"; private static final String FIELD_ADMIN_USER_PWD = "adminpwd"; - private static final int REQ_TIMEOUT_SECONDS = 3; + // private static final int REQ_TIMEOUT_SECONDS = 3; private static final WebServerApi INSTANCE = new WebServerApi(); private static final String REQ_HDR_APPLICATION_JSON = new MediaType("application", "json", "UTF-8").toString(); private final Logger logger = LoggerFactory.getLogger(WebServerApi.class); @@ -132,11 +132,11 @@ public void setHttpClient(@Nullable HttpClient httpClient) { } } - public Map getBridgeProperities(final String hostname) + public Map getBridgeProperities(final String hostname, final int timeoutSeconds) throws LinkTapException, NotTapLinkGatewayException, TransientCommunicationIssueException { try { final Request request = httpClient.newRequest(URI_HOST_PREFIX + hostname).method(HttpMethod.GET); - final ContentResponse cr = request.timeout(REQ_TIMEOUT_SECONDS, TimeUnit.SECONDS).send(); + final ContentResponse cr = request.timeout(timeoutSeconds, TimeUnit.SECONDS).send(); if (HttpURLConnection.HTTP_OK != cr.getStatus()) { throw new NotTapLinkGatewayException(UNEXPECTED_STATUS_CODE); } @@ -375,8 +375,9 @@ public String getLocalHttpApiArgs(final Document doc, final Optional tar return ""; } - public boolean configureBridge(final @Nullable String hostname, final Optional mdnsEnable, - final Optional nonHtmlEnable, final Optional localServer) + public boolean configureBridge(final @Nullable String hostname, final int timeoutSeconds, + final Optional mdnsEnable, final Optional nonHtmlEnable, + final Optional localServer) throws InterruptedException, NotTapLinkGatewayException, TransientCommunicationIssueException { try { if (hostname == null) { @@ -384,10 +385,11 @@ public boolean configureBridge(final @Nullable String hostname, final Optional Local configuration support requires newer firmware it should be >= {1} -warning.user-data-payload-failure = Device {0} payload validation failed - will not send due to bad data -> {1} -warning.parameter-not-accepted = Parameter not accepted by device {0} for command {1} -warning.response-from-wrong-gw-id = {0} = Response from incorrect Gateway "{1}" != "{2}" -warning.incorrect-cmd-resp = {0} = Received incorrect CMD response {1} != {2} -warning.non-gw = Communicating with non TapLink Gateway detected -warning.not-taplink-gw = {0} = {1} is not a Link Tap Gateway! -warning.comms-issue-auto-retry = {0} = Possible communications issue (auto retry): {1} -warning.device-no-accept = Device {0} did not accept command {1} -warning.error-with-gw-id = Error with gateway ID -warning.host-gw-unknown-for-cmd = Request when host "{0}" or gateway "{1}" id is unknown for command {2} -warning.discovery-charset-missing = Missing character set to decode MDNS Text -warning.unexpected-response-frame = Unexpected response frame {0} -> {1} -warning.unexpected-cmd-result = Unexpected command result -bug-report.failed-alert-enable = Raise Bug Report: {0} - Failed to enable all alerts - invalid parameter exception -bug-report.poll-failure = Raise Bug Report: {0} - Poll failure - invalid parameter exception -bug-report.pause-plan-failure = Raise Bug Report: {0} - Pause plan failure - invalid parameter exception -bug-report.unexpected-payload-failure = Potential Bug: Device {0} payload validation failed - will not send -> {1} -bug-report.gw-unsupported-command = Raise Bug Report: Command {0} not supported by gateway -exception.device-id-exception = Device ID Exception -exception.gw-id-exception = Gateway ID Exception -exception-cmd-not-supported-exception = Command Not Supported Exception -exception.invalid-parameter-exception = Invalid Parameter Exception -exception.could-not-connect = Could not connect -exception.could-not-resolve = Could not resolve IP address -exception.communications-lost = Communications Lost -exception.local-addr-lookup-failure = Local address lookup failure -exception.exec-exception = ExecutionException -> {0} -exception.not-gw.missing-headers = Missing header markers -exception.not-gw.missing-title = Not a LinkTap API response -exception.not-gw.missing-server-title = Not a LinkTap response -exception.not-gw.unexpected-status-code = Unexpected status code response -exception.not-gw.unexpected-protocol = Unexpected protocol -exception.not-tap-link-gw = Not a TapLink GW -exception.fail-servlet-registration = Register servlet failed for {0} -exception.unexpected-failure = Unexpected failure -> {0} -exception.unexpected-exception = Unexpected exception +# add-on + +addon.linktap.name = LinkTap Binding +addon.linktap.description = This is the binding for LinkTap. + +# thing types + +thing-type.linktap.device.label = LinkTap Binding Thing +thing-type.linktap.device.description = LinkTap Binding Device +thing-type.linktap.gateway.label = LinkTap Gateway +thing-type.linktap.gateway.description = This represents a LinkTap gateway + +# thing types config + +thing-type.config.linktap.device.id.label = Device Id +thing-type.config.linktap.device.id.description = The Device Id for the device under the gateway +thing-type.config.linktap.device.name.label = Device Name +thing-type.config.linktap.device.name.description = The name allocated to the device by the app. (Must be unique if used) +thing-type.config.linktap.gateway.enableJSONComms.label = Enable non HTML responses +thing-type.config.linktap.gateway.enableJSONComms.description = Enable only if openHAB is directly using the Gateway, to allow more efficient communications +thing-type.config.linktap.gateway.enableMDNS.label = Enable mDNS Responder +thing-type.config.linktap.gateway.enableMDNS.description = On connection whether the mDNS responder should be enabled on the gateway device +thing-type.config.linktap.gateway.enforceProtocolLimits.label = Enforce protocol limits +thing-type.config.linktap.gateway.enforceProtocolLimits.description = If parameters outside the limits acceptable to the device's are sent they will be blocked and logged +thing-type.config.linktap.gateway.gatewayRequestTimeout.label = Gateway Response Timeout +thing-type.config.linktap.gateway.gatewayRequestTimeout.description = For slow or heavily loaded systems this may need increasing, if communication errors are seen (seconds allowed for responses from the gateway) +thing-type.config.linktap.gateway.host.label = Hostname / IP +thing-type.config.linktap.gateway.host.description = The hostname / IP address of the gateway device +thing-type.config.linktap.gateway.password.label = Device Password +thing-type.config.linktap.gateway.password.description = The password if set for the gateway device +thing-type.config.linktap.gateway.username.label = Device Username +thing-type.config.linktap.gateway.username.description = The username if set for the gateway device + +# channel types + +channel-type.linktap.battery-level-type.label = Battery Level +channel-type.linktap.battery-level-type.description = Battery Remaining Level +channel-type.linktap.child-lock-type.label = Child Lock Mode +channel-type.linktap.child-lock-type.description = The child lock mode +channel-type.linktap.child-lock-type.state.option.0 = Unlocked +channel-type.linktap.child-lock-type.state.option.1 = Partially locked +channel-type.linktap.child-lock-type.state.option.2 = Completely locked +channel-type.linktap.fail-status-type.label = Shutdown Value Failed +channel-type.linktap.fail-status-type.description = The device has failed to close the valve +channel-type.linktap.failsafe-duration-type.label = Watering Cycle Failsafe +channel-type.linktap.failsafe-duration-type.description = Failsafe duration of the current watering cycle +channel-type.linktap.fall-status-type.label = Fallen Status +channel-type.linktap.fall-status-type.description = The device has fallen +channel-type.linktap.final-segment-type.label = Final ECO Segment +channel-type.linktap.final-segment-type.description = In ECO mode this is true when the final ON watering on segment is running +channel-type.linktap.flm-linked-type.label = FLM Linked +channel-type.linktap.flm-linked-type.description = The device has a included flow meter +channel-type.linktap.flow-rate-type.label = Flow Rate +channel-type.linktap.flow-rate-type.description = Current water flow rate +channel-type.linktap.instant-duration-type.label = Instant Duration Limit +channel-type.linktap.instant-duration-type.description = Max duration allowed for the immediate watering +channel-type.linktap.instant-limit-type.label = Instant Volume Limit +channel-type.linktap.instant-limit-type.description = Max Volume limit for immediate watering +channel-type.linktap.is-clog-type.label = Low Flow Detected +channel-type.linktap.is-clog-type.description = Unusually low flow rate detected alert +channel-type.linktap.is-leak-type.label = High Flow Detected +channel-type.linktap.is-leak-type.description = Unusually high flow rate detected alert +channel-type.linktap.man-mode-type.label = Manual Watering +channel-type.linktap.man-mode-type.description = Manual watering mode status +channel-type.linktap.mode-type.label = Watering Mode +channel-type.linktap.mode-type.description = The watering mode +channel-type.linktap.mode-type.state.option.0 = Off +channel-type.linktap.mode-type.state.option.1 = Instant +channel-type.linktap.mode-type.state.option.2 = Calendar +channel-type.linktap.mode-type.state.option.3 = Day +channel-type.linktap.mode-type.state.option.4 = Odd-even +channel-type.linktap.mode-type.state.option.5 = Interval +channel-type.linktap.mode-type.state.option.6 = Month +channel-type.linktap.pause-enable-type.label = Pause plan schedule +channel-type.linktap.pause-enable-type.description = When ON will pause the current watering plan for an hour every 55 minutes +channel-type.linktap.pause-until-type.label = Plan Paused Until +channel-type.linktap.pause-until-type.description = Displays when the last pause issued will expiry, resuming the current watering plan +channel-type.linktap.plan-id-type.label = Watering Plan Id +channel-type.linktap.plan-id-type.description = Displays the current watering plan id +channel-type.linktap.remaining-duration-type.label = Watering Cycle Remaining +channel-type.linktap.remaining-duration-type.description = Remaining duration of the current watering cycle +channel-type.linktap.rf-linked-type.label = RF Linked +channel-type.linktap.rf-linked-type.description = Is the device RF linked +channel-type.linktap.signal-level-type.label = Signal Level +channel-type.linktap.signal-level-type.description = Reception Signal Strength +channel-type.linktap.total-duration-type.label = Watering Cycle Duration +channel-type.linktap.total-duration-type.description = Total duration of current watering cycle +channel-type.linktap.volume-limit-type.label = Current Watering Limit +channel-type.linktap.volume-limit-type.description = Volume limit for the current watering cycle +channel-type.linktap.volume-type.label = Current Watering Volume +channel-type.linktap.volume-type.description = Accumulated volume of current watering cycle +channel-type.linktap.water-cut-type.label = Water Cutoff +channel-type.linktap.water-cut-type.description = Water cut-off alert +channel-type.linktap.watering-type.label = Watering +channel-type.linktap.watering-type.description = Active watering status + +# thing types config + +thing-type.config.linktap.device.enableAlerts.label = Auto Enable Alerts +thing-type.config.linktap.device.enableAlerts.description = If enabled, during device initialisation all alerts are enabled + +# thing types + +thing-type.linktap.bridge.label = LinkTap Bridge +thing-type.linktap.bridge.description = The LinkTap bridge represents a LinkTap gateway device + +# thing types config + +thing-type.config.linktap.bridge.enableMDNS.label = Enable mDNS Responder +thing-type.config.linktap.bridge.enableMDNS.description = On connection whether the mDNS responder should be enabled on the gateway device +thing-type.config.linktap.bridge.host.label = Hostname / IP +thing-type.config.linktap.bridge.host.description = The hostname / IP address of the gateway device +thing-type.config.linktap.bridge.password.label = Device Password +thing-type.config.linktap.bridge.password.description = The password if set for the gateway device +thing-type.config.linktap.bridge.username.label = Device Username +thing-type.config.linktap.bridge.username.description = The username if set for the gateway device + +# channel types + +channel-type.linktap.future-rain-type.label = Watering Skipped Future +channel-type.linktap.future-rain-type.description = Future rainfall calculated when watering was skipped +channel-type.linktap.prev-rain-type.label = Watering Skipped Previous +channel-type.linktap.prev-rain-type.description = Previous rainfall calculated when watering was skipped +channel-type.linktap.rain-timestamp-type.label = Watering Skipped Timestamp +channel-type.linktap.rain-timestamp-type.description = Time when watering was skipped + +# channel types + +channel-type.linktap.instant-volume-limit-type.label = OH Instance On Watering Limit +channel-type.linktap.instant-volume-limit-type.description = Max Volume limit for immediate watering + +# channel types + +channel-type.linktap.battery-level.label = Battery Level +channel-type.linktap.battery-level.description = Battery Remaining Level +channel-type.linktap.child-lock-mode.label = Child-lock mode +channel-type.linktap.child-lock-mode.description = The child lock mode +channel-type.linktap.child-lock-mode.state.option.0 = Unlocked +channel-type.linktap.child-lock-mode.state.option.1 = Partially locked +channel-type.linktap.child-lock-mode.state.option.2 = Completely locked +channel-type.linktap.fail-status.label = Shutdown value failed +channel-type.linktap.fail-status.description = The device has failed to close the valve +channel-type.linktap.failsafe-duration.label = Watering Cycle Failsafe +channel-type.linktap.failsafe-duration.description = Failsafe duration of the current watering cycle +channel-type.linktap.fall-status.label = Fallen status +channel-type.linktap.fall-status.description = The device has fallen +channel-type.linktap.final-segment.label = Final ECO Segment +channel-type.linktap.final-segment.description = In ECO mode this is true when the final ON watering on segment is running +channel-type.linktap.flm-linked.label = FLM Linked +channel-type.linktap.flm-linked.description = The device has a included flow meter +channel-type.linktap.flow-rate.label = Flow Rate +channel-type.linktap.flow-rate.description = Current water flow rate +channel-type.linktap.instant-duration.label = OH Instance On Duration +channel-type.linktap.instant-duration.description = Max duration allowed for the immediate watering +channel-type.linktap.instant-volume-limit.label = OH Instance On Watering Limit +channel-type.linktap.instant-volume-limit.description = Max Volume limit for immediate watering +channel-type.linktap.is-clog.label = Low Flow Detected +channel-type.linktap.is-clog.description = Unusually low flow rate detected alert +channel-type.linktap.is-leak.label = High Flow Detected +channel-type.linktap.is-leak.description = Unusually high flow rate detected alert +channel-type.linktap.man-mode.label = Manual watering +channel-type.linktap.man-mode.description = Manual watering mode status +channel-type.linktap.mode.label = Watering mode +channel-type.linktap.mode.description = The watering mode +channel-type.linktap.mode.state.option.0 = Off +channel-type.linktap.mode.state.option.1 = Instant +channel-type.linktap.mode.state.option.2 = Calendar +channel-type.linktap.mode.state.option.3 = Day +channel-type.linktap.mode.state.option.4 = Odd-even +channel-type.linktap.mode.state.option.5 = Interval +channel-type.linktap.mode.state.option.6 = Month +channel-type.linktap.remaining-duration.label = Watering Cycle Remaining +channel-type.linktap.remaining-duration.description = Remaining duration of the current watering cycle +channel-type.linktap.rf-inked.label = RF Linked +channel-type.linktap.rf-inked.description = Is the device RF linked +channel-type.linktap.signal-level.label = Signal Level +channel-type.linktap.signal-level.description = Reception Signal Strength +channel-type.linktap.skip-future-rain.label = Watering Skipped Future Rain +channel-type.linktap.skip-future-rain.description = Future rainfall calculated when watering was skipped +channel-type.linktap.skip-prev-rain.label = Watering Skipped Previous Rain +channel-type.linktap.skip-prev-rain.description = Previous rainfall calculated when watering was skipped +channel-type.linktap.skip-timestamp.label = Watering Skipped Timestamp +channel-type.linktap.skip-timestamp.description = Time when watering was skipped +channel-type.linktap.total-duration.label = Watering Cycle Duration +channel-type.linktap.total-duration.description = Total duration of current watering cycle +channel-type.linktap.volume-limit.label = Current Watering Limit +channel-type.linktap.volume-limit.description = Volume limit for the current watering cycle +channel-type.linktap.volume.label = Current Watering Volume +channel-type.linktap.volume.description = Accumulated volume of current watering cycle +channel-type.linktap.water-cut-off.label = Water Cutoff +channel-type.linktap.water-cut-off.description = Water cut-off alert +channel-type.linktap.watering.label = Watering +channel-type.linktap.watering.description = Active watering status + +# channel types + +channel-type.linktap.deviceBatteryLevel.label = Battery Level +channel-type.linktap.deviceBatteryLevel.description = Battery Remaining Level +channel-type.linktap.deviceChildLockMode.label = Child-lock mode +channel-type.linktap.deviceChildLockMode.description = The child lock mode +channel-type.linktap.deviceChildLockMode.state.option.0 = Unlocked +channel-type.linktap.deviceChildLockMode.state.option.1 = Partially locked +channel-type.linktap.deviceChildLockMode.state.option.2 = Completely locked +channel-type.linktap.deviceFailStatus.label = Shutdown value failed +channel-type.linktap.deviceFailStatus.description = The device has failed to close the valve +channel-type.linktap.deviceFailsafeDuration.label = Watering Cycle Failsafe +channel-type.linktap.deviceFailsafeDuration.description = Failsafe duration of the current watering cycle +channel-type.linktap.deviceFallStatus.label = Fallen status +channel-type.linktap.deviceFallStatus.description = The device has fallen +channel-type.linktap.deviceFinalSegment.label = Final ECO Segment +channel-type.linktap.deviceFinalSegment.description = In ECO mode this is true when the final ON watering on segment is running +channel-type.linktap.deviceFlmLinked.label = FLM Linked +channel-type.linktap.deviceFlmLinked.description = The device has a included flow meter +channel-type.linktap.deviceFlowRate.label = Flow Rate +channel-type.linktap.deviceFlowRate.description = Current water flow rate +channel-type.linktap.deviceIsClog.label = Low Flow Detected +channel-type.linktap.deviceIsClog.description = Unusually low flow rate detected alert +channel-type.linktap.deviceIsLeak.label = High Flow Detected +channel-type.linktap.deviceIsLeak.description = Unusually high flow rate detected alert +channel-type.linktap.deviceManMode.label = Manual watering +channel-type.linktap.deviceManMode.description = Manual watering mode status +channel-type.linktap.deviceMode.label = Watering mode +channel-type.linktap.deviceMode.description = The watering mode +channel-type.linktap.deviceMode.state.option.0 = Off +channel-type.linktap.deviceMode.state.option.1 = Instant +channel-type.linktap.deviceMode.state.option.2 = Calendar +channel-type.linktap.deviceMode.state.option.3 = Day +channel-type.linktap.deviceMode.state.option.4 = Odd-even +channel-type.linktap.deviceMode.state.option.5 = Interval +channel-type.linktap.deviceMode.state.option.6 = Month +channel-type.linktap.deviceRemainingDuration.label = Watering Cycle Remaining +channel-type.linktap.deviceRemainingDuration.description = Remaining duration of the current watering cycle +channel-type.linktap.deviceRfLinked.label = RF Linked +channel-type.linktap.deviceRfLinked.description = Is the device RF linked +channel-type.linktap.deviceSignalLevel.label = Signal Level +channel-type.linktap.deviceSignalLevel.description = Reception Signal Strength +channel-type.linktap.deviceTotalDuration.label = Watering Cycle Duration +channel-type.linktap.deviceTotalDuration.description = Total duration of current watering cycle +channel-type.linktap.deviceVolume.label = Current Watering Volume +channel-type.linktap.deviceVolume.description = Accumulated volume of current watering cycle +channel-type.linktap.deviceVolumeLimit.label = Current Watering Limit +channel-type.linktap.deviceVolumeLimit.description = Volume limit for the current watering cycle +channel-type.linktap.deviceWaterCutoff.label = Water Cutoff +channel-type.linktap.deviceWaterCutoff.description = Water cut-off alert +channel-type.linktap.deviceWatering.label = Watering +channel-type.linktap.deviceWatering.description = Active watering status +channel-type.linktap.ohInstantDuration.label = OH Instance On Duration +channel-type.linktap.ohInstantDuration.description = Max duration allowed for the immediate watering +channel-type.linktap.ohInstantVolumeLimit.label = OH Instance On Watering Limit +channel-type.linktap.ohInstantVolumeLimit.description = Max Volume limit for immediate watering +channel-type.linktap.waterSkipDateTime.label = Watering Skipped Timestamp +channel-type.linktap.waterSkipDateTime.description = Time when watering was skipped +channel-type.linktap.waterSkipFutureRain.label = Watering Skipped Future Rain +channel-type.linktap.waterSkipFutureRain.description = Future rainfall calculated when watering was skipped +channel-type.linktap.waterSkipPrevRain.label = Watering Skipped Previous Rain +channel-type.linktap.waterSkipPrevRain.description = Previous rainfall calculated when watering was skipped + +# informative messages + +bridge.info.awaiting-init = Awaiting Gateway initialisation + +# errors + +bridge.error.host-not-found = Hostname / IP cannot be found +bridge.error.check-credentials = Check credentials provided +bridge.error.cannot-connect = Cannot connect to LinkTap Gateway +bridge.error.unknown-host = Unknown host +bridge.error.target-is-not-gateway = Target Host is not a LinkTap Gateway +polling-device.error.bridge-unset = Bridge is not selected / set +polling-device.error.device-unknown-in-bridge = Device not found in bridges known devices +polling-device.error.unknown-device-id = Bridge does not recognise device id +polling-device.error.unknown-device = Check device setup - device is unknown +protocol.ret.success = Success +protocol.ret.format-error = Message format error +protocol.ret.cmd-unsupported = CMD message not supported +protocol.ret.gw-id-unmatched = Gateway ID not matched +protocol.ret.end-device-id-error = End device ID error +protocol.ret.end-device-id-not-found = End device ID not found +protocol.ret.gw-internal-error = Gateway internal error +protocol.ret.conflict-watering-plan = Conflict with watering plan +protocol.ret.gw-busy = Gateway busy +protocol.ret.bad-parameter-in-msg = Bad parameter in message +protocol.ret.invalid = Missing ret response +warning.failed-local-address-detection = Failed to determine local openHab address due to connection failure with exception {} +warning.no-http-server-port = HTTP Server port is not running, cannot use API callbacks +warning.fw-update-local-config = {0} -> Local configuration support requires newer firmware it should be >= {1} +warning.user-data-payload-failure = Device {0} payload validation failed - will not send due to bad data -> {1} +warning.parameter-not-accepted = Parameter not accepted by device {0} for command {1} +warning.response-from-wrong-gw-id = {0} = Response from incorrect Gateway "{1}" != "{2}" +warning.incorrect-cmd-resp = {0} = Received incorrect CMD response {1} != {2} +warning.non-gw = Communicating with non TapLink Gateway detected +warning.not-taplink-gw = {0} = {1} is not a Link Tap Gateway! +warning.comms-issue-auto-retry = {0} = Possible communications issue (auto retry): {1} +warning.device-no-accept = Device {0} did not accept command {1} +warning.error-with-gw-id = Error with gateway ID +warning.host-gw-unknown-for-cmd = Request when host "{0}" or gateway "{1}" id is unknown for command {2} +warning.discovery-charset-missing = Missing character set to decode MDNS Text +warning.unexpected-response-frame = Unexpected response frame {0} -> {1} +warning.unexpected-cmd-result = Unexpected command result +bug-report.failed-alert-enable = Raise Bug Report: {0} - Failed to enable all alerts - invalid parameter exception +bug-report.poll-failure = Raise Bug Report: {0} - Poll failure - invalid parameter exception +bug-report.pause-plan-failure = Raise Bug Report: {0} - Pause plan failure - invalid parameter exception +bug-report.unexpected-payload-failure = Potential Bug: Device {0} payload validation failed - will not send -> {1} +bug-report.gw-unsupported-command = Raise Bug Report: Command {0} not supported by gateway +exception.device-id-exception = Device ID Exception +exception.gw-id-exception = Gateway ID Exception +exception-cmd-not-supported-exception = Command Not Supported Exception +exception.invalid-parameter-exception = Invalid Parameter Exception +exception.could-not-connect = Could not connect +exception.could-not-resolve = Could not resolve IP address +exception.communications-lost = Communications Lost +exception.local-addr-lookup-failure = Local address lookup failure +exception.exec-exception = ExecutionException -> {0} +exception.not-gw.missing-headers = Missing header markers +exception.not-gw.missing-title = Not a LinkTap API response +exception.not-gw.missing-server-title = Not a LinkTap response +exception.not-gw.unexpected-status-code = Unexpected status code response +exception.not-gw.unexpected-protocol = Unexpected protocol +exception.not-tap-link-gw = Not a TapLink GW +exception.fail-servlet-registration = Register servlet failed for {0} +exception.unexpected-failure = Unexpected failure -> {0} +exception.unexpected-exception = Unexpected exception diff --git a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml index 514cfcbff44b9..cdfe4c4b93c44 100644 --- a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml @@ -53,6 +53,13 @@ true true + + + For slow or heavily loaded systems this may need increasing, if communication errors are seen (seconds + allowed for responses from the gateway) + 3 + true + @@ -109,11 +116,6 @@ The name allocated to the device by the app. (Must be unique if used) - - - If enabled, during device initialisation all alerts are enabled - true - From 031d62df850e4c01e6be8a830dbba1fefef8dae1 Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Sun, 11 May 2025 22:11:02 +0100 Subject: [PATCH 02/15] [linktap] Cleanup of unrequired variable [linktap] Cleanup of unrequired variable Signed-off-by: David Goodyear --- .../binding/linktap/internal/LinkTapBridgeHandler.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java index f7d14521d2b49..2894697864035 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java @@ -110,7 +110,6 @@ public class LinkTapBridgeHandler extends BaseBridgeHandler { private volatile long lastGwCommandRecvTs = 0L; private volatile long lastMdnsScanMillis = -1L; private volatile boolean readZeroDevices = false; - private volatile int requestTimeout = 3; private String bridgeKey = ""; private IHttpClientProvider httpClientProvider; @@ -145,7 +144,7 @@ public String getLocalizedText(String key, @Nullable Object @Nullable... argumen } public int getRequestTimeout() { - return requestTimeout; + return config.gatewayRequestTimeout; } private void startGwPolling() { @@ -434,7 +433,7 @@ private void connect() { final WebServerApi api = WebServerApi.getInstance(); api.setHttpClient(httpClientProvider.getHttpClient()); try { - final Map bridgeProps = api.getBridgeProperities(bridgeKey, config.gatewayRequestTimeout); + final Map bridgeProps = api.getBridgeProperities(bridgeKey, getRequestTimeout()); if (!bridgeProps.isEmpty()) { final String readGwId = bridgeProps.get(BRIDGE_PROP_GW_ID); if (readGwId != null) { @@ -444,8 +443,7 @@ private void connect() { currentProps.putAll(bridgeProps); updateProperties(currentProps); } else { - if (!api.unlockWebInterface(bridgeKey, config.gatewayRequestTimeout, config.username, - config.password)) { + if (!api.unlockWebInterface(bridgeKey, getRequestTimeout(), config.username, config.password)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, getLocalizedText("bridge.error.check-credentials")); return; @@ -487,7 +485,7 @@ private void connect() { final String servletEp = BindingServlet.getServletAddress(localServerAddr, getLocalizedText("warning.no-http-server-port")); final Optional servletEpOpt = (!servletEp.isEmpty()) ? Optional.of(servletEp) : Optional.empty(); - api.configureBridge(hostname, config.gatewayRequestTimeout, Optional.of(config.enableMDNS), + api.configureBridge(hostname, getRequestTimeout(), Optional.of(config.enableMDNS), Optional.of(config.enableJSONComms), servletEpOpt); if (Thread.currentThread().isInterrupted()) { return; From 5a1555741ec6022ea21a9926c004a37ce3fe3f40 Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Sun, 11 May 2025 22:22:23 +0100 Subject: [PATCH 03/15] [linktap] Revert accidental removal of config code [linktap] Revert accidental removal of config code Signed-off-by: David Goodyear --- .../src/main/resources/OH-INF/i18n/linktap.properties | 7 ++----- .../src/main/resources/OH-INF/thing/thing-types.xml | 5 +++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties index 86ee99873ed58..93071845b01cd 100644 --- a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties +++ b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties @@ -12,6 +12,8 @@ thing-type.linktap.gateway.description = This represents a LinkTap gateway # thing types config +thing-type.config.linktap.device.enableAlerts.label = Auto Enable Alerts +thing-type.config.linktap.device.enableAlerts.description = If enabled, during device initialisation all alerts are enabled thing-type.config.linktap.device.id.label = Device Id thing-type.config.linktap.device.id.description = The Device Id for the device under the gateway thing-type.config.linktap.device.name.label = Device Name @@ -94,11 +96,6 @@ channel-type.linktap.water-cut-type.description = Water cut-off alert channel-type.linktap.watering-type.label = Watering channel-type.linktap.watering-type.description = Active watering status -# thing types config - -thing-type.config.linktap.device.enableAlerts.label = Auto Enable Alerts -thing-type.config.linktap.device.enableAlerts.description = If enabled, during device initialisation all alerts are enabled - # thing types thing-type.linktap.bridge.label = LinkTap Bridge diff --git a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml index cdfe4c4b93c44..37112a6b9d466 100644 --- a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml @@ -116,6 +116,11 @@ The name allocated to the device by the app. (Must be unique if used) + + + If enabled, during device initialisation all alerts are enabled + true + From 133b7613cbe36eb479d178b0f86e9f1649ccffc0 Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Sun, 11 May 2025 22:29:20 +0100 Subject: [PATCH 04/15] [linktap] Remove commented out line [linktap] Remove commented out line Signed-off-by: David Goodyear --- .../org/openhab/binding/linktap/protocol/http/WebServerApi.java | 1 - 1 file changed, 1 deletion(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java index 677b3554f9b4e..f4e7f9ceb3b72 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java @@ -87,7 +87,6 @@ public final class WebServerApi { private static final String FIELD_ADMIN_USER = "admin"; private static final String FIELD_ADMIN_USER_PWD = "adminpwd"; - // private static final int REQ_TIMEOUT_SECONDS = 3; private static final WebServerApi INSTANCE = new WebServerApi(); private static final String REQ_HDR_APPLICATION_JSON = new MediaType("application", "json", "UTF-8").toString(); private final Logger logger = LoggerFactory.getLogger(WebServerApi.class); From 4c0c796bfd3a48b8743f053d4c9d8cd1a61288d4 Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Sun, 11 May 2025 22:38:44 +0100 Subject: [PATCH 05/15] [linktap] Align const to final setting name [linktap] Align const to final setting name Signed-off-by: David Goodyear --- .../binding/linktap/internal/LinkTapBindingConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java index a1fb6acfb7fe5..c095243737b16 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java @@ -59,7 +59,7 @@ public class LinkTapBindingConstants { public static final String BRIDGE_CONFIG_MDNS_ENABLE = "enableMDNS"; public static final String BRIDGE_CONFIG_NON_HTML_COMM_ENABLE = "enableJSONComms"; public static final String BRIDGE_CONFIG_ENFORCE_COMM_LIMITS = "enforceProtocolLimits"; - public static final String BRIDGE_CONFIG_ENABLE_LONG_TIMEOUTS = "enableLongTimeouts"; + public static final String BRIDGE_CONFIG_GATEWAY_RESPONSE_TIMEOUT = "gatewayRequestTimeout"; public static final String DEVICE_PROP_DEV_ID = "deviceId"; public static final String DEVICE_PROP_DEV_NAME = "deviceName"; From ead51c7982243b3012509a87e9454a93cc80d63c Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Sun, 11 May 2025 22:41:38 +0100 Subject: [PATCH 06/15] [linktap] Cleanup to use handler function [linktap] Cleanup to use handler function Signed-off-by: David Goodyear --- .../binding/linktap/internal/TransactionProcessor.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java index 1203b4d3ec0e7..c04884c5497cb 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java @@ -205,7 +205,7 @@ public String sendRequest(final LinkTapBridgeHandler handler, final TLGatewayFra int retry = 0; while (triesLeft > 0) { try { - return sendSingleRequest(handler, handler.getRequestTimeout(), request); + return sendSingleRequest(handler, request); } catch (TransientCommunicationIssueException tcie) { // Only retry a water timer status read once, with a 3 second delay if (request.command == CMD_UPDATE_WATER_TIMER_STATUS) { @@ -227,9 +227,9 @@ public String sendRequest(final LinkTapBridgeHandler handler, final TLGatewayFra return ""; } - public String sendSingleRequest(final LinkTapBridgeHandler handler, final int reqTimeout, - final TLGatewayFrame request) throws GatewayIdException, DeviceIdException, CommandNotSupportedException, - InvalidParameterException, TransientCommunicationIssueException { + public String sendSingleRequest(final LinkTapBridgeHandler handler, final TLGatewayFrame request) + throws GatewayIdException, DeviceIdException, CommandNotSupportedException, InvalidParameterException, + TransientCommunicationIssueException { // We need the hostname from the handler of the bridge // Responses can be one of the following types @@ -239,7 +239,7 @@ public String sendSingleRequest(final LinkTapBridgeHandler handler, final int re final String payloadJson = GSON.toJson(request); logger.debug("{} = APP -> GW Request {} -> Payload {}", uid, targetHost, payloadJson); - String response = API.sendRequest(targetHost, reqTimeout, GSON.toJson(request)); + String response = API.sendRequest(targetHost, handler.getRequestTimeout(), GSON.toJson(request)); logger.debug("{} = APP -> GW Response {} -> Payload {}", uid, targetHost, response.trim()); GatewayDeviceResponse gatewayFrame = GSON.fromJson(response, GatewayDeviceResponse.class); From 0f43f370eb8e6accfc171965eb48277396978418 Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Sun, 11 May 2025 22:49:35 +0100 Subject: [PATCH 07/15] [linktap] Comment for magic number [linktap] Comment for magic number Signed-off-by: David Goodyear --- .../openhab/binding/linktap/internal/LinkTapBridgeHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java index 2894697864035..07aab4a6f78b9 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java @@ -536,7 +536,8 @@ private void connect() { } private void scheduleReconnect() { - scheduleReconnect(config.gatewayRequestTimeout * 5); + scheduleReconnect(config.gatewayRequestTimeout * 5); // 5 is due to the number of req/resp required for + // connection } public void attemptReconnectIfNeeded() { From 1e5aa9d5126230484b3efbbe68acc22faa3f3041 Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Mon, 12 May 2025 00:53:31 +0100 Subject: [PATCH 08/15] [linktap] Revert i18n file [linktap] Revert i18n file Signed-off-by: David Goodyear --- .../resources/OH-INF/i18n/linktap.properties | 636 +++++++++--------- 1 file changed, 317 insertions(+), 319 deletions(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties index 93071845b01cd..1e203ed0efbe5 100644 --- a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties +++ b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties @@ -1,319 +1,317 @@ -# add-on - -addon.linktap.name = LinkTap Binding -addon.linktap.description = This is the binding for LinkTap. - -# thing types - -thing-type.linktap.device.label = LinkTap Binding Thing -thing-type.linktap.device.description = LinkTap Binding Device -thing-type.linktap.gateway.label = LinkTap Gateway -thing-type.linktap.gateway.description = This represents a LinkTap gateway - -# thing types config - -thing-type.config.linktap.device.enableAlerts.label = Auto Enable Alerts -thing-type.config.linktap.device.enableAlerts.description = If enabled, during device initialisation all alerts are enabled -thing-type.config.linktap.device.id.label = Device Id -thing-type.config.linktap.device.id.description = The Device Id for the device under the gateway -thing-type.config.linktap.device.name.label = Device Name -thing-type.config.linktap.device.name.description = The name allocated to the device by the app. (Must be unique if used) -thing-type.config.linktap.gateway.enableJSONComms.label = Enable non HTML responses -thing-type.config.linktap.gateway.enableJSONComms.description = Enable only if openHAB is directly using the Gateway, to allow more efficient communications -thing-type.config.linktap.gateway.enableMDNS.label = Enable mDNS Responder -thing-type.config.linktap.gateway.enableMDNS.description = On connection whether the mDNS responder should be enabled on the gateway device -thing-type.config.linktap.gateway.enforceProtocolLimits.label = Enforce protocol limits -thing-type.config.linktap.gateway.enforceProtocolLimits.description = If parameters outside the limits acceptable to the device's are sent they will be blocked and logged -thing-type.config.linktap.gateway.gatewayRequestTimeout.label = Gateway Response Timeout -thing-type.config.linktap.gateway.gatewayRequestTimeout.description = For slow or heavily loaded systems this may need increasing, if communication errors are seen (seconds allowed for responses from the gateway) -thing-type.config.linktap.gateway.host.label = Hostname / IP -thing-type.config.linktap.gateway.host.description = The hostname / IP address of the gateway device -thing-type.config.linktap.gateway.password.label = Device Password -thing-type.config.linktap.gateway.password.description = The password if set for the gateway device -thing-type.config.linktap.gateway.username.label = Device Username -thing-type.config.linktap.gateway.username.description = The username if set for the gateway device - -# channel types - -channel-type.linktap.battery-level-type.label = Battery Level -channel-type.linktap.battery-level-type.description = Battery Remaining Level -channel-type.linktap.child-lock-type.label = Child Lock Mode -channel-type.linktap.child-lock-type.description = The child lock mode -channel-type.linktap.child-lock-type.state.option.0 = Unlocked -channel-type.linktap.child-lock-type.state.option.1 = Partially locked -channel-type.linktap.child-lock-type.state.option.2 = Completely locked -channel-type.linktap.fail-status-type.label = Shutdown Value Failed -channel-type.linktap.fail-status-type.description = The device has failed to close the valve -channel-type.linktap.failsafe-duration-type.label = Watering Cycle Failsafe -channel-type.linktap.failsafe-duration-type.description = Failsafe duration of the current watering cycle -channel-type.linktap.fall-status-type.label = Fallen Status -channel-type.linktap.fall-status-type.description = The device has fallen -channel-type.linktap.final-segment-type.label = Final ECO Segment -channel-type.linktap.final-segment-type.description = In ECO mode this is true when the final ON watering on segment is running -channel-type.linktap.flm-linked-type.label = FLM Linked -channel-type.linktap.flm-linked-type.description = The device has a included flow meter -channel-type.linktap.flow-rate-type.label = Flow Rate -channel-type.linktap.flow-rate-type.description = Current water flow rate -channel-type.linktap.instant-duration-type.label = Instant Duration Limit -channel-type.linktap.instant-duration-type.description = Max duration allowed for the immediate watering -channel-type.linktap.instant-limit-type.label = Instant Volume Limit -channel-type.linktap.instant-limit-type.description = Max Volume limit for immediate watering -channel-type.linktap.is-clog-type.label = Low Flow Detected -channel-type.linktap.is-clog-type.description = Unusually low flow rate detected alert -channel-type.linktap.is-leak-type.label = High Flow Detected -channel-type.linktap.is-leak-type.description = Unusually high flow rate detected alert -channel-type.linktap.man-mode-type.label = Manual Watering -channel-type.linktap.man-mode-type.description = Manual watering mode status -channel-type.linktap.mode-type.label = Watering Mode -channel-type.linktap.mode-type.description = The watering mode -channel-type.linktap.mode-type.state.option.0 = Off -channel-type.linktap.mode-type.state.option.1 = Instant -channel-type.linktap.mode-type.state.option.2 = Calendar -channel-type.linktap.mode-type.state.option.3 = Day -channel-type.linktap.mode-type.state.option.4 = Odd-even -channel-type.linktap.mode-type.state.option.5 = Interval -channel-type.linktap.mode-type.state.option.6 = Month -channel-type.linktap.pause-enable-type.label = Pause plan schedule -channel-type.linktap.pause-enable-type.description = When ON will pause the current watering plan for an hour every 55 minutes -channel-type.linktap.pause-until-type.label = Plan Paused Until -channel-type.linktap.pause-until-type.description = Displays when the last pause issued will expiry, resuming the current watering plan -channel-type.linktap.plan-id-type.label = Watering Plan Id -channel-type.linktap.plan-id-type.description = Displays the current watering plan id -channel-type.linktap.remaining-duration-type.label = Watering Cycle Remaining -channel-type.linktap.remaining-duration-type.description = Remaining duration of the current watering cycle -channel-type.linktap.rf-linked-type.label = RF Linked -channel-type.linktap.rf-linked-type.description = Is the device RF linked -channel-type.linktap.signal-level-type.label = Signal Level -channel-type.linktap.signal-level-type.description = Reception Signal Strength -channel-type.linktap.total-duration-type.label = Watering Cycle Duration -channel-type.linktap.total-duration-type.description = Total duration of current watering cycle -channel-type.linktap.volume-limit-type.label = Current Watering Limit -channel-type.linktap.volume-limit-type.description = Volume limit for the current watering cycle -channel-type.linktap.volume-type.label = Current Watering Volume -channel-type.linktap.volume-type.description = Accumulated volume of current watering cycle -channel-type.linktap.water-cut-type.label = Water Cutoff -channel-type.linktap.water-cut-type.description = Water cut-off alert -channel-type.linktap.watering-type.label = Watering -channel-type.linktap.watering-type.description = Active watering status - -# thing types - -thing-type.linktap.bridge.label = LinkTap Bridge -thing-type.linktap.bridge.description = The LinkTap bridge represents a LinkTap gateway device - -# thing types config - -thing-type.config.linktap.bridge.enableMDNS.label = Enable mDNS Responder -thing-type.config.linktap.bridge.enableMDNS.description = On connection whether the mDNS responder should be enabled on the gateway device -thing-type.config.linktap.bridge.host.label = Hostname / IP -thing-type.config.linktap.bridge.host.description = The hostname / IP address of the gateway device -thing-type.config.linktap.bridge.password.label = Device Password -thing-type.config.linktap.bridge.password.description = The password if set for the gateway device -thing-type.config.linktap.bridge.username.label = Device Username -thing-type.config.linktap.bridge.username.description = The username if set for the gateway device - -# channel types - -channel-type.linktap.future-rain-type.label = Watering Skipped Future -channel-type.linktap.future-rain-type.description = Future rainfall calculated when watering was skipped -channel-type.linktap.prev-rain-type.label = Watering Skipped Previous -channel-type.linktap.prev-rain-type.description = Previous rainfall calculated when watering was skipped -channel-type.linktap.rain-timestamp-type.label = Watering Skipped Timestamp -channel-type.linktap.rain-timestamp-type.description = Time when watering was skipped - -# channel types - -channel-type.linktap.instant-volume-limit-type.label = OH Instance On Watering Limit -channel-type.linktap.instant-volume-limit-type.description = Max Volume limit for immediate watering - -# channel types - -channel-type.linktap.battery-level.label = Battery Level -channel-type.linktap.battery-level.description = Battery Remaining Level -channel-type.linktap.child-lock-mode.label = Child-lock mode -channel-type.linktap.child-lock-mode.description = The child lock mode -channel-type.linktap.child-lock-mode.state.option.0 = Unlocked -channel-type.linktap.child-lock-mode.state.option.1 = Partially locked -channel-type.linktap.child-lock-mode.state.option.2 = Completely locked -channel-type.linktap.fail-status.label = Shutdown value failed -channel-type.linktap.fail-status.description = The device has failed to close the valve -channel-type.linktap.failsafe-duration.label = Watering Cycle Failsafe -channel-type.linktap.failsafe-duration.description = Failsafe duration of the current watering cycle -channel-type.linktap.fall-status.label = Fallen status -channel-type.linktap.fall-status.description = The device has fallen -channel-type.linktap.final-segment.label = Final ECO Segment -channel-type.linktap.final-segment.description = In ECO mode this is true when the final ON watering on segment is running -channel-type.linktap.flm-linked.label = FLM Linked -channel-type.linktap.flm-linked.description = The device has a included flow meter -channel-type.linktap.flow-rate.label = Flow Rate -channel-type.linktap.flow-rate.description = Current water flow rate -channel-type.linktap.instant-duration.label = OH Instance On Duration -channel-type.linktap.instant-duration.description = Max duration allowed for the immediate watering -channel-type.linktap.instant-volume-limit.label = OH Instance On Watering Limit -channel-type.linktap.instant-volume-limit.description = Max Volume limit for immediate watering -channel-type.linktap.is-clog.label = Low Flow Detected -channel-type.linktap.is-clog.description = Unusually low flow rate detected alert -channel-type.linktap.is-leak.label = High Flow Detected -channel-type.linktap.is-leak.description = Unusually high flow rate detected alert -channel-type.linktap.man-mode.label = Manual watering -channel-type.linktap.man-mode.description = Manual watering mode status -channel-type.linktap.mode.label = Watering mode -channel-type.linktap.mode.description = The watering mode -channel-type.linktap.mode.state.option.0 = Off -channel-type.linktap.mode.state.option.1 = Instant -channel-type.linktap.mode.state.option.2 = Calendar -channel-type.linktap.mode.state.option.3 = Day -channel-type.linktap.mode.state.option.4 = Odd-even -channel-type.linktap.mode.state.option.5 = Interval -channel-type.linktap.mode.state.option.6 = Month -channel-type.linktap.remaining-duration.label = Watering Cycle Remaining -channel-type.linktap.remaining-duration.description = Remaining duration of the current watering cycle -channel-type.linktap.rf-inked.label = RF Linked -channel-type.linktap.rf-inked.description = Is the device RF linked -channel-type.linktap.signal-level.label = Signal Level -channel-type.linktap.signal-level.description = Reception Signal Strength -channel-type.linktap.skip-future-rain.label = Watering Skipped Future Rain -channel-type.linktap.skip-future-rain.description = Future rainfall calculated when watering was skipped -channel-type.linktap.skip-prev-rain.label = Watering Skipped Previous Rain -channel-type.linktap.skip-prev-rain.description = Previous rainfall calculated when watering was skipped -channel-type.linktap.skip-timestamp.label = Watering Skipped Timestamp -channel-type.linktap.skip-timestamp.description = Time when watering was skipped -channel-type.linktap.total-duration.label = Watering Cycle Duration -channel-type.linktap.total-duration.description = Total duration of current watering cycle -channel-type.linktap.volume-limit.label = Current Watering Limit -channel-type.linktap.volume-limit.description = Volume limit for the current watering cycle -channel-type.linktap.volume.label = Current Watering Volume -channel-type.linktap.volume.description = Accumulated volume of current watering cycle -channel-type.linktap.water-cut-off.label = Water Cutoff -channel-type.linktap.water-cut-off.description = Water cut-off alert -channel-type.linktap.watering.label = Watering -channel-type.linktap.watering.description = Active watering status - -# channel types - -channel-type.linktap.deviceBatteryLevel.label = Battery Level -channel-type.linktap.deviceBatteryLevel.description = Battery Remaining Level -channel-type.linktap.deviceChildLockMode.label = Child-lock mode -channel-type.linktap.deviceChildLockMode.description = The child lock mode -channel-type.linktap.deviceChildLockMode.state.option.0 = Unlocked -channel-type.linktap.deviceChildLockMode.state.option.1 = Partially locked -channel-type.linktap.deviceChildLockMode.state.option.2 = Completely locked -channel-type.linktap.deviceFailStatus.label = Shutdown value failed -channel-type.linktap.deviceFailStatus.description = The device has failed to close the valve -channel-type.linktap.deviceFailsafeDuration.label = Watering Cycle Failsafe -channel-type.linktap.deviceFailsafeDuration.description = Failsafe duration of the current watering cycle -channel-type.linktap.deviceFallStatus.label = Fallen status -channel-type.linktap.deviceFallStatus.description = The device has fallen -channel-type.linktap.deviceFinalSegment.label = Final ECO Segment -channel-type.linktap.deviceFinalSegment.description = In ECO mode this is true when the final ON watering on segment is running -channel-type.linktap.deviceFlmLinked.label = FLM Linked -channel-type.linktap.deviceFlmLinked.description = The device has a included flow meter -channel-type.linktap.deviceFlowRate.label = Flow Rate -channel-type.linktap.deviceFlowRate.description = Current water flow rate -channel-type.linktap.deviceIsClog.label = Low Flow Detected -channel-type.linktap.deviceIsClog.description = Unusually low flow rate detected alert -channel-type.linktap.deviceIsLeak.label = High Flow Detected -channel-type.linktap.deviceIsLeak.description = Unusually high flow rate detected alert -channel-type.linktap.deviceManMode.label = Manual watering -channel-type.linktap.deviceManMode.description = Manual watering mode status -channel-type.linktap.deviceMode.label = Watering mode -channel-type.linktap.deviceMode.description = The watering mode -channel-type.linktap.deviceMode.state.option.0 = Off -channel-type.linktap.deviceMode.state.option.1 = Instant -channel-type.linktap.deviceMode.state.option.2 = Calendar -channel-type.linktap.deviceMode.state.option.3 = Day -channel-type.linktap.deviceMode.state.option.4 = Odd-even -channel-type.linktap.deviceMode.state.option.5 = Interval -channel-type.linktap.deviceMode.state.option.6 = Month -channel-type.linktap.deviceRemainingDuration.label = Watering Cycle Remaining -channel-type.linktap.deviceRemainingDuration.description = Remaining duration of the current watering cycle -channel-type.linktap.deviceRfLinked.label = RF Linked -channel-type.linktap.deviceRfLinked.description = Is the device RF linked -channel-type.linktap.deviceSignalLevel.label = Signal Level -channel-type.linktap.deviceSignalLevel.description = Reception Signal Strength -channel-type.linktap.deviceTotalDuration.label = Watering Cycle Duration -channel-type.linktap.deviceTotalDuration.description = Total duration of current watering cycle -channel-type.linktap.deviceVolume.label = Current Watering Volume -channel-type.linktap.deviceVolume.description = Accumulated volume of current watering cycle -channel-type.linktap.deviceVolumeLimit.label = Current Watering Limit -channel-type.linktap.deviceVolumeLimit.description = Volume limit for the current watering cycle -channel-type.linktap.deviceWaterCutoff.label = Water Cutoff -channel-type.linktap.deviceWaterCutoff.description = Water cut-off alert -channel-type.linktap.deviceWatering.label = Watering -channel-type.linktap.deviceWatering.description = Active watering status -channel-type.linktap.ohInstantDuration.label = OH Instance On Duration -channel-type.linktap.ohInstantDuration.description = Max duration allowed for the immediate watering -channel-type.linktap.ohInstantVolumeLimit.label = OH Instance On Watering Limit -channel-type.linktap.ohInstantVolumeLimit.description = Max Volume limit for immediate watering -channel-type.linktap.waterSkipDateTime.label = Watering Skipped Timestamp -channel-type.linktap.waterSkipDateTime.description = Time when watering was skipped -channel-type.linktap.waterSkipFutureRain.label = Watering Skipped Future Rain -channel-type.linktap.waterSkipFutureRain.description = Future rainfall calculated when watering was skipped -channel-type.linktap.waterSkipPrevRain.label = Watering Skipped Previous Rain -channel-type.linktap.waterSkipPrevRain.description = Previous rainfall calculated when watering was skipped - -# informative messages - -bridge.info.awaiting-init = Awaiting Gateway initialisation - -# errors - -bridge.error.host-not-found = Hostname / IP cannot be found -bridge.error.check-credentials = Check credentials provided -bridge.error.cannot-connect = Cannot connect to LinkTap Gateway -bridge.error.unknown-host = Unknown host -bridge.error.target-is-not-gateway = Target Host is not a LinkTap Gateway -polling-device.error.bridge-unset = Bridge is not selected / set -polling-device.error.device-unknown-in-bridge = Device not found in bridges known devices -polling-device.error.unknown-device-id = Bridge does not recognise device id -polling-device.error.unknown-device = Check device setup - device is unknown -protocol.ret.success = Success -protocol.ret.format-error = Message format error -protocol.ret.cmd-unsupported = CMD message not supported -protocol.ret.gw-id-unmatched = Gateway ID not matched -protocol.ret.end-device-id-error = End device ID error -protocol.ret.end-device-id-not-found = End device ID not found -protocol.ret.gw-internal-error = Gateway internal error -protocol.ret.conflict-watering-plan = Conflict with watering plan -protocol.ret.gw-busy = Gateway busy -protocol.ret.bad-parameter-in-msg = Bad parameter in message -protocol.ret.invalid = Missing ret response -warning.failed-local-address-detection = Failed to determine local openHab address due to connection failure with exception {} -warning.no-http-server-port = HTTP Server port is not running, cannot use API callbacks -warning.fw-update-local-config = {0} -> Local configuration support requires newer firmware it should be >= {1} -warning.user-data-payload-failure = Device {0} payload validation failed - will not send due to bad data -> {1} -warning.parameter-not-accepted = Parameter not accepted by device {0} for command {1} -warning.response-from-wrong-gw-id = {0} = Response from incorrect Gateway "{1}" != "{2}" -warning.incorrect-cmd-resp = {0} = Received incorrect CMD response {1} != {2} -warning.non-gw = Communicating with non TapLink Gateway detected -warning.not-taplink-gw = {0} = {1} is not a Link Tap Gateway! -warning.comms-issue-auto-retry = {0} = Possible communications issue (auto retry): {1} -warning.device-no-accept = Device {0} did not accept command {1} -warning.error-with-gw-id = Error with gateway ID -warning.host-gw-unknown-for-cmd = Request when host "{0}" or gateway "{1}" id is unknown for command {2} -warning.discovery-charset-missing = Missing character set to decode MDNS Text -warning.unexpected-response-frame = Unexpected response frame {0} -> {1} -warning.unexpected-cmd-result = Unexpected command result -bug-report.failed-alert-enable = Raise Bug Report: {0} - Failed to enable all alerts - invalid parameter exception -bug-report.poll-failure = Raise Bug Report: {0} - Poll failure - invalid parameter exception -bug-report.pause-plan-failure = Raise Bug Report: {0} - Pause plan failure - invalid parameter exception -bug-report.unexpected-payload-failure = Potential Bug: Device {0} payload validation failed - will not send -> {1} -bug-report.gw-unsupported-command = Raise Bug Report: Command {0} not supported by gateway -exception.device-id-exception = Device ID Exception -exception.gw-id-exception = Gateway ID Exception -exception-cmd-not-supported-exception = Command Not Supported Exception -exception.invalid-parameter-exception = Invalid Parameter Exception -exception.could-not-connect = Could not connect -exception.could-not-resolve = Could not resolve IP address -exception.communications-lost = Communications Lost -exception.local-addr-lookup-failure = Local address lookup failure -exception.exec-exception = ExecutionException -> {0} -exception.not-gw.missing-headers = Missing header markers -exception.not-gw.missing-title = Not a LinkTap API response -exception.not-gw.missing-server-title = Not a LinkTap response -exception.not-gw.unexpected-status-code = Unexpected status code response -exception.not-gw.unexpected-protocol = Unexpected protocol -exception.not-tap-link-gw = Not a TapLink GW -exception.fail-servlet-registration = Register servlet failed for {0} -exception.unexpected-failure = Unexpected failure -> {0} -exception.unexpected-exception = Unexpected exception +# add-on + +addon.linktap.name = LinkTap Binding +addon.linktap.description = This is the binding for LinkTap. + +# thing types + +thing-type.linktap.device.label = LinkTap Binding Thing +thing-type.linktap.device.description = LinkTap Binding Device +thing-type.linktap.gateway.label = LinkTap Gateway +thing-type.linktap.gateway.description = This represents a LinkTap gateway + +# thing types config + +thing-type.config.linktap.device.enableAlerts.label = Auto Enable Alerts +thing-type.config.linktap.device.enableAlerts.description = If enabled, during device initialisation all alerts are enabled +thing-type.config.linktap.device.id.label = Device Id +thing-type.config.linktap.device.id.description = The Device Id for the device under the gateway +thing-type.config.linktap.device.name.label = Device Name +thing-type.config.linktap.device.name.description = The name allocated to the device by the app. (Must be unique if used) +thing-type.config.linktap.gateway.enableJSONComms.label = Enable non HTML responses +thing-type.config.linktap.gateway.enableJSONComms.description = Enable only if openHAB is directly using the Gateway, to allow more efficient communications +thing-type.config.linktap.gateway.enableMDNS.label = Enable mDNS Responder +thing-type.config.linktap.gateway.enableMDNS.description = On connection whether the mDNS responder should be enabled on the gateway device +thing-type.config.linktap.gateway.enforceProtocolLimits.label = Enforce protocol limits +thing-type.config.linktap.gateway.enforceProtocolLimits.description = If parameters outside the limits acceptable to the device's are sent they will be blocked and logged +thing-type.config.linktap.gateway.host.label = Hostname / IP +thing-type.config.linktap.gateway.host.description = The hostname / IP address of the gateway device +thing-type.config.linktap.gateway.password.label = Device Password +thing-type.config.linktap.gateway.password.description = The password if set for the gateway device +thing-type.config.linktap.gateway.username.label = Device Username +thing-type.config.linktap.gateway.username.description = The username if set for the gateway device + +# channel types + +channel-type.linktap.battery-level-type.label = Battery Level +channel-type.linktap.battery-level-type.description = Battery Remaining Level +channel-type.linktap.child-lock-type.label = Child Lock Mode +channel-type.linktap.child-lock-type.description = The child lock mode +channel-type.linktap.child-lock-type.state.option.0 = Unlocked +channel-type.linktap.child-lock-type.state.option.1 = Partially locked +channel-type.linktap.child-lock-type.state.option.2 = Completely locked +channel-type.linktap.fail-status-type.label = Shutdown Value Failed +channel-type.linktap.fail-status-type.description = The device has failed to close the valve +channel-type.linktap.failsafe-duration-type.label = Watering Cycle Failsafe +channel-type.linktap.failsafe-duration-type.description = Failsafe duration of the current watering cycle +channel-type.linktap.fall-status-type.label = Fallen Status +channel-type.linktap.fall-status-type.description = The device has fallen +channel-type.linktap.final-segment-type.label = Final ECO Segment +channel-type.linktap.final-segment-type.description = In ECO mode this is true when the final ON watering on segment is running +channel-type.linktap.flm-linked-type.label = FLM Linked +channel-type.linktap.flm-linked-type.description = The device has a included flow meter +channel-type.linktap.flow-rate-type.label = Flow Rate +channel-type.linktap.flow-rate-type.description = Current water flow rate +channel-type.linktap.instant-duration-type.label = Instant Duration Limit +channel-type.linktap.instant-duration-type.description = Max duration allowed for the immediate watering +channel-type.linktap.instant-limit-type.label = Instant Volume Limit +channel-type.linktap.instant-limit-type.description = Max Volume limit for immediate watering +channel-type.linktap.is-clog-type.label = Low Flow Detected +channel-type.linktap.is-clog-type.description = Unusually low flow rate detected alert +channel-type.linktap.is-leak-type.label = High Flow Detected +channel-type.linktap.is-leak-type.description = Unusually high flow rate detected alert +channel-type.linktap.man-mode-type.label = Manual Watering +channel-type.linktap.man-mode-type.description = Manual watering mode status +channel-type.linktap.mode-type.label = Watering Mode +channel-type.linktap.mode-type.description = The watering mode +channel-type.linktap.mode-type.state.option.0 = Off +channel-type.linktap.mode-type.state.option.1 = Instant +channel-type.linktap.mode-type.state.option.2 = Calendar +channel-type.linktap.mode-type.state.option.3 = Day +channel-type.linktap.mode-type.state.option.4 = Odd-even +channel-type.linktap.mode-type.state.option.5 = Interval +channel-type.linktap.mode-type.state.option.6 = Month +channel-type.linktap.pause-enable-type.label = Pause plan schedule +channel-type.linktap.pause-enable-type.description = When ON will pause the current watering plan for an hour every 55 minutes +channel-type.linktap.pause-until-type.label = Plan Paused Until +channel-type.linktap.pause-until-type.description = Displays when the last pause issued will expiry, resuming the current watering plan +channel-type.linktap.plan-id-type.label = Watering Plan Id +channel-type.linktap.plan-id-type.description = Displays the current watering plan id +channel-type.linktap.remaining-duration-type.label = Watering Cycle Remaining +channel-type.linktap.remaining-duration-type.description = Remaining duration of the current watering cycle +channel-type.linktap.rf-linked-type.label = RF Linked +channel-type.linktap.rf-linked-type.description = Is the device RF linked +channel-type.linktap.signal-level-type.label = Signal Level +channel-type.linktap.signal-level-type.description = Reception Signal Strength +channel-type.linktap.total-duration-type.label = Watering Cycle Duration +channel-type.linktap.total-duration-type.description = Total duration of current watering cycle +channel-type.linktap.volume-limit-type.label = Current Watering Limit +channel-type.linktap.volume-limit-type.description = Volume limit for the current watering cycle +channel-type.linktap.volume-type.label = Current Watering Volume +channel-type.linktap.volume-type.description = Accumulated volume of current watering cycle +channel-type.linktap.water-cut-type.label = Water Cutoff +channel-type.linktap.water-cut-type.description = Water cut-off alert +channel-type.linktap.watering-type.label = Watering +channel-type.linktap.watering-type.description = Active watering status + +# thing types + +thing-type.linktap.bridge.label = LinkTap Bridge +thing-type.linktap.bridge.description = The LinkTap bridge represents a LinkTap gateway device + +# thing types config + +thing-type.config.linktap.bridge.enableMDNS.label = Enable mDNS Responder +thing-type.config.linktap.bridge.enableMDNS.description = On connection whether the mDNS responder should be enabled on the gateway device +thing-type.config.linktap.bridge.host.label = Hostname / IP +thing-type.config.linktap.bridge.host.description = The hostname / IP address of the gateway device +thing-type.config.linktap.bridge.password.label = Device Password +thing-type.config.linktap.bridge.password.description = The password if set for the gateway device +thing-type.config.linktap.bridge.username.label = Device Username +thing-type.config.linktap.bridge.username.description = The username if set for the gateway device + +# channel types + +channel-type.linktap.future-rain-type.label = Watering Skipped Future +channel-type.linktap.future-rain-type.description = Future rainfall calculated when watering was skipped +channel-type.linktap.prev-rain-type.label = Watering Skipped Previous +channel-type.linktap.prev-rain-type.description = Previous rainfall calculated when watering was skipped +channel-type.linktap.rain-timestamp-type.label = Watering Skipped Timestamp +channel-type.linktap.rain-timestamp-type.description = Time when watering was skipped + +# channel types + +channel-type.linktap.instant-volume-limit-type.label = OH Instance On Watering Limit +channel-type.linktap.instant-volume-limit-type.description = Max Volume limit for immediate watering + +# channel types + +channel-type.linktap.battery-level.label = Battery Level +channel-type.linktap.battery-level.description = Battery Remaining Level +channel-type.linktap.child-lock-mode.label = Child-lock mode +channel-type.linktap.child-lock-mode.description = The child lock mode +channel-type.linktap.child-lock-mode.state.option.0 = Unlocked +channel-type.linktap.child-lock-mode.state.option.1 = Partially locked +channel-type.linktap.child-lock-mode.state.option.2 = Completely locked +channel-type.linktap.fail-status.label = Shutdown value failed +channel-type.linktap.fail-status.description = The device has failed to close the valve +channel-type.linktap.failsafe-duration.label = Watering Cycle Failsafe +channel-type.linktap.failsafe-duration.description = Failsafe duration of the current watering cycle +channel-type.linktap.fall-status.label = Fallen status +channel-type.linktap.fall-status.description = The device has fallen +channel-type.linktap.final-segment.label = Final ECO Segment +channel-type.linktap.final-segment.description = In ECO mode this is true when the final ON watering on segment is running +channel-type.linktap.flm-linked.label = FLM Linked +channel-type.linktap.flm-linked.description = The device has a included flow meter +channel-type.linktap.flow-rate.label = Flow Rate +channel-type.linktap.flow-rate.description = Current water flow rate +channel-type.linktap.instant-duration.label = OH Instance On Duration +channel-type.linktap.instant-duration.description = Max duration allowed for the immediate watering +channel-type.linktap.instant-volume-limit.label = OH Instance On Watering Limit +channel-type.linktap.instant-volume-limit.description = Max Volume limit for immediate watering +channel-type.linktap.is-clog.label = Low Flow Detected +channel-type.linktap.is-clog.description = Unusually low flow rate detected alert +channel-type.linktap.is-leak.label = High Flow Detected +channel-type.linktap.is-leak.description = Unusually high flow rate detected alert +channel-type.linktap.man-mode.label = Manual watering +channel-type.linktap.man-mode.description = Manual watering mode status +channel-type.linktap.mode.label = Watering mode +channel-type.linktap.mode.description = The watering mode +channel-type.linktap.mode.state.option.0 = Off +channel-type.linktap.mode.state.option.1 = Instant +channel-type.linktap.mode.state.option.2 = Calendar +channel-type.linktap.mode.state.option.3 = Day +channel-type.linktap.mode.state.option.4 = Odd-even +channel-type.linktap.mode.state.option.5 = Interval +channel-type.linktap.mode.state.option.6 = Month +channel-type.linktap.remaining-duration.label = Watering Cycle Remaining +channel-type.linktap.remaining-duration.description = Remaining duration of the current watering cycle +channel-type.linktap.rf-inked.label = RF Linked +channel-type.linktap.rf-inked.description = Is the device RF linked +channel-type.linktap.signal-level.label = Signal Level +channel-type.linktap.signal-level.description = Reception Signal Strength +channel-type.linktap.skip-future-rain.label = Watering Skipped Future Rain +channel-type.linktap.skip-future-rain.description = Future rainfall calculated when watering was skipped +channel-type.linktap.skip-prev-rain.label = Watering Skipped Previous Rain +channel-type.linktap.skip-prev-rain.description = Previous rainfall calculated when watering was skipped +channel-type.linktap.skip-timestamp.label = Watering Skipped Timestamp +channel-type.linktap.skip-timestamp.description = Time when watering was skipped +channel-type.linktap.total-duration.label = Watering Cycle Duration +channel-type.linktap.total-duration.description = Total duration of current watering cycle +channel-type.linktap.volume-limit.label = Current Watering Limit +channel-type.linktap.volume-limit.description = Volume limit for the current watering cycle +channel-type.linktap.volume.label = Current Watering Volume +channel-type.linktap.volume.description = Accumulated volume of current watering cycle +channel-type.linktap.water-cut-off.label = Water Cutoff +channel-type.linktap.water-cut-off.description = Water cut-off alert +channel-type.linktap.watering.label = Watering +channel-type.linktap.watering.description = Active watering status + +# channel types + +channel-type.linktap.deviceBatteryLevel.label = Battery Level +channel-type.linktap.deviceBatteryLevel.description = Battery Remaining Level +channel-type.linktap.deviceChildLockMode.label = Child-lock mode +channel-type.linktap.deviceChildLockMode.description = The child lock mode +channel-type.linktap.deviceChildLockMode.state.option.0 = Unlocked +channel-type.linktap.deviceChildLockMode.state.option.1 = Partially locked +channel-type.linktap.deviceChildLockMode.state.option.2 = Completely locked +channel-type.linktap.deviceFailStatus.label = Shutdown value failed +channel-type.linktap.deviceFailStatus.description = The device has failed to close the valve +channel-type.linktap.deviceFailsafeDuration.label = Watering Cycle Failsafe +channel-type.linktap.deviceFailsafeDuration.description = Failsafe duration of the current watering cycle +channel-type.linktap.deviceFallStatus.label = Fallen status +channel-type.linktap.deviceFallStatus.description = The device has fallen +channel-type.linktap.deviceFinalSegment.label = Final ECO Segment +channel-type.linktap.deviceFinalSegment.description = In ECO mode this is true when the final ON watering on segment is running +channel-type.linktap.deviceFlmLinked.label = FLM Linked +channel-type.linktap.deviceFlmLinked.description = The device has a included flow meter +channel-type.linktap.deviceFlowRate.label = Flow Rate +channel-type.linktap.deviceFlowRate.description = Current water flow rate +channel-type.linktap.deviceIsClog.label = Low Flow Detected +channel-type.linktap.deviceIsClog.description = Unusually low flow rate detected alert +channel-type.linktap.deviceIsLeak.label = High Flow Detected +channel-type.linktap.deviceIsLeak.description = Unusually high flow rate detected alert +channel-type.linktap.deviceManMode.label = Manual watering +channel-type.linktap.deviceManMode.description = Manual watering mode status +channel-type.linktap.deviceMode.label = Watering mode +channel-type.linktap.deviceMode.description = The watering mode +channel-type.linktap.deviceMode.state.option.0 = Off +channel-type.linktap.deviceMode.state.option.1 = Instant +channel-type.linktap.deviceMode.state.option.2 = Calendar +channel-type.linktap.deviceMode.state.option.3 = Day +channel-type.linktap.deviceMode.state.option.4 = Odd-even +channel-type.linktap.deviceMode.state.option.5 = Interval +channel-type.linktap.deviceMode.state.option.6 = Month +channel-type.linktap.deviceRemainingDuration.label = Watering Cycle Remaining +channel-type.linktap.deviceRemainingDuration.description = Remaining duration of the current watering cycle +channel-type.linktap.deviceRfLinked.label = RF Linked +channel-type.linktap.deviceRfLinked.description = Is the device RF linked +channel-type.linktap.deviceSignalLevel.label = Signal Level +channel-type.linktap.deviceSignalLevel.description = Reception Signal Strength +channel-type.linktap.deviceTotalDuration.label = Watering Cycle Duration +channel-type.linktap.deviceTotalDuration.description = Total duration of current watering cycle +channel-type.linktap.deviceVolume.label = Current Watering Volume +channel-type.linktap.deviceVolume.description = Accumulated volume of current watering cycle +channel-type.linktap.deviceVolumeLimit.label = Current Watering Limit +channel-type.linktap.deviceVolumeLimit.description = Volume limit for the current watering cycle +channel-type.linktap.deviceWaterCutoff.label = Water Cutoff +channel-type.linktap.deviceWaterCutoff.description = Water cut-off alert +channel-type.linktap.deviceWatering.label = Watering +channel-type.linktap.deviceWatering.description = Active watering status +channel-type.linktap.ohInstantDuration.label = OH Instance On Duration +channel-type.linktap.ohInstantDuration.description = Max duration allowed for the immediate watering +channel-type.linktap.ohInstantVolumeLimit.label = OH Instance On Watering Limit +channel-type.linktap.ohInstantVolumeLimit.description = Max Volume limit for immediate watering +channel-type.linktap.waterSkipDateTime.label = Watering Skipped Timestamp +channel-type.linktap.waterSkipDateTime.description = Time when watering was skipped +channel-type.linktap.waterSkipFutureRain.label = Watering Skipped Future Rain +channel-type.linktap.waterSkipFutureRain.description = Future rainfall calculated when watering was skipped +channel-type.linktap.waterSkipPrevRain.label = Watering Skipped Previous Rain +channel-type.linktap.waterSkipPrevRain.description = Previous rainfall calculated when watering was skipped + +# informative messages + +bridge.info.awaiting-init = Awaiting Gateway initialisation + +# errors + +bridge.error.host-not-found = Hostname / IP cannot be found +bridge.error.check-credentials = Check credentials provided +bridge.error.cannot-connect = Cannot connect to LinkTap Gateway +bridge.error.unknown-host = Unknown host +bridge.error.target-is-not-gateway = Target Host is not a LinkTap Gateway +polling-device.error.bridge-unset = Bridge is not selected / set +polling-device.error.device-unknown-in-bridge = Device not found in bridges known devices +polling-device.error.unknown-device-id = Bridge does not recognise device id +polling-device.error.unknown-device = Check device setup - device is unknown +protocol.ret.success = Success +protocol.ret.format-error = Message format error +protocol.ret.cmd-unsupported = CMD message not supported +protocol.ret.gw-id-unmatched = Gateway ID not matched +protocol.ret.end-device-id-error = End device ID error +protocol.ret.end-device-id-not-found = End device ID not found +protocol.ret.gw-internal-error = Gateway internal error +protocol.ret.conflict-watering-plan = Conflict with watering plan +protocol.ret.gw-busy = Gateway busy +protocol.ret.bad-parameter-in-msg = Bad parameter in message +protocol.ret.invalid = Missing ret response +warning.failed-local-address-detection = Failed to determine local openHab address due to connection failure with exception {} +warning.no-http-server-port = HTTP Server port is not running, cannot use API callbacks +warning.fw-update-local-config = {0} -> Local configuration support requires newer firmware it should be >= {1} +warning.user-data-payload-failure = Device {0} payload validation failed - will not send due to bad data -> {1} +warning.parameter-not-accepted = Parameter not accepted by device {0} for command {1} +warning.response-from-wrong-gw-id = {0} = Response from incorrect Gateway "{1}" != "{2}" +warning.incorrect-cmd-resp = {0} = Received incorrect CMD response {1} != {2} +warning.non-gw = Communicating with non TapLink Gateway detected +warning.not-taplink-gw = {0} = {1} is not a Link Tap Gateway! +warning.comms-issue-auto-retry = {0} = Possible communications issue (auto retry): {1} +warning.device-no-accept = Device {0} did not accept command {1} +warning.error-with-gw-id = Error with gateway ID +warning.host-gw-unknown-for-cmd = Request when host "{0}" or gateway "{1}" id is unknown for command {2} +warning.discovery-charset-missing = Missing character set to decode MDNS Text +warning.unexpected-response-frame = Unexpected response frame {0} -> {1} +warning.unexpected-cmd-result = Unexpected command result +bug-report.failed-alert-enable = Raise Bug Report: {0} - Failed to enable all alerts - invalid parameter exception +bug-report.poll-failure = Raise Bug Report: {0} - Poll failure - invalid parameter exception +bug-report.pause-plan-failure = Raise Bug Report: {0} - Pause plan failure - invalid parameter exception +bug-report.unexpected-payload-failure = Potential Bug: Device {0} payload validation failed - will not send -> {1} +bug-report.gw-unsupported-command = Raise Bug Report: Command {0} not supported by gateway +exception.device-id-exception = Device ID Exception +exception.gw-id-exception = Gateway ID Exception +exception-cmd-not-supported-exception = Command Not Supported Exception +exception.invalid-parameter-exception = Invalid Parameter Exception +exception.could-not-connect = Could not connect +exception.could-not-resolve = Could not resolve IP address +exception.communications-lost = Communications Lost +exception.local-addr-lookup-failure = Local address lookup failure +exception.exec-exception = ExecutionException -> {0} +exception.not-gw.missing-headers = Missing header markers +exception.not-gw.missing-title = Not a LinkTap API response +exception.not-gw.missing-server-title = Not a LinkTap response +exception.not-gw.unexpected-status-code = Unexpected status code response +exception.not-gw.unexpected-protocol = Unexpected protocol +exception.not-tap-link-gw = Not a TapLink GW +exception.fail-servlet-registration = Register servlet failed for {0} +exception.unexpected-failure = Unexpected failure -> {0} +exception.unexpected-exception = Unexpected exception From e21e3e280984469e85dfe89f9d1d15869b3c163c Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Mon, 12 May 2025 01:05:49 +0100 Subject: [PATCH 09/15] [linktap] Missed call remap to single method [linktap] Missed call remap to single method Signed-off-by: David Goodyear --- .../binding/linktap/internal/LinkTapBridgeHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java index 07aab4a6f78b9..ae6ceef19129d 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java @@ -383,7 +383,7 @@ public String sendSingleApiRequest(final TLGatewayFrame req) throws TransientCom } final String reqData = LinkTapBindingConstants.GSON.toJson(req); logger.debug("{} = APP BRIDGE -> GW -> Request {}", uid, reqData); - final String respData = api.sendRequest(host, config.gatewayRequestTimeout, reqData); + final String respData = api.sendRequest(host, getRequestTimeout(), reqData); logger.debug("{} = APP BRIDGE -> GW -> Response {}", uid, respData); final GatewayDeviceResponse gwResponseFrame = LinkTapBindingConstants.GSON.fromJson(respData, GatewayDeviceResponse.class); @@ -536,8 +536,8 @@ private void connect() { } private void scheduleReconnect() { - scheduleReconnect(config.gatewayRequestTimeout * 5); // 5 is due to the number of req/resp required for - // connection + scheduleReconnect(getRequestTimeout() * 5); // 5 is due to the number of req/resp required for + // connection } public void attemptReconnectIfNeeded() { From bf7669069633c03c000780a3e1322e1fec805192 Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Mon, 12 May 2025 01:08:58 +0100 Subject: [PATCH 10/15] [linktap] Remove unnecessary parameter addition [linktap] Remove unnecessary parameter addition Signed-off-by: David Goodyear --- .../openhab/binding/linktap/internal/LinkTapBridgeHandler.java | 2 +- .../openhab/binding/linktap/internal/PollingDeviceHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java index ae6ceef19129d..9dcf5285e2824 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java @@ -591,7 +591,7 @@ public void handleCommand(final ChannelUID channelUID, final Command command) { private final Object singleCommLock = new Object(); - public String sendRequest(final TLGatewayFrame frame, final int reqTimeout) + public String sendRequest(final TLGatewayFrame frame) throws DeviceIdException, InvalidParameterException { // Validate the payload is within the expected limits for the device its being sent to if (config.enforceProtocolLimits) { diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/PollingDeviceHandler.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/PollingDeviceHandler.java index f9f1575a7f293..6c8c54c9e7dbc 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/PollingDeviceHandler.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/PollingDeviceHandler.java @@ -247,7 +247,7 @@ public String sendRequest(TLGatewayFrame frame) throws InvalidParameterException return EMPTY_STRING; } try { - return parentBridgeHandler.sendRequest(frame, parentBridgeHandler.getRequestTimeout()); + return parentBridgeHandler.sendRequest(frame); } catch (final DeviceIdException die) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, getLocalizedText(die.getI18Key())); } From 9264323b913440676c940531f7ea2c185a3e2f7c Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Mon, 12 May 2025 01:12:43 +0100 Subject: [PATCH 11/15] [linktap] Spotless apply [linktap] Spotless apply Signed-off-by: David Goodyear --- .../openhab/binding/linktap/internal/LinkTapBridgeHandler.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java index 9dcf5285e2824..d208291386498 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java @@ -591,8 +591,7 @@ public void handleCommand(final ChannelUID channelUID, final Command command) { private final Object singleCommLock = new Object(); - public String sendRequest(final TLGatewayFrame frame) - throws DeviceIdException, InvalidParameterException { + public String sendRequest(final TLGatewayFrame frame) throws DeviceIdException, InvalidParameterException { // Validate the payload is within the expected limits for the device its being sent to if (config.enforceProtocolLimits) { final Collection errors = frame.getValidationErrors(); From 95a24c60f345fa5bfde45e9e208f2f74ad24d11c Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Mon, 12 May 2025 01:17:27 +0100 Subject: [PATCH 12/15] [linktap] i18n additions for new config [linktap] i18n additions for new config Signed-off-by: David Goodyear --- .../src/main/resources/OH-INF/i18n/linktap.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties index 1e203ed0efbe5..52543e0e5a0f0 100644 --- a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties +++ b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties @@ -24,6 +24,8 @@ thing-type.config.linktap.gateway.enableMDNS.label = Enable mDNS Responder thing-type.config.linktap.gateway.enableMDNS.description = On connection whether the mDNS responder should be enabled on the gateway device thing-type.config.linktap.gateway.enforceProtocolLimits.label = Enforce protocol limits thing-type.config.linktap.gateway.enforceProtocolLimits.description = If parameters outside the limits acceptable to the device's are sent they will be blocked and logged +thing-type.config.linktap.gateway.gatewayRequestTimeout.label = Gateway Response Timeout +thing-type.config.linktap.gateway.gatewayRequestTimeout.description = For slow or heavily loaded systems this may need increasing, if communication errors are seen (seconds allowed for responses from the gateway) thing-type.config.linktap.gateway.host.label = Hostname / IP thing-type.config.linktap.gateway.host.description = The hostname / IP address of the gateway device thing-type.config.linktap.gateway.password.label = Device Password From 51b3cf5d4cb42525c45e434fb653354ad76e26c7 Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Tue, 13 May 2025 00:05:09 +0100 Subject: [PATCH 13/15] [linktap] force push [linktap] force push Signed-off-by: David Goodyear --- bundles/org.openhab.binding.linktap/README.md | 18 ++--- .../LinkTapBridgeConfiguration.java | 2 +- .../internal/LinkTapBindingConstants.java | 2 +- .../internal/LinkTapBridgeHandler.java | 16 ++-- .../internal/TransactionProcessor.java | 2 +- .../protocol/http/JettyTraceListener.java | 76 +++++++++++++++++++ .../linktap/protocol/http/WebServerApi.java | 31 +++++--- .../resources/OH-INF/thing/thing-types.xml | 2 +- 8 files changed, 119 insertions(+), 30 deletions(-) create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/JettyTraceListener.java diff --git a/bundles/org.openhab.binding.linktap/README.md b/bundles/org.openhab.binding.linktap/README.md index 01131762a65f9..0e047b29d324f 100644 --- a/bundles/org.openhab.binding.linktap/README.md +++ b/bundles/org.openhab.binding.linktap/README.md @@ -70,15 +70,15 @@ If the gateway cannot publish to openHAB, then the gateway is checked every 2 mi ### Gateway Configuration -| Name | Type | Description | Recommended Values | Required | Advanced | -|-----------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------|----------| -| host | text | The hostname / IP address of the gateway device | | Yes | No | -| username | text | The username if set for the gateway device | | No | No | -| password | text | The password if set for the gateway device | | No | No | -| enableMDNS | boolean | On connection whether the mDNS responder should be enabled on the gateway device | true | No | Yes | -| enforceProtocolLimits | boolean | If true data outside of the allowed ranges against the protocol will be logged and not sent | true | No | Yes | -| enableJSONComms | boolean | false by default for backwards compatibility, if using up to date firmware with no other local network applications set this to true, for more efficient communications | true | No | Yes | -| gatewayRequestTimeout | integer | For slow or heavily loaded systems this may need increasing, if communication errors are seen (seconds allowed for responses from the gateway) | 3 | No | Yes | +| Name | Type | Description | Recommended Values | Required | Advanced | +|------------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------|----------| +| host | text | The hostname / IP address of the gateway device | | Yes | No | +| username | text | The username if set for the gateway device | | No | No | +| password | text | The password if set for the gateway device | | No | No | +| enableMDNS | boolean | On connection whether the mDNS responder should be enabled on the gateway device | true | No | Yes | +| enforceProtocolLimits | boolean | If true data outside of the allowed ranges against the protocol will be logged and not sent | true | No | Yes | +| enableJSONComms | boolean | false by default for backwards compatibility, if using up to date firmware with no other local network applications set this to true, for more efficient communications | true | No | Yes | +| gatewayResponseTimeout | integer | For slow or heavily loaded systems this may need increasing, if communication errors are seen (seconds allowed for responses from the gateway) | 3 | No | Yes | **NOTE** When enableMDNS is enabled, upon connection to the gateway option "Enable mDNS responder" is switched on. diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/configuration/LinkTapBridgeConfiguration.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/configuration/LinkTapBridgeConfiguration.java index 68e9e0d6f0420..150a6d68c08b3 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/configuration/LinkTapBridgeConfiguration.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/configuration/LinkTapBridgeConfiguration.java @@ -28,5 +28,5 @@ public class LinkTapBridgeConfiguration { public boolean enableMDNS = true; public boolean enableJSONComms = false; public boolean enforceProtocolLimits = true; - public int gatewayRequestTimeout = 3; + public int gatewayResponseTimeout = 3; } diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java index c095243737b16..2db6568c36976 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java @@ -59,7 +59,7 @@ public class LinkTapBindingConstants { public static final String BRIDGE_CONFIG_MDNS_ENABLE = "enableMDNS"; public static final String BRIDGE_CONFIG_NON_HTML_COMM_ENABLE = "enableJSONComms"; public static final String BRIDGE_CONFIG_ENFORCE_COMM_LIMITS = "enforceProtocolLimits"; - public static final String BRIDGE_CONFIG_GATEWAY_RESPONSE_TIMEOUT = "gatewayRequestTimeout"; + public static final String BRIDGE_CONFIG_GATEWAY_RESPONSE_TIMEOUT = "gatewayResponseTimeout"; public static final String DEVICE_PROP_DEV_ID = "deviceId"; public static final String DEVICE_PROP_DEV_NAME = "deviceName"; diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java index d208291386498..d99a0ce05b4d0 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java @@ -143,8 +143,8 @@ public String getLocalizedText(String key, @Nullable Object @Nullable... argumen return Objects.nonNull(result) ? result : key; } - public int getRequestTimeout() { - return config.gatewayRequestTimeout; + public int getResponseTimeout() { + return config.gatewayResponseTimeout; } private void startGwPolling() { @@ -383,7 +383,7 @@ public String sendSingleApiRequest(final TLGatewayFrame req) throws TransientCom } final String reqData = LinkTapBindingConstants.GSON.toJson(req); logger.debug("{} = APP BRIDGE -> GW -> Request {}", uid, reqData); - final String respData = api.sendRequest(host, getRequestTimeout(), reqData); + final String respData = api.sendRequest(host, getResponseTimeout(), reqData); logger.debug("{} = APP BRIDGE -> GW -> Response {}", uid, respData); final GatewayDeviceResponse gwResponseFrame = LinkTapBindingConstants.GSON.fromJson(respData, GatewayDeviceResponse.class); @@ -433,7 +433,7 @@ private void connect() { final WebServerApi api = WebServerApi.getInstance(); api.setHttpClient(httpClientProvider.getHttpClient()); try { - final Map bridgeProps = api.getBridgeProperities(bridgeKey, getRequestTimeout()); + final Map bridgeProps = api.getBridgeProperities(bridgeKey, getResponseTimeout()); if (!bridgeProps.isEmpty()) { final String readGwId = bridgeProps.get(BRIDGE_PROP_GW_ID); if (readGwId != null) { @@ -443,7 +443,7 @@ private void connect() { currentProps.putAll(bridgeProps); updateProperties(currentProps); } else { - if (!api.unlockWebInterface(bridgeKey, getRequestTimeout(), config.username, config.password)) { + if (!api.unlockWebInterface(bridgeKey, getResponseTimeout(), config.username, config.password)) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, getLocalizedText("bridge.error.check-credentials")); return; @@ -485,7 +485,7 @@ private void connect() { final String servletEp = BindingServlet.getServletAddress(localServerAddr, getLocalizedText("warning.no-http-server-port")); final Optional servletEpOpt = (!servletEp.isEmpty()) ? Optional.of(servletEp) : Optional.empty(); - api.configureBridge(hostname, getRequestTimeout(), Optional.of(config.enableMDNS), + api.configureBridge(hostname, getResponseTimeout(), Optional.of(config.enableMDNS), Optional.of(config.enableJSONComms), servletEpOpt); if (Thread.currentThread().isInterrupted()) { return; @@ -536,8 +536,8 @@ private void connect() { } private void scheduleReconnect() { - scheduleReconnect(getRequestTimeout() * 5); // 5 is due to the number of req/resp required for - // connection + scheduleReconnect(getResponseTimeout() * 5); // 5 is due to the number of req/resp required for + // connection } public void attemptReconnectIfNeeded() { diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java index c04884c5497cb..f8392deba1932 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java @@ -239,7 +239,7 @@ public String sendSingleRequest(final LinkTapBridgeHandler handler, final TLGate final String payloadJson = GSON.toJson(request); logger.debug("{} = APP -> GW Request {} -> Payload {}", uid, targetHost, payloadJson); - String response = API.sendRequest(targetHost, handler.getRequestTimeout(), GSON.toJson(request)); + String response = API.sendRequest(targetHost, handler.getResponseTimeout(), GSON.toJson(request)); logger.debug("{} = APP -> GW Response {} -> Payload {}", uid, targetHost, response.trim()); GatewayDeviceResponse gatewayFrame = GSON.fromJson(response, GatewayDeviceResponse.class); diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/JettyTraceListener.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/JettyTraceListener.java new file mode 100644 index 0000000000000..1cfd60df951f2 --- /dev/null +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/JettyTraceListener.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.linktap.protocol.http; + +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; +import org.eclipse.jetty.client.api.Request; +import org.slf4j.Logger; + +/** + * The {@link JettyTraceListener} defines a basic listener that can be utilised for logging jetty client states. + * + * @author David Goodyear - Initial contribution + */ +@NonNullByDefault +public final class JettyTraceListener implements Request.Listener { + + private final Logger logger; + + public JettyTraceListener(final Logger logger) { + this.logger = logger; + } + + @Override + public void onQueued(@Nullable Request request) { + if (request != null) { + logger.trace("HTTP Comms request is queued to be processed to {}", request.getURI()); + } else { + logger.trace("HTTP Comms request is queued to be processed"); + } + Request.Listener.super.onQueued(request); + } + + @Override + public void onBegin(@Nullable Request request) { + if (request != null) { + logger.trace("HTTP Comms request is beginning to be processed to {}", request.getURI()); + } else { + logger.trace("HTTP Comms request is beginning to be processed"); + } + Request.Listener.super.onBegin(request); + } + + @Override + public void onSuccess(@Nullable Request request) { + if (request != null) { + logger.trace("HTTP Comms request has been reported as successful to {}", request.getURI()); + } else { + logger.trace("HTTP Comms request has been reported as successful"); + } + Request.Listener.super.onSuccess(request); + } + + @Override + public void onFailure(@Nullable Request request, @Nullable Throwable failure) { + if (request != null) { + logger.trace("HTTP Comms request has failed {}", request.getHost()); + } else { + logger.trace("HTTP Comms request has failed with error"); + } + if (failure != null) { + logger.trace("HTTP Comms request has failed due to cause {}", failure.toString()); + } + Request.Listener.super.onFailure(request, failure); + } +} diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java index f4e7f9ceb3b72..2a9f8487b9dd9 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java @@ -90,6 +90,7 @@ public final class WebServerApi { private static final WebServerApi INSTANCE = new WebServerApi(); private static final String REQ_HDR_APPLICATION_JSON = new MediaType("application", "json", "UTF-8").toString(); private final Logger logger = LoggerFactory.getLogger(WebServerApi.class); + public final JettyTraceListener jettyTraceListener = new JettyTraceListener(logger); private @NonNullByDefault({}) HttpClient httpClient; private @Nullable TranslationProvider translationProvider; @@ -135,7 +136,7 @@ public Map getBridgeProperities(final String hostname, final int throws LinkTapException, NotTapLinkGatewayException, TransientCommunicationIssueException { try { final Request request = httpClient.newRequest(URI_HOST_PREFIX + hostname).method(HttpMethod.GET); - final ContentResponse cr = request.timeout(timeoutSeconds, TimeUnit.SECONDS).send(); + final ContentResponse cr = addTraceListener(request).timeout(timeoutSeconds, TimeUnit.SECONDS).send(); if (HttpURLConnection.HTTP_OK != cr.getStatus()) { throw new NotTapLinkGatewayException(UNEXPECTED_STATUS_CODE); } @@ -384,7 +385,7 @@ public boolean configureBridge(final @Nullable String hostname, final int timeou } final String targetHost = URI_HOST_PREFIX + hostname; final Request request = httpClient.newRequest(targetHost).method(HttpMethod.GET); - final ContentResponse cr = request.timeout(timeoutSeconds, TimeUnit.SECONDS).send(); + final ContentResponse cr = addTraceListener(request).timeout(timeoutSeconds, TimeUnit.SECONDS).send(); if (HttpURLConnection.HTTP_OK != cr.getStatus()) { throw new NotTapLinkGatewayException(UNEXPECTED_STATUS_CODE); } @@ -410,7 +411,8 @@ public boolean configureBridge(final @Nullable String hostname, final int timeou logger.debug("Updating mdns server settings on gateway"); final Request mdnsRequest = httpClient .newRequest(targetHost + "/index.shtml?flag=4&" + mdnsEnableReqStr).method(HttpMethod.GET); - final ContentResponse mdnsCr = mdnsRequest.timeout(timeoutSeconds, TimeUnit.SECONDS).send(); + final ContentResponse mdnsCr = addTraceListener(mdnsRequest) + .timeout(timeoutSeconds, TimeUnit.SECONDS).send(); if (HttpURLConnection.HTTP_OK != mdnsCr.getStatus()) { throw new NotTapLinkGatewayException(UNEXPECTED_STATUS_CODE); } @@ -433,7 +435,8 @@ public boolean configureBridge(final @Nullable String hostname, final int timeou final Request lhttpApiRequest = httpClient .newRequest(targetHost + "/index.shtml?flag=5&" + localHttpApiReqStr) .method(HttpMethod.GET); - final ContentResponse mdnsCr = lhttpApiRequest.timeout(timeoutSeconds, TimeUnit.SECONDS).send(); + final ContentResponse mdnsCr = addTraceListener(lhttpApiRequest) + .timeout(timeoutSeconds, TimeUnit.SECONDS).send(); if (HttpURLConnection.HTTP_OK != mdnsCr.getStatus()) { throw new NotTapLinkGatewayException(UNEXPECTED_STATUS_CODE); } @@ -445,7 +448,8 @@ public boolean configureBridge(final @Nullable String hostname, final int timeou logger.debug("Rebooting gateway to apply new settings"); final Request restartReq = httpClient.newRequest(targetHost + "/index.shtml?flag=0") .method(HttpMethod.GET); - final ContentResponse mdnsCr = restartReq.timeout(timeoutSeconds, TimeUnit.SECONDS).send(); + final ContentResponse mdnsCr = addTraceListener(restartReq).timeout(timeoutSeconds, TimeUnit.SECONDS) + .send(); if (HttpURLConnection.HTTP_OK != mdnsCr.getStatus()) { throw new NotTapLinkGatewayException(UNEXPECTED_STATUS_CODE); } @@ -479,7 +483,8 @@ public boolean unlockWebInterface(final String hostname, final int timeoutSecond fields.put(FIELD_ADMIN_USER_PWD, password); final Request request = httpClient.newRequest(URI_HOST_PREFIX + hostname + "/login.shtml") .method(HttpMethod.POST).content(new FormContentProvider(fields)); - final ContentResponse cr = request.timeout(timeoutSeconds, TimeUnit.SECONDS).send(); + + final ContentResponse cr = addTraceListener(request).timeout(timeoutSeconds, TimeUnit.SECONDS).send(); if (HttpURLConnection.HTTP_OK != cr.getStatus()) { throw new NotTapLinkGatewayException(UNEXPECTED_STATUS_CODE); } @@ -522,10 +527,10 @@ public String sendRequest(final String hostname, final int timeoutSeconds, final try { final InetAddress address = InetAddress.getByName(hostname); logger.trace("API Endpoint: {}", URI_HOST_PREFIX + address.getHostAddress() + "/api.shtml"); - final Request request = httpClient.POST(URI_HOST_PREFIX + address.getHostAddress() + "/api.shtml"); - request.content(new StringContentProvider(requestBody), REQ_HDR_APPLICATION_JSON); + final Request request = httpClient.POST(URI_HOST_PREFIX + address.getHostAddress() + "/api.shtml") + .content(new StringContentProvider(requestBody), REQ_HDR_APPLICATION_JSON); - final ContentResponse cr = request.timeout(timeoutSeconds, TimeUnit.SECONDS).send(); + final ContentResponse cr = addTraceListener(request).timeout(timeoutSeconds, TimeUnit.SECONDS).send(); if (HttpURLConnection.HTTP_OK != cr.getStatus()) { throw new NotTapLinkGatewayException(UNEXPECTED_STATUS_CODE); } @@ -572,4 +577,12 @@ public String sendRequest(final String hostname, final int timeoutSeconds, final } } } + + private org.eclipse.jetty.client.api.Request addTraceListener(final Request request) { + if (logger.isTraceEnabled()) { + return request.onRequestQueued(jettyTraceListener).onRequestBegin(jettyTraceListener) + .onRequestSuccess(jettyTraceListener).onRequestFailure(jettyTraceListener); + } + return request; + } } diff --git a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml index 37112a6b9d466..fc816cd893dc1 100644 --- a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml +++ b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml @@ -53,7 +53,7 @@ true true - + For slow or heavily loaded systems this may need increasing, if communication errors are seen (seconds allowed for responses from the gateway) From 1350d86de3d0c9dfb63c51121b5868646f7cd815 Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Tue, 13 May 2025 20:40:18 +0100 Subject: [PATCH 14/15] [linktap] adjust scope to private [linktap] adjust scope to private Signed-off-by: David Goodyear --- .../org/openhab/binding/linktap/protocol/http/WebServerApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java index 2a9f8487b9dd9..2cace1898b205 100644 --- a/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java +++ b/bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java @@ -90,7 +90,7 @@ public final class WebServerApi { private static final WebServerApi INSTANCE = new WebServerApi(); private static final String REQ_HDR_APPLICATION_JSON = new MediaType("application", "json", "UTF-8").toString(); private final Logger logger = LoggerFactory.getLogger(WebServerApi.class); - public final JettyTraceListener jettyTraceListener = new JettyTraceListener(logger); + private final JettyTraceListener jettyTraceListener = new JettyTraceListener(logger); private @NonNullByDefault({}) HttpClient httpClient; private @Nullable TranslationProvider translationProvider; From 79fb575c79954c7a5d2058d80d3ef483829288da Mon Sep 17 00:00:00 2001 From: David Goodyear Date: Fri, 23 May 2025 21:35:17 +0100 Subject: [PATCH 15/15] [linktap] missed renames [linktap] missed renames Signed-off-by: David Goodyear --- bundles/org.openhab.binding.linktap/README.md | 2 +- .../src/main/resources/OH-INF/i18n/linktap.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.linktap/README.md b/bundles/org.openhab.binding.linktap/README.md index 0e047b29d324f..5f9e188df1b84 100644 --- a/bundles/org.openhab.binding.linktap/README.md +++ b/bundles/org.openhab.binding.linktap/README.md @@ -154,7 +154,7 @@ There are 4 different areas of channels: - **Device Model**: Q1 ```java -Bridge linktap:gateway:home "LinkTap GW02" [ host="192.168.0.21", enableMDNS=true, enableJSONComms=false, enforceProtocolLimits=true, gatewayRequestTimeout=3 ] { +Bridge linktap:gateway:home "LinkTap GW02" [ host="192.168.0.21", enableMDNS=true, enableJSONComms=false, enforceProtocolLimits=true, gatewayResponseTimeout=3 ] { Thing device TapValve1 "Outdoor Tap 1" [ id="D71BC52E985B1200_1", name="ValveLinker_1", enableAlerts=true ] Thing device TapValve2 "Outdoor Tap 2" [ id="D71BC52E985B1200_2", name="ValveLinker_2", enableAlerts=true ] Thing device TapValve3 "Outdoor Tap 3" [ id="D71BC52E985B1200_3", name="ValveLinker_3", enableAlerts=true ] diff --git a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties index 52543e0e5a0f0..d099d20055ee2 100644 --- a/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties +++ b/bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties @@ -24,8 +24,8 @@ thing-type.config.linktap.gateway.enableMDNS.label = Enable mDNS Responder thing-type.config.linktap.gateway.enableMDNS.description = On connection whether the mDNS responder should be enabled on the gateway device thing-type.config.linktap.gateway.enforceProtocolLimits.label = Enforce protocol limits thing-type.config.linktap.gateway.enforceProtocolLimits.description = If parameters outside the limits acceptable to the device's are sent they will be blocked and logged -thing-type.config.linktap.gateway.gatewayRequestTimeout.label = Gateway Response Timeout -thing-type.config.linktap.gateway.gatewayRequestTimeout.description = For slow or heavily loaded systems this may need increasing, if communication errors are seen (seconds allowed for responses from the gateway) +thing-type.config.linktap.gateway.gatewayResponseTimeout.label = Gateway Response Timeout +thing-type.config.linktap.gateway.gatewayResponseTimeout.description = For slow or heavily loaded systems this may need increasing, if communication errors are seen (seconds allowed for responses from the gateway) thing-type.config.linktap.gateway.host.label = Hostname / IP thing-type.config.linktap.gateway.host.description = The hostname / IP address of the gateway device thing-type.config.linktap.gateway.password.label = Device Password