NUKI Hub firmware for the ESP32

hey there. After a weekend of trying and trying this afternoon again I found my stupid mistake.

you need to put in the nuki hub the “home assistant” prefix. I thought that would be the default… Thanks for all the help .

Hello I have followed the istruction and managed to setup nuki hub and it’s working in HA but now I can not pair the Opener. How to say to opener to go in pairing mode ? if i press the button for 10 second i can not pair and on nuki app it’s say undem maintenance.
The i notice that after paired the nuki smartlock 3 pro the smartlock disconnect from wifi. can I connect it again to wi-fi ?
Thanks

Hi, great project but after setup it up I had try to register the hub as an app in order to have remote access also from the nuki app.
Now I do not kow if something to do with the register as app but now after paired the lock 3 pro I have thsi message:
Querying lock keypad: failed
Also with register as app I can not pair the opener anymore.
It’s by design ?
Help will be appreciate
Thanks

Have you got a Keypad? The “register as app” setting is not recommended, the state of the lock won’t be updated as intended. This is a limitation of the Nuki BLE API that was not documented yet when that setting was first implemented.

Ok, but if I do not register as app I will not have the nuki app remote access working and it could be fine but the auto-unlock function will still works for smartlock and auto-unlock ring to open with opener ?

Hello Kai, I assume from the pictures you posted that you speak German. me too. I would like to ask you if you have got this working now? I’ve been stuck on this for days and am not getting any entities in Home Assistant and also the state “undefined”. Or do you know a Worksround who explains everything step by step? Before I set up the wt32-eth01, I had already connected the Nuki Smart Lock via the Interbe option via mqtt. but of course with fewer entities than this hub.

Do not enable “Register as app” unless you’re using a NUKI Bridge along with NUKI Hub. It has nothing to do with being able to use the NUKI App on your phone, it will work regardless of this setting. You should unpair all devices, disable this option and pair your devices again, as this option only takes effect during pairing. If you keep this enabled without running a NUKI Hub and NUKI Bridge at the same time, your battery will drain very fast.

I really thing I will rename this setting for the next release, it tends to confuse people.

Regarding the other problems, pairing can sometimes be stubborn not to work. You can try to factory reset and re-flash your ESP, then try again, this has helped me before. I can not say exactly why unfortunately.

So, I am wondering… Assuminig I have another Smartlock connected in HA via Homekit integration. Could I use the Nuki Opener and Keypad via Nuki Hub and set up an automation that the smartlock get’s locally unlocked when a correct PIN is entered in the Nuki Keypad?

I understand that the fingerprint is not working (yet - or is this a hardware limitation?). But what I could not find in the GitHub information: What about time frames/limits/expiration for the keypad codes?

The fingerprint part of the API is not (yet?) documented. The API does support expiration and so on, but it’s not implemented in NUKI Hub … for two reasons. First, it’s not that easy to map this into MQTT, and second you can control this actually from your smart home solution. Just delete the code whenever you want it to be expired, no need to set expiry via NUKI Hub.

thanks for your reply!
You can delete codes from the normal smartlock apps as well and still the companies implement an expiration feature. I also think it’s a better idea to setup e. g. a code for neighbors when being on holiday and directly set an expiration on it so you don’t forget do delete it afterwards. Or just think about rental apartments/airbnb. Furthermore, the possibility to just use a code once is helpful as well.

I take it, if an expiration is not possible I cannot set a specific time frame as well? For example only Mondays between 8-10am for housekeeping?

I’m not saying it’s not possible. It’s there in the bluetooth API, just not implemented in NUK Hub.

The difference between setting it via the smartphone app vs. HA is that you can automate it with HA (or at least I assume so, I use iobroker), while you have to manually delete codes using the smartphone app. So you can tell HA to add the code every Monday to Friday at 8 am and delete it at 10 am, no manual interaction necessary.

Hm, I have not thought about it that way. Thanks :slight_smile:

Thanks a lot for this project, it is really amazing.

First time playing with a esp32 and in 10 minutes my nuki hub was working.

Sometimes when I open or close the door with HA takes a few second to show the updated state in HA, is it normal this delay?

It is a Nuki v4 (no pro) and I used a ESP32 ESP-WROOM-32, wifi signal is very good (-40dbm) and BT around -65dbm (1 m).

Thanks!!

Yes, the delay is normal.

1 Like

Since some people liked the solution on github for the presence sensor, i post this again on the “right” forum. To use nuki hub for presence, just add this as an mqtt sensor:

mqtt:
  sensor:
    - name: "nuki_presence_sensor"
      state_topic: "nuki/presence/devices"
      value_template: "{{ 'home' if 'YOUR-iBEACON-ID' in value else 'not_home' }}"
      unique_id: "nuki/presence/devices_uid"

Then you have a sensor if your iBeacon ID is recognized by NukiHUB, home if recognized and not_home if you are away.

For having a sensor for the rssi, just use:

mqtt:
  sensor:
    - name: "nuki_esp32_lock_rssi"
      state_topic: "nuki/lock/rssi"
      value_template: "{{ value }}"
      unique_id: nuki_esp32_nuki_lock_rssi_unique_id

Maybe it helps the one or other

Sorry I wasn’t clear on GitHub, I meant the rssi for the beacon not the lock :slight_smile:

I’ve been using the above to open the lock since yesterday and it opens well before I reach the door, definitely better than nuki’s auto unlock.

With a bit of automation I switch on the ble transmitter on the ha app as I enter the home zone and off after an unlock. Great stuff!

Ahh, ok. This is not just so easy, beside i am not a templating expert.
Maybe some of the really advanced users here have an idea for us.
Nuki gives us a text string like this:

08:b6:xx:xx:xx:e6;presence_az_e-7007e4;-81
4b:75:18:xx:xx:xx;Galaxy Watch4 (FKXF);-82
54:d2:xx:xx:xx:ad;Nuki_1C4705AD;-56

I would think the most easy way would be, ha converts this to json and then we would search the right name and pick the value from this data set, but i don’t know how this is done exactly in a template.
Maybe @123 oder @Didgeridrew have an idea when reading this?

FAQ Guideline 16 - Should I tag people?

Oh my bad, i was not aware of that rule. Sorry that i tagged you, but i have read so many threads where both you made advanced templates, so i thought you could help us here.
Again sorry that i made some circumstances for you and didgeridrew.

Hello guys, thanks for this amazing project! I’m currently facing the following behavior:
if I use the function lock’n’go, the state of the lock in Homeassistant stays “open”, while the Nuki is locked, so the state is not synchronized. What I’m doing wrong? Thanks!