It doesnt register a tap until the tap itself checks in – if they are off, they wont appear.
I had one who had a flat battery the same time as i was trying to get MQTT working way back when. I banged my head against it for hours only to finally check the app and it was offline there too!
Im struggling to get the duration to set properly from HA.
I thought i had something that set the failsafe, but im not sure failsafe is what i want to use, as its designed for a global catch all and its possible i might want to manually run a watering job for longer than that.
So the duration is what im trying to use.
Has anyone got a template switch working, using the Linktap switch as a state, but using a script as the action for turn on ? In theory, it should work.
When setting the total duration, via a MQTT message, is the mobile app supposed to also reflect that time ? I can see that the MQTT payload has the total_duration value set correctly, but the app still says the default 1400 odd minutes.
As you see, I am using the web api instead of the mqtt command right now, but I want to change to mqtt at some point. This is working quite well for me.
The only issue that I keep having is that the first api command every morning seem to get lost somehow. Maybe switching to mqtt will solve that.
Let me also include my front end card, I have three linktaps and I use some custom card types
I did, but I don’t want to rely on HA to turn it off.
In a similar vein to the mobile app, I want to say hey turn on for x, not turn on, wait x, turn off.
The difference is subtle but important.
I’ve been liasing with their support team as allegedly it’s possible via MQTT, but I haven’t been able to get it to work yet.
I updated my reply with more details. The web api also allows the duration parameter, so you do not need to rely to HA, but you need internet access.
Otherwise, I also want to completely switch to mqtt, but I didn’t have the time yet.
I think you can just replace my linktap_bot_on script with the script from their documentations page 28 and it should work. Well, you also need to add the time as a parameter as I did for my script.
So it turns out that linktap has 2 totally different modes of operation when it comes to MQTT
“Home Assistant” mode is greatly simplified, and means the gateway stops listening to the more detailed MQTT requests.
“Regular MQTT” has is far more feature rich, allows definiing of schedules, instant water for a set duration, things like that.
It should be possible to use the regular mode, AND get that working via MQTT. I have a single mqtt switch working at the moment, and all the associated sensors for that tap.
Its not quite as nice as MQTT Discovery, but I dont use it anyway!
I have all my sensors configured, and have one of the taps working, but does anyone know if its possible to use a template in an mqtt payload definition ?
probably – i hadnt had a chance to go looking and given it wasnt mentioned in the mqtt documentation itself, i wasnt sure it was possible.
The Auto mqtt stuff is perfectly fine if you want to just turn taps on and off. I learnt the hard way that wasnt ideal when i had a power outage and water kept running for many hours as the gateway went offline so never received the request to turn it off.
The manual MQTT stuff is — complicated but seems to work as expected.
Ive decided to write a custom componet using the local HTTP API – its almost ready for testing. Whether I use it or the manual MQTT configuration remains to be seen
I have a working custom component that uses the local HTTP API – making setup a lot simpler.
The component sets up a number entity, and thats whats used when you turn the switch on to turn on the tap.
It also pulls in all the same sensors and binary_sensors that mqtt auto discovery publishes.
The only annoying thing is you have to define each tap, rather than just the gateway
ie set the IP address, the ID of the tap (found in the mobile app) and declare a friendly name. The API doesnt supply any of that information unfortunately.
If anyone wants to have a go, let me know and ill pass on the details.
But why are you not just sending the following like linktap suggests in the manual? { "tag":"total_duration", "id": "{{ taplinkerId }}", "duration": {{ duration }} }
Because it doesnt seem to work!
It sets the value — the value doesnt actually DO anything.
Its possible its device specific.
Their support team was really good, as i mentioned.
Their suggestion was to use the regular MQTT mode, which I did get working, but the setup was very complicated and lots of duplication.
So – Thats where the local HTTP integration came from.
I have just today switched over my MQTT implementation to the HTTP one.
That looks great. I will try to test it on the weekend.
I think the sensors volume units should be “L” and one could add the volume watering mode in the future.