NUKI Hub firmware for the ESP32

I can include it in the troubleshooting section.

Basic question (wondering why I could not find an answer reading the GitHub repo and this topic):
Can one Nuki Hub run several Nuki Smart Locks?

Or is one Nuki Hub (exclusively) bind to only one Smart Lock?

Only one lock and one opener.

OK. So that’s a difference to the Nuki Bridge (which maybe just uses more powerful hardware to interact with more smart locks) to keep in mind. Thank you for that information.

Update: official statement @

Can someone please precisely explain how to configure the MQTT stuff according to GitHub - technyon/nuki_hub: Use an ESP32 as a Hub between a NUKI Lock and your smarthome.?

I’m totally new to MQTT and struggle quite a bit setting this up (already spent 30 minutes just for this basic MQTT setup).

What I have:

  • HA with Mosquitto broker addon
  • A HA user mqtt_xxxxx which shall be used to access the core-mosquitto (there’s also the homeassistant created by the MQTT integration, I guess this is some kind of “master user” which should only be used by the addon/integration, right?)
  • Nuki Hub setup so webinterface is accessible

What exactly do I have to enter here:

Always/still getting

  • Host name: what is this used for - is it the name of the ESP?
  • MQTT Broker:
    I tried IP adress of HA server as well as core-mosquitto for “MQTT Broker”.
    I tried nothing as well as the existing MQTT user (HA user) for “MQTT User”.

Logs from NUKI Hub web installer ( show:

Experts might laugh about this, newbies are stuck. The docs at GitHub - technyon/nuki_hub: Use an ESP32 as a Hub between a NUKI Lock and your smarthome. are very “minimal”, probably expecting people did this many times already.

No one? There must be at least a dozen users here successfully using Nuki Hub.

Would you please share how you configured the MQTT section?

Your configuration looks good, i would guess you enter the wrong credentials.
You have to configure a mqtt user, this is done in the mqtt addon:

Fill in these in the mqtt section of the nuki hub and it should work.
If not, rc=-4 seems to be a connection timeout, maybe a firewall blocks port 1883? Can you connect from another PC to your MQTT Broker, for example with MQTT Explorer?

I don’t want to use that old-school path of setting users. Nowadays we can use HA users, which I did according to the docs:

I‘ll try to connect using a Windows machine first to sort out of it‘s either an authentication or networking (ports/firewalling/…) issue.

If you use the Mosquitto add-on on HAOS, you should set the MQTT server to the IP address of your HA instance. The user/password need to be valid MQTT credentials (HA users should be fine).

Hi - have noticed an interesting issue lately. I need to restart Nuki-hub whenever I update or restart HA otherwise no updates come through. I’m running Home Assistant 2023.1.7 with all the latest updates and Nuki-hub 7.1 (will update to 7.3 now).

Mosquitto thinks that a connection is up but I dont see any updates. I can see a message “Client nukihub already connected, closing old connection.” in the logs whenever I restart Nuki-hub.

After restarting Nuki-hub everything just works. Restart on disconnect is also checked, Restart timer is disabled (Im assuming this is for scheduled restarts) and Network Timeout until restart is disabled.

Has anyone else encountered this?

@acs Please try the new Release 8.0

I have the same problem as the acs…
It’s just that the hub stops working, I can’t use the lock.
After turning on and off the esp works normally.

I will test the new firmware.

seems to have resolved it… I’ll give it some more time to see if it’s fixed!

Yes, looking good so far. Will need to give it a day or two…

While we wait, what kind of battery drain would you expect on a Nuki 2.0 lock? I’m seeing roughly 6% per day (IKEA 2400Mah NiMH batteries) - auto opening the door 6-8 times a day. The needle used to move a lot slower before and a full charge would last me about 3 months with same or more usage - prior to switching over to Nuki-hub.

You can safely reduce the three “Query interval” settings to reduce the battery drain. Especially lock state should update automatically.

Hi all,

@technyon can you please tell me if i can use your solution with the Nuki 3.0 Pro without loosing the Wifi with my Nuki Official app (for my wife as well) and use Home Assitant too ?

If it’s possible, can i use ESP32 ESP-WROOM-32 WiFi Bluetooth and W5500 ?


The official app works just fine alongside nuki hub. The only thing that’s not recommended is to run the NUKI bridge in parallel with NUKI Hub, but since you’re using a Pro lock I don’t think that’s the case for you.

NUKI Hub communicates with the lock over bluetooth. If you connect your ESP to wired ethernet via a W5500 module, Wifi on the ESP is disabled as it’s not needed.

Thanks for your answer, and if i would like to use without w5500, it will be working ?

I confirm, i do not use a Nuki Bridge.


Of course then it connects via Wifi

1 Like

I have reset my esp32, removed it from HA and then include it again. HA discovery found nuki hub and all associated topics but one : nuki/lock/doorSensorState. However, if I listen this topic, I receive the state (doorClosed for example). Before the reset, this attribute was “discovered” as the others ones. What I am missing this time ?


Can this be paired to (GitHub - kvj/hass_nuki_ng: Better support for Nuki devices in the Home Assistant)? It ask for bridge api, idk if theres something the hub can provide me to make it work
Also ive seen some of the screenshot users have shared here, and it seems like all of them show 100% in battery level, my Nuki Smart Lock 2.0 is stuck at 100 since I replaced them more than 6 months ago, with the Energizer Ultimate (recommended by Nuki themself), I reached Nuki and they didn’t help other than advising me to reset the lock, which did nothing, is this a known issue for this smarlocks them?