NUKI Hub firmware for the ESP32

Thank you very much for Nuki Hub, it is a nice alternative to the official bridge !

I understand that it is preferable not to have the official bridge and nuki hub plugged in simultaneously. But if only the nuki hub is plugged in, what is the difference between configuring it as a bridge or configuring it as an app?

No difference

Ok. So the only use case the ā€˜register as appā€™ parameter could be useful would be when both official bridge and nuki hub are plug in simultaneously. But in this last case, I suppose it is mandatory to configure nuki hub as app. So, the best choice is ever ā€˜as appā€™. So, why not to remove this parameter from the config and set silently ā€˜as appā€™ ?

Because it can lead to problems running both devices at the same time. Iā€™d like users to opt-in into a mode of operation thatā€™s not recommended.

That makes sense indeed.
According to these explanations I will pair as ā€˜appā€™ and to unplug the official bridge. This way, I can easily switch bridges if needed (unplugging the active bridge and plugging the other one).
Thank for the answers.

Yes you can do it like that. Iā€™ve also updated the readme to recommend against running both devices in parallel.

May be you could add also the following reminder related to pairing : ā€œdonā€™t forget to allow pairing into the Nuki app (setting/buttom & led)ā€. For security reason, I had disabled it after pairing my smartphone (a long time ago) and I had completely forgotten about this setting so I was not able to pair my esp until to see a post of another user on the git issues forum :see_no_evil:

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
grafik

  • 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 (technyon.github.io) show:
grafik

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.

editā€¦
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.