Can't connect MQTT with Home Assistant on Nuki Smart Lock Pro Gen 4.0

Hello developer team,
your Nuki Smart Locks are just awesome!

But I have a problem with the MQTT function of my new Nuki Smart Lock Pro Gen 4.0

I’m trying to integrate the device to my Home Assistant. I am successfully using the Mosquitto Broker with other devices.
When I try to connect via the Nuki app, I get the error message
MQTT activation failed - error code 8A
Authorization is always rejected. This is very strange, as I use the same access data for the other MQTT devices. I have also checked ports (1883), reinstalled Broker & Nuki app, completely reset Nuki to factory settings and set it up again. Currently nothing seems to help. Firmware version 4.0.36 and app version 2023.12.1 (831)

Am I doing something wrong? Or could the device itself be faulty and need to be replaced?

I have already chatted with the Nuki support team. They sent me here.
Can you help me?

Thanks and regards,
Jens

Does the Smart Lock appear in the logs of the MQTT broker?

Maybe your password is too long or has specific characters that do not work.
I’d suggest to try it with a different username / pw combination.

Hi Jürgen,

you made my day! That’s it!
I would have never expected that. :slight_smile:

I tried different combinations now and 8 characters of letters work. As soon as I use numbers or specials it does’nt work again. So I’m really thankful for your suggestion.

May I ask if it will be possible to use more complex passwords in the future?
For now, I’m happy that I got it up running. :partying_face: But a little bit more security would be nice.

Hi Jürgen, could you elaborate on what are the password requirements ?

As you are the owner of the MQTT server, you are also setting the password. Only restriction on Nuki side is the length of the password which can not be more than 32 characters.

The root cause for the problems described in this thread did not come from restrictions on Nuki side but a configuration problem in the infrastructure of the original poster.

1 Like

Hey everyone,

in the meantime I tried again and now it works. I reinstalled the Mosquitto Broker on my HA once more. And that seemed to solve it.

I can’t tell you why the first reinstall didn’t fix it, but now it is good. All my MQTT devices
including Nuki are working fine and with complex password.

So I’m 100% sure that the problem wasn’t on Nuki’s side.

Thank you all for your help and your quick replies.

Based on my experience, the Nuki 4 Pro can’t connect to MQTT if the MQTT password is 32 characters long, but it works with a 31 chars long password, which only contains digits and letters, both upper and lowercase. I couldn’t get it working with a 31 chars long password when it contained special characters.

1 Like

Same issue here. Tnx for this topic. I tried:
pwgen -B 32
Is uses a-z,A-Z,0-9 and removes a few like I and l.
32 characters gives “error code 89” in the app.
Setting an intentionally incorrect password also gives error code 89.

After removing 1 character in mosquito and in the nuki app, everything works like a charm.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.