[RELEASE] Linktap Driver for Hubitat – Local Integration through MQTT

OK so new firmware is installed, and I've configured the Gateway and rebooted it. But I don't see any child devices created. I've tried a few times, clearing any pending devices each time, but so far nothing...

Try rebooting the gateway through the interface. Before, set the logging level in the driver to 4 and check if a message with cmd=0 is received. If still nothing is created, send me the log. If no msg is received check your configuration in the gateway that all is ok, including credentials, ip, mqtt broker type, etc

I just tried deleting my child device, rebooting the gw, and it was promptly recreated within one minute. My guess is that your gw is not connecting to the broker.

Checking the Mosquitto logs it seems my Gateway attempts to connect, but then I see a message saying the client is "disconnected due to malformed packet"

I'm using the same username/password for the Gateway as I am for the Hubitat Controller device. The Hubitat connects successfully according to the response messages

I am afraid I cannot debug the gateway side. Check my configuration screenshot and ensure it is exactly the same, except of course for ip, username and password.

You can also run the following from a shell in the raspberry and see if the driver picks it up in the logs:
mosquitto_pub -h localhost -u YOURUSER -P YOURPASS -m "TEST MESSAGE" -t /linktap/up_cmd

No problem, Pedro. I will reach out to the Linktap guys

Just for my own interest though, what firmware level is your Gateway running? I am on G0506132201102323I_C0301012008111816

It is G0506142201200901I_C0301012008111816

Ah, so a different level it seems. Thanks

Yes but I had several versions over the past couple of weeks as I found a few bugs and Linktap issued fixes. Last update I got was on Thursday. I never faced the particular issue you are facing.

Check the client id (i am using gw id) just in case it’s too long or has invalid characters. Also i have the gw configured for point as decimal separator and liter as unit. Mot sure any of these can make any difference though.

Did you try to publish to mqtt broker as I suggested in my previous post? At least to rule out broker configuration issue.

Yes, and I see the "TEST MESSAGE" appearing in the logs in Hubitat:

There are some parsing errors but perhaps that is because it's an unexpected message?


The message at least seems to get from the Broker to the Client on Hubitat

I've post to Linktap on FB, but in the meantime I'll play around with the client ID. I have the same decimal separator and unit set as you do

Did the FW updates get pushed automatically to the Gateway?

Yes the message cannot be parsed as it is not json, but this shows the broker is working fine and hubitat is connected. So indeed it seems it is a gw problem.

They push the firmware themselves to specific gateways, we cannot force updates from our side as far as i know.

OK thanks for all your help, Pedro. I'll follow up with Linktap

OK this is driving me crazy now! Overnight the Linktap guys updated my Gateway, and I'm now on the same FW level as you. I have to say that the Linktap people are very responsive and supportive :+1:

However, I'm still getting the same messages about malformed packets from the Broker when the Gateway tries to connect. I've rebooted Broker and Gateway, I've deleted and re-added the Taplinker via the App, and I've also removed and re-added the virtual Linktap Controller in Hubitat (this connects perfectly, using the same IP, username/password)

Can I ask you to check my Gateway config? I must have missed something but I can't see what

Unless my eyes are deceiving me, it looks the same as you specified.

Just for completeness, here's the rest of the Gateway config page


I will have a look a bit later but it seems ok. I will also send you my mosquitto conf file just in case. Will get back to you asap.

1 Like

No rush! Enjoy your weekend

I just remember I have VPN server :wink:

In the Uplink section, it seems to be missing the topic for Uplink commands. This could explain the issue.

The other 2 differences are that I am using fixed IP (I set fixed ip for the GW's mac address in the router), and I have shorter keep alive interval (120 mins). None of these should make a difference.

Finally, my /etc/mosquitto/mosquitto.conf

pid_file /run/mosquitto/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d

and my /etc/mosquitto/conf.d/mosquitto.conf

listener 1883
allow_anonymous true
password_file /etc/mosquitto/passwd

Also, I have found a couple bugs and will upload a new version with fixes later today. So if you get it working, update the drivers later as well.

I also use a fixed IP for the Gateway. I don't use a VPN but I can't see why that would change anything? The only other difference is that the listener, allow_anonymous and password_file commands are in my mosquitto.conf rather than a conf.d, but as that's just an include that should be OK

But regardless, it all seems to be working OK as far as the MQTT setup is concerned. But I'm confused as to why the HE connects, but the GW gets rejected, even when they are using exactly the same credentials. As we've established already, the HE connects and can communicate with the Broker, but the GW never even gets that far.

Something in the GW seems to be corrupting the MQTT command that is received by the Broker

Vpn has nothing to do but i was able to check config remotely.

Did you update the Uplink section in your gw config with the missing topic as i wrote in my post? Remember to submit and then reboot gateway


1 Like

No, I did not. To be honest I didn't even realise that was an updateable field until you just pointed it out! That was the problem! Now the Gateway connects and I see the virtual Taplinker device created in HE almost immediately!

Thanks for all your help Pedro!!! Now to start creating some rules!

Great! Please update the code a bit later today, there is a bug in the volume calculations.

Download the Hubitat app