Smart Garden Tap Water - On and Off

I contacted Linktap support through facebook message, had my firmware updated and very thorough instructions send within 15 min. Great service. Remember they are in AUS so check time zone

6 Likes

Thanks, I did the same just a few mins ago and had the same experience, answer, and new beta firmware in 15 mins along with a step-by-step guide to set it all up. Fully working with local control in 20 mins from the start of the Facebook message to full integration. Very pleased that I picked LinkTap as my solution.

4 Likes

I had exactly the same experience with them. Their customer service vis Facebook was so quick - I was able to join the beta in minutes. They’re terrific.

3 Likes

Hello everyone,
I installed the MQTT interface with the linkTap yesterday and I am now thinking how to use it in the future.
The watering with MQTT is without duration, so it relies on the home assistant automation to switch it off, which seems a bit risky.
It seems better to use the “/api/activateInstantMode” as it includes an duration or the “api/activateSevenDayMode”, which you have to program on the linkTap webpage/app.
I am wondering if someone has some suggestions how to automate this.
Thank you in advance!

1 Like

I don’t know the answer but am interested in it also, I do agree that having the link tap hardware manage the duration is a more fail safe way to operate - and avoids the failure modes you describe.

1 Like

I also just set up my new G1-S and LinkTap quickly flashed my gateway with the latest firmware, which makes it compatible with Home Assistant. I also agree would be nice to have it integrate more with the api so can specify watering duration.

1 Like

Thanks to the folks in this thread for making me aware of the beta MQTT integration! I’ve had my valves sitting unused all summer, but better late than never.

I had two not-hugely-important questions for you all:

  1. Did you all have entity IDs/names of the super long ID, and did you just manually update those to their actual names? Kind of annoying but oh well.
  2. Any thoughts as to why each valve would get 3 alarm panels and not just a sensor each for fall/broken/cutoff? I’ve got 9 alarm control panels in my UI now that aren’t really alarm control panels :slight_smile:
  1. had to rename them…it just puts the Taplink ID in the name
    2.need to check but my HA is down …might come back later with an answer

Hello again,
I added a log of the LinkTap notifications. Here some details for anyone who is interested:


The Lovelace card:

type: logbook
entities:
  - var.linktap_notification
hours_to_show: 144
title: History

I use the HACS variable integration, but I guess any text input should work.
The configuration.yaml entry:

var:
  linktap_notification:
    friendly_name: 'LinkTap Notification'
    initial_value: ""
    icon: mdi:switch

rest_command:
  linktap_setwebhookurl:
    url: "https://www.link-tap.com/api/setWebHookUrl"
    method: POST
    content_type: 'application/json; charset=utf-8'
    headers:
      User-Agent: Home Assistant
      Content-Type: application/json
    verify_ssl: true
    payload: '{"username": "{{ username }}", "apiKey": "{{ apikey }}", "webHookUrl": "{{ webhookurl }}"}'

The script that calls the rest commands:

alias: LinkTap Set Web Hook Url
sequence:
  - service: rest_command.linktap_setwebhookurl
    data:
      username: YOUR_NAME
      apikey: YOUR_KEY
      webhookurl: >-
        https://homeassistant.url:443/api/webhook/linktap_WebHookUrl_used_in_automation
mode: single

And lastly the automation that defines the webhook url:

alias: Recieve LinkTap Notifications
description: Recieve LinkTap Notifications per webhook
trigger:
  - platform: webhook
    webhook_id: linktap_WebHookUrl_used_in_automation
    id: linktap_notification
condition: []
action:
  - service: var.set
    data:
      entity_id:
        - var.linktap_notification
      value: '{{ trigger.json }}'
mode: queued
max: 10

Hopefully I soon manage to add the activateInstantMode API command and log the water level of each irrigation. I have two of those Gardena water distributors so each LinkTap irrigates multiple areas, which makes logging a bit tricky. Ideas are welcome.
I also found a Homey app GitHub - AdyRock/com.linktap that already integrated many aspects of the LinkTap API, but its a bit beyond my abilities.

1 Like

Does anyone know how to keep track of the volume of water used when using MQQT with LinktTrap and Home Assistant?

There is a volume entity, and a speed entity created - these should be what you’re looking for?

I found the best way to use the notification that the linktap sends at the end of each irrigation. See above how home assistant can receive the notification.
The code below is listening to the received notifications and when the message and linktap id’s are the correct one it saves the irrigation volume.
My linktap irrigates multiple zones so I add the volume to the corresponding zone. If you have only one zone per linktap it will be easier.

var:
  linktap1_vol:
    friendly_name: "LinkTap1 Volume"
    value_template: >-
      {% set dict = states('var.linktap_notification_raw') | from_json %}
      {% set values = dict.values() | list %}
      {%- if values[0].lower()=='wateringOff'.lower() -%}
        {%- if dict['gatewayId'].lower()=="enter_id".lower() and dict['deviceId'].lower()=='enter_id'.lower() -%}
          {{ dict.vol|float(0) / 1000 }}
        {% else %}
          {{ states('var.linktap1_vol') | float(0) }}
        {% endif %}
      {% else %}
        {{ states('var.linktap1_vol') | float(0) }}
      {% endif %}
    tracked_entity_id: var.linktap_notification_raw
    icon: mdi:water-plus
    unit_of_measurement: 'l'

  zone1_vol:
    friendly_name: "LinkTap1 Ch1 Volume"
    value_template: >-
      {% if (states('var.linktap1_channel') | int) == 1 %}
        {{ states('var.zone1_vol') | float(0) + states('var.linktap1_vol') | float(0) }}
      {% else %}
        {{ states('var.zone1_vol') | float(0) }}
      {% endif %}
    tracked_entity_id: var.linktap1_vol
    icon: mdi:water-plus
    unit_of_measurement: 'l'
1 Like

Wow. Great work. When spring comes and I’ll be using this. A question:

Is the current integration via MQTT sufficient or would we be better off creating a custom integration?

Someone has gone forward with the HTTP rest api? i’m trying to perform the equivalent of activateInstantMode with a chosen duration (just to prevent the eventual case HA dies during the irrigation and water keeps going indefinitely), locally.
I often find some refers to a “LinkTap Gateway MQTT Client Interaction Messages_x.x.pdf” in the MQTT document, but I’m unable to find it online.

You have to create under helpers two numbers namely input_number.backyard_linktap_duration & input_number.frontyard_linktap_duration.

Then use the following subtituting the “x” with your information

rest_command:
  backyard_linktap_manual_override:
    verify_ssl: true
    timeout: 10
    url: https://www.link-tap.com/api/activateInstantMode
    method: POST
    payload: '{"username": "x", "apiKey": "x", "gatewayId": "x", "taplinkerId": "x", "action": "true", "duration": {{ states("input_number.backyard_linktap_duration")}}, "autoBack": "true"}'
    content_type: 'application/json; charset=utf-8'
    headers:
      User-Agent: Home Assistant
      Content-Type: application/json
  frontyard_linktap_manual_override:
    verify_ssl: true
    timeout: 10
    url: https://www.link-tap.com/api/activateInstantMode
    method: POST
    payload: '{"username": "x", "apiKey": "x", "gatewayId": "x", "taplinkerId": "x", "action": "true", "duration": {{ states("input_number.frontyard_linktap_duration")}}, "autoBack": "true"}'
    content_type: 'application/json; charset=utf-8'
    headers:
      User-Agent: Home Assistant
      Content-Type: application/json

Anyone having issues with LinkTap entities becoming unavailable in MQTT after a HA restart? Only way I have of getting them back is to restart Mosquitto broker, and then they are accessible with no issues

Nevermind…just read all the doc. and included the uplink/ downlink cmds - all working directly after a reboot :slight_smile:

Actually it’s still requiring a manual restart after rebooting HA - any and all suggestions appreciated!

Hey, someone posted a solution to this somewhere here, but I will try to summarize it:
You need this rest command with the linktap hub IP:

rest_command:
  reboot_linktap:
    url: 'http://192.168.1.209/index.shtml?flag=0'
    method: GET

and an automation:

alias: HA Startup
description: Reset LinkTap server on startup.
trigger:
  - event: start
    platform: homeassistant
condition: []
action:
  - service: rest_command.reboot_linktap
    data: {}
mode: single

I think the linkTap people said they would fix it, but it seems they didn’t do it yet.

I think MQTT + HTTP rest api works great. I think a integration would make it easier to setup. Would love to see how it’s done.

Just MQTT got a bit complicated for me. Overall you can do everything with MQTT except setting a irrigation duration. Instead you would use the link-tap as a normal valve with a start / stop signal.

Edit: It is now possible to set a watering duration, watering volume and fail save watering duration through MQTT.