[BETA] Linktap Driver

Driver for Linktap Taplinker automatic watering system

Pre-requisites:

  1. You need your username and an apiKey from linktap. The apiKey can be obtained at Wireless Watering System - LinkTap by using your linktap credentials.
  2. Linktap for the moment is a cloud-based automation. This means that Hubitat will be calling Linktap API for starting/stoping watering.
  3. In order to receive actual status information from the cloud servers, you need to expose Hubitat data api outside your local network. For this, you should have have a static IP or DynDNS and setup port forwarding in your router. Port 39501 is used by Hubitat to listen to incoming messages. You can (and should) filter by MAC or IP your port forwarding rules in the router.
  4. It is possible to use the driver without receiving the updates from the cloud server. In this case, all it can do is start and stop watering.

Installation:

  1. Create both drivers (Linktap Controller and Linktap Taplinker) by copying and pasting driver code into Hubitat
  2. Add virtual device and set type Linktap Controller
  3. Enter your username and apiKey in preferences
  4. If you intend to use the web hook for receiving data from linktap cloud servers, you need to enter your public static IP or domain on "IP/DNS for Web Hook" and the IP of Linktap server in "MAC / IP Address". For me this has been "34.192.218.92", but it may vary and change over time. In Hubitat logs you may see received messages which have not been routed to a device for parsing, and this will indicate the IP that you should enter in this property.
  5. If you are using the web hook, each tap linker will be identified and created as a child device automatically when the first message arrives. I suggest turning the tap linker off and back on after 1 minute
  6. If you are not using the web hook, you can create each tap linker by pressing the add taplinker command in the Controller device, providing the gateway Id, tap linker Id (you find these in the back of each device) and a label

Using:

  1. You can start watering with Open command, it will take the parameter at device level for duration
  2. You can start watering with a specific duration with the Timed Start command
  3. You can stop watering with the Close command
  4. If you are using the web hook, you will get:
    a) Events for start and end of watering sessions, either manually triggered in the device, the app, or through a schedule
    b) Different types of alerts for exception situations
    c) Battery and signal values
    d) Flow rate (for Taplinker GS2)
    e) Total volume of water at the end of a watering session (for Taplinker GS2)

NOTES
1: This is a beta version that I am releasing in the hope that device owners are willing to test and provide feedback. I will try to address any issues that are reported. I suggest supervised usage of the software until you verify all aspects are working as per your expectations, to prevent any damage (over/underwatering, plant damage, etc.)
2: Linktap APIs provide the ability to activate other watering modes besides manual, but it seemed to me that this is better achieved through the Linktap app than through home automation platform. I may be wrong, and if there are use cases let me know to try to implement.

3 Likes

Great addition, but haven't got it working yet. I quickly discovered you can't manually add a LinkTap if you set the API. Having done so, I get the following error (in logfile)

dev:3902021-12-30 20:18:42.668 errorgroovy.lang.MissingMethodException: No signature of method: user_driver_HE_pfta_Linktap_Controller_669.apiSetWebHook() is applicable for argument types: () values: on line 380 (method updated)

I'm no coder, but hope this helps debugging. I'not sure how I should discover the Linktap Server IP address, so I left it default.

Hi I had left a small piece of old code. Please get the controller driver again I have uploaded a new version to github.

If you enter the webhook, you don’t need to create a tap linker manually, it will be created when the first message is received.

After you set the webhook and it is processed without the error, check the log and if you see a message such as the below it means the ip is different, and you should update in the driver preferences.

sys:12021-12-31 09:54:48.129 Received data from 34.192.218.92, no matching device found for 34.192.218.92, 22C0DA5C:FBEF, null or 22C0DA5C.

Thanks

:+1:t3:

Let me know how you get on, any feedback is welcome.

It has created the first LinkTap. Still waiting for the second one to show up. Will keep you posted.

Any action should trigger its creation, you can turn it off and back on, or manually water. I only have one so never tested this scenario in reality (only simulated), but there should be no reason for it not to work. You can also set log level to 4 to get detailed logs. Thks

Second one still doesn't show. No clues in the logfile.

Hi,
when you start watering on the second device, does something appear in the logs? You should see something like the below, where XXXXXXXXXXX is the gateway id and YYYYYYYYYYY is the taplinker id. Make sure you set Log Level to 4 in the Controller device and press Save Preferences before trying this.

If nothing appears, this means the linktap server is not sending anything. If the below appears, but no device is created, then kindly share the trace logs.

Thanks

dev:6612022-01-01 18:09:24.035 traceBody: {"msg":"wateringOn","gatewayId":"XXXXXXXXXXXXXX","deviceId":"YYYYYYYYYYYYY","totalMin":0,"totalSec":5,"onMin":0,"onSec":5,"vel":0,"vol":0,"battery":"97%","signal":71}

Hi Pedro, it's winter over here, cannot start watering. This will have to wait a while.

Ok thanks for your assistance in any case. Btw, turning the device off and on after some seconds (using the toggle switch on the device itself) should also trigger a message. Cheers, and Happy New Year.

Great, that did the trick. Both devices now included. Thanks and happy new year to you as well.

:+1:

I have also created a different driver for Linktap making use of the beta firmware that allows local integration using MQTT broker. Check it out here:

1 Like