From b11c751d03f3fbbcfd2861be87d37313d9c9b4de Mon Sep 17 00:00:00 2001 From: dag81 Date: Mon, 30 Sep 2024 04:48:55 +0100 Subject: [PATCH] [linktap] Initial contribution (#17235) * [linkTap] Initial Code Commit [Signed-off-by: dag81 --- bom/openhab-addons/pom.xml | 5 + bundles/org.openhab.binding.linktap/NOTICE | 20 + bundles/org.openhab.binding.linktap/README.md | 234 +++++++ bundles/org.openhab.binding.linktap/pom.xml | 36 + .../src/main/feature/feature.xml | 10 + .../LinkTapBridgeConfiguration.java | 31 + .../LinkTapDeviceConfiguration.java | 40 ++ .../DeviceMetaDataUpdatedHandler.java | 32 + .../binding/linktap/internal/Firmware.java | 68 ++ .../binding/linktap/internal/IBridgeData.java | 31 + .../internal/LinkTapBindingConstants.java | 192 ++++++ .../LinkTapBridgeDiscoveryService.java | 265 ++++++++ .../internal/LinkTapBridgeHandler.java | 634 ++++++++++++++++++ .../LinkTapDeviceDiscoveryService.java | 102 +++ .../internal/LinkTapDeviceMetadata.java | 39 ++ .../linktap/internal/LinkTapHandler.java | 464 +++++++++++++ .../internal/LinkTapHandlerFactory.java | 95 +++ .../linktap/internal/LookupWrapper.java | 89 +++ .../internal/PollingDeviceHandler.java | 339 ++++++++++ .../internal/TransactionProcessor.java | 344 ++++++++++ .../binding/linktap/internal/Utils.java | 73 ++ .../protocol/frames/AlertStateReq.java | 43 ++ .../linktap/protocol/frames/DeviceCmdReq.java | 55 ++ .../protocol/frames/DismissAlertReq.java | 86 +++ .../frames/EndpointDeviceResponse.java | 50 ++ .../protocol/frames/GatewayConfigResp.java | 79 +++ .../frames/GatewayDeviceResponse.java | 181 +++++ .../protocol/frames/GatewayEndDevListReq.java | 63 ++ .../linktap/protocol/frames/HandshakeReq.java | 51 ++ .../protocol/frames/HandshakeResp.java | 89 +++ .../protocol/frames/IPayloadValidator.java | 40 ++ .../linktap/protocol/frames/LockReq.java | 68 ++ .../protocol/frames/PauseWateringPlanReq.java | 55 ++ .../linktap/protocol/frames/RainData.java | 65 ++ .../protocol/frames/RainDataForecast.java | 50 ++ .../protocol/frames/SetDeviceConfigReq.java | 75 +++ .../protocol/frames/SetupWaterPlan.java | 151 +++++ .../protocol/frames/StartWateringReq.java | 68 ++ .../protocol/frames/TLGatewayFrame.java | 254 +++++++ .../linktap/protocol/frames/TimeDataResp.java | 28 + .../protocol/frames/ValidationError.java | 51 ++ .../protocol/frames/WaterMeterStatus.java | 279 ++++++++ .../frames/WateringSkippedNotification.java | 67 ++ .../protocol/frames/WirelessTestResp.java | 72 ++ .../http/CommandNotSupportedException.java | 55 ++ .../protocol/http/DeviceIdException.java | 58 ++ .../protocol/http/GatewayIdException.java | 58 ++ .../linktap/protocol/http/I18Exception.java | 58 ++ .../http/InvalidParameterException.java | 55 ++ .../protocol/http/LinkTapException.java | 53 ++ .../http/NotTapLinkGatewayException.java | 107 +++ .../TransientCommunicationIssueException.java | 93 +++ .../linktap/protocol/http/WebServerApi.java | 572 ++++++++++++++++ .../protocol/servers/BindingServlet.java | 163 +++++ .../protocol/servers/IHttpClientProvider.java | 33 + .../src/main/resources/OH-INF/addon/addon.xml | 29 + .../resources/OH-INF/i18n/linktap.properties | 313 +++++++++ .../resources/OH-INF/thing/channel-types.xml | 223 ++++++ .../resources/OH-INF/thing/thing-types.xml | 119 ++++ .../linktap/protocol/frames/Command0Test.java | 71 ++ .../protocol/frames/Command10Test.java | 64 ++ .../protocol/frames/Command11Test.java | 63 ++ .../protocol/frames/Command12Test.java | 62 ++ .../protocol/frames/Command13Test.java | 59 ++ .../protocol/frames/Command14Test.java | 60 ++ .../protocol/frames/Command15Test.java | 64 ++ .../protocol/frames/Command16Test.java | 71 ++ .../protocol/frames/Command17Test.java | 63 ++ .../protocol/frames/Command18Test.java | 62 ++ .../linktap/protocol/frames/Command1Test.java | 63 ++ .../linktap/protocol/frames/Command2Test.java | 59 ++ .../linktap/protocol/frames/Command3Test.java | 136 ++++ .../linktap/protocol/frames/Command5Test.java | 60 ++ .../linktap/protocol/frames/Command6Test.java | 63 ++ .../linktap/protocol/frames/Command7Test.java | 61 ++ .../linktap/protocol/frames/Command8Test.java | 96 +++ .../linktap/protocol/frames/Command9Test.java | 46 ++ bundles/pom.xml | 1 + 78 files changed, 8376 insertions(+) create mode 100644 bundles/org.openhab.binding.linktap/NOTICE create mode 100644 bundles/org.openhab.binding.linktap/README.md create mode 100644 bundles/org.openhab.binding.linktap/pom.xml create mode 100644 bundles/org.openhab.binding.linktap/src/main/feature/feature.xml create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/configuration/LinkTapBridgeConfiguration.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/configuration/LinkTapDeviceConfiguration.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/DeviceMetaDataUpdatedHandler.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/Firmware.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/IBridgeData.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBindingConstants.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeDiscoveryService.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapBridgeHandler.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapDeviceDiscoveryService.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapDeviceMetadata.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapHandler.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LinkTapHandlerFactory.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/LookupWrapper.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/PollingDeviceHandler.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/TransactionProcessor.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/internal/Utils.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/AlertStateReq.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/DeviceCmdReq.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/DismissAlertReq.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/EndpointDeviceResponse.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/GatewayConfigResp.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/GatewayDeviceResponse.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/GatewayEndDevListReq.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/HandshakeReq.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/HandshakeResp.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/IPayloadValidator.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/LockReq.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/PauseWateringPlanReq.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/RainData.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/RainDataForecast.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/SetDeviceConfigReq.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/SetupWaterPlan.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/StartWateringReq.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/TLGatewayFrame.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/TimeDataResp.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/ValidationError.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/WaterMeterStatus.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/WateringSkippedNotification.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/frames/WirelessTestResp.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/CommandNotSupportedException.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/DeviceIdException.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/GatewayIdException.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/I18Exception.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/InvalidParameterException.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/LinkTapException.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/NotTapLinkGatewayException.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/TransientCommunicationIssueException.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/http/WebServerApi.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/servers/BindingServlet.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/java/org/openhab/binding/linktap/protocol/servers/IHttpClientProvider.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/addon/addon.xml create mode 100644 bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/i18n/linktap.properties create mode 100644 bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/channel-types.xml create mode 100644 bundles/org.openhab.binding.linktap/src/main/resources/OH-INF/thing/thing-types.xml create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command0Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command10Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command11Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command12Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command13Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command14Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command15Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command16Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command17Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command18Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command1Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command2Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command3Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command5Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command6Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command7Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command8Test.java create mode 100644 bundles/org.openhab.binding.linktap/src/main/tests/org/openhab/binding/linktap/protocol/frames/Command9Test.java diff --git a/bom/openhab-addons/pom.xml b/bom/openhab-addons/pom.xml index 3a3e20519ae..22b4e2b1f2f 100644 --- a/bom/openhab-addons/pom.xml +++ b/bom/openhab-addons/pom.xml @@ -956,6 +956,11 @@ org.openhab.binding.lifx ${project.version} + + org.openhab.addons.bundles + org.openhab.binding.linktap + ${project.version} + org.openhab.addons.bundles org.openhab.binding.linky diff --git a/bundles/org.openhab.binding.linktap/NOTICE b/bundles/org.openhab.binding.linktap/NOTICE new file mode 100644 index 00000000000..3e2c49e0050 --- /dev/null +++ b/bundles/org.openhab.binding.linktap/NOTICE @@ -0,0 +1,20 @@ +This content is produced and maintained by the openHAB project. + +* Project home: https://www.openhab.org + +== Declared Project Licenses + +This program and the accompanying materials are made available under the terms +of the Eclipse Public License 2.0 which is available at +https://www.eclipse.org/legal/epl-2.0/. + +== Source Code + +https://github.com/openhab/openhab-addons + +== Third-party Content + +jsoup +* License: MIT License +* Project: https://jsoup.org/ +* Source: https://github.com/jhy/jsoup \ No newline at end of file diff --git a/bundles/org.openhab.binding.linktap/README.md b/bundles/org.openhab.binding.linktap/README.md new file mode 100644 index 00000000000..2e0099e3a2f --- /dev/null +++ b/bundles/org.openhab.binding.linktap/README.md @@ -0,0 +1,234 @@ +# LinkTap Binding + +This binding is for [Link-Tap](https://www.link-tap.com/) devices. + +**This is for communication over a local area network, that prevents direct access to your gateway / openHAB instance from the internet. +E.g. behind a router** + +The method of interaction this binding supports is: + +**Program and execution of the watering plan within the application** + +The currently supported capabilities include where supported by the gateway / device: + +- Time synchronisation to openHAB +- Child lock controls +- Monitoring and dismissal for device alarms (Water Cut, etc.) +- Monitoring of sensor states (Battery, Zigbee Signal, Flow Meters Statistics, etc.) +- Enable watering based on time duration / volume limits +- Shutdown of active watering + +## Requirements + +A LinkTap gateway device such as the GW_02, in order for openHAB to connect to the system, as a gateway. +Older GW_01 gateway devices have not been tested but should work with a static IP setup. + +The recommended minimum version of the firmware is: + +- **GW_01** is to start with **at least S609** +- **GW_02** is to start with **at least G609** + +## Connection Options + +LinkTap supports MQTT and a direct interaction via HTTP. +This binding directly interacts with LinkTap's gateway devices using the Local HTTP API (HTTP). +The binding connects to the gateway's directly, and the Gateway is configured automatically to push updates to openHAB if it has a HTTP configured server. +(Note HTTPS is not supported). + +Should the Gateway device's not be able to connect to the binding it automatically falls-back to a polling implementation (15 second cycle). +The gateway supports 1 Local HTTP API, for an ideal behavior the Gateway should be able to connect to openHAB on a HTTP port by its IP, and only a single openHAB instance should be connected to a Gateway. +It is recommended that you use **static IP's** for this binding, **for both openHAB and the Gateway device(s)** regardless of the gateway's model. + +If dynamic IPs are used for the gateway, the mDNS address is recommended to be used. +This can be found when running a manual scan, for LinkTap Gateways. +This will remove any DNS caching related issues, depending on your setup. + +## Supported Things + +This binding supports the follow thing types: + +| Thing Type | Thing Type UID | Discovery | Description | +|------------|----------------|--------------------|------------------------------------------------------------------| +| Bridge | gateway | Manual / Automatic | A connection to a LinkTap Gateway device | +| Thing | device | Automatic | A end device such as one of the four controlled values on the Q1 | + +**NOTE** This binding was developed and tested using a GW-02 gateway with a Q1 device. + +## Discovery + +### Gateways + +If mDNS has been enabled on the Gateway device via it's webpage, then the gateway(s) will be discovered, and appear in the inbox when a manual scan is run when adding a LinkTap Gateway. +It is however recommended to use **static IP addresses** and add the gateways directly using the IP address. + +### Devices + +Once connected to a LinkTap gateway, the binding will listen for updates of new devices and add them, to the inbox. +If the gateway cannot publish to openHAB, then the gateway is checked every 2 minutes for new devices, and they are added to the inbox when discovered. + +## Binding Configuration + +### 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 | + +**NOTE** When enableMDNS is enabled, upon connection to the gateway option "Enable mDNS responder" is switched on. + +### Device Configuration + +| Name | Type | Description | Recommended Values | Required | Advanced | +|--------------|---------|-----------------------------------------------------------------------|--------------------|----------|----------| +| deviceId | String | The Device Id for the device under the gateway | | No (A,B) | No | +| deviceName | String | The name allocated to the device by the app. (Must be unique if used) | | No (B) | No | +| enableAlerts | boolean | On connection whether the device should be configured to send alerts | true | No | Yes | + +**NOTE:** + +(A) It is recommended to use the Device Id, for locating devices. +This can be found in the LinkTap mobile application under Settings->TapLinker / ValveLinker, e.g. + +- ValueLinker_1 (D71BC52F004B1200_1-xxxx) + - has Device Id "ValveLinker_1" + - has Device Name D71BC52F004B1200_1 + +(B) Either a **deviceId or deviceName is required** for the device to be located and used. + +## Channels + +| Name | Type | Description | Representation | Write Action | Note | +|-------------------|---------------------------|-------------------------------------------------------------------------------------|----------------|------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------| +| water-cut | Switch | Water cut-off alert | Alert | Dismiss alert | | +| shutdown-failure | Switch | The device has failed to close the valve | Alert | Dismiss alert | | +| high-flow | Switch | Unusually high flow rate detected alert | Alert | Dismiss alert | | +| low-flow | Switch | Unusually low flow rate detected alert | Alert | Dismiss alert | | +| fall-status | Switch | The device has fallen | Alert | Dismiss alert | | +| mode | Text | The current watering plan mode | R | | | +| flm-linked | Switch | The device has a included flow meter | R | | | +| rf-linked | Switch | Is the device RF linked | R | | | +| signal | Number:Dimensionless | Reception Signal Strength | R | | | +| battery | Number:Dimensionless | Battery Remaining Level | R | | | +| flow-rate | Number:VolumetricFlowRate | Current water flow rate | R | | | +| volume | Number:Volume | Accumulated volume of current watering cycle | R | | | +| eco-final | Switch | In ECO mode this is true when the final ON watering on segment is running | R | | | +| remaining | Number:Time | Remaining duration of the current watering cycle | R | | | +| duration | Number:Time | Total duration of current watering cycle | R | | | +| watering | Switch | Active watering status | RW | True - Start immediate watering, False - Stops the current watering process, the next planned watering will run as scheduled | | +| manual-watering | Switch | Manual watering mode status | R | | | +| child-lock | Text | The child lock mode | RW | Unlocked - Button enabled, Partially locked -> 3 second push required, Completely locked -> Button disabled | If the GW has internet connectivity settings will be reset when it sync's to TapLink's servers. | +| oh-dur-limit | Number:Time | Max duration allowed for the immediate watering | W | Max Time duration for "Start immediate watering" | | +| oh-vol-limit | Number:Volume | Max Volume limit for immediate watering | W | Max Volume for "Start immediate watering" | | +| plan-pause-enable | Switch | When ON will pause the current watering plan for an hour every 55 minutes | RW | Pause current watering plan every 55 mins for one hour | This disables the TapLink Watering Plan from being run, it is not reflected in the mobile app. | +| plan-resume-time | DateTime | Displays when the last pause issued will expiry, resuming the current watering plan | R | | | +| watering-plan-id | Text | Displays the current watering plan id | R | | | + +**NOTE:** +There are 4 different areas of channels: + +- R (Read Only Data) + - These represent data published by the device +- Alerts + - These are switches that are set to ON by the device when an alert condition is detected, such as a Water Cut. + - The alert can be dismissed by setting the switch to OFF +- RW (Read Write Data) + - Provides the ability to read data + - Provides the ability to set a relevant state to the data +- W Data + - Provides parameter values for the named action, it is stored within openHAB is not read from the device + - E.g. Start Immediate Watering + - Can be limited by a time duration - ohDurLimit + - If a flow meter is attached can be limited by a volume limit - ohVolLimit + +## Full Example + +### Thing Configuration + +- **Gateway Model**: GW_02 +- **Device Model**: Q1 + +```java +Bridge linktap:gateway:home "LinkTap GW02" [ host="192.168.0.21", enableMDNS=true, enableJSONComms=false, enforceProtocolLimits=true ] { + 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 ] + Thing device TapValve4 "Outdoor Tap 4" [ id="D71BC52E985B1200_4", name="ValveLinker_4", enableAlerts=true ] +} +``` + +### Item Configuration + +```java +Number:Dimensionless Tap1BatteryLevel "Tap 1 - Battery Level" ["Point"] { channel="linktap:device:home:tapValve1:battery",unit="%%" } +Number:Dimensionless Tap1SignalLevel "Tap 1 - Signal Level" ["Point"] { channel="linktap:device:home:tapValve1:signal",unit="%%" } +Switch Tap1RfLinked "Tap 1 - RF Linked" ["Point"] { channel="linktap:device:home:tapValve1:rf-linked"} +Switch Tap1FlmLinked "Tap 1 - FLM Linked" ["Point"] { channel="linktap:device:home:tapValve1:flm-linked"} +Switch Tap1WaterCutAlert "Tap 1 - Water Cut Alert" ["Point"] { channel="linktap:device:home:tapValve1:water-cut" } +Switch Tap1WaterFallAlert "Tap 1 - Fallen Alert" ["Point"] { channel="linktap:device:home:tapValve1:fall-status" } +Switch Tap1WaterValveAlert "Tap 1 - Shutdown Failure Alert" ["Point"] { channel="linktap:device:home:tapValve1:shutdown-failure" } +Switch Tap1WaterLowFlowAlert "Tap 1 - Low Flow Alert" ["Point"] { channel="linktap:device:home:tapValve1:low-flow" } +Switch Tap1WaterHighFlowAlert "Tap 1 - High Flow Alert" ["Point"] { channel="linktap:device:home:tapValve1:high-flow" } +String Tap1ChildLockMode "Tap 1 - Child Lock Mode" ["Point"] { channel="linktap:device:home:tapValve1:child-lock" } +Number:VolumetricFlowRate Tap1FlowRate "Tap 1 - Flow Rate" ["Point"] { channel="linktap:device:home:tapValve1:flow-rate",unit="l/min" } +Number:Volume Tap1WateringVolume "Tap 1 - Watering Volume" ["Point"] { channel="linktap:device:home:tapValve1:volume",unit="l" } +Switch Tap1FinalEcoSegment "Tap 1 - Final ECO Segment" ["Point"] { channel="linktap:device:home:tapValve1:eco-final" } +Switch Tap1Watering "Tap 1 - Watering" ["Point"] { channel="linktap:device:home:tapValve1:watering" } +Switch Tap1ManualWatering "Tap 1 - Manual Watering" ["Point"] { channel="linktap:device:home:tapValve1:manual-watering" } +String Tap1WateringMode "Tap 1 - Watering Mode"