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.