NUKI Hub firmware for the ESP32

{% set entry_list = 
'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' %}

{% set pos = entry_list.find('Galaxy Watch4') %}
{% set pos2 = entry_list[pos:].find('\n') %}

{{ entry_list[pos:pos+pos2].split(';')[1] }}

I’m not sure this is the most efficient way of extracting it but hopefully this helps as a starter

1 Like

I don’t know also, but it is a way to extract and it works, many thanks. It’s far beyond my knowledge, but in a quiet minute i will try to understand the logic.
Since it wasn’t for me, @xaris33 here is the mqtt sensor for the rssi of your beacon:

mqtt:
  sensor:
    - name: "nuki_esp32_presence_rssi"
      state_topic: "nuki/presence/devices"
      value_template: >
        {% set nuki_list = value %}
        {% set pos = nuki_list.find('YOUR-iBEACON-ID') %}
        {% set pos2 = nuki_list[pos:].find('\n') %}
        {{ nuki_list[pos:pos+pos2].split(';')[1] }}
      unique_id: nuki_esp32_nuki_presence_rssi_unique_id

All credits goes to Josh for this wonderful solution!!!

2 Likes

Hi,
I am trying to get a nukihub running here but the image flash constantly fails at exact 63%: with error “serial port is not ready. close any other application using it and try again”

  • already tried various cables
  • already tried other ESP32 (same type, which already worked as bluetooth proxy in home assistant
  • shall i try different type of ESP32 ? (C maybe??)

any other hint to get this done ?
thanx in advance

ok … interesting

  • just tried it with webflash on a raspi5
  • and it suceeded !
  • never trust a windows machine
    but still I am curios what the problem is - as I saw that also on the raspi at exact 63% it kind of was stuck shortly and then immediatly switched to 100% and installation complete
    very strange … looks like some final steps in the flash process which fail on the windows machine => will try another windows machine to check whether its an instance problem of that one windows setup
    will keep you posted
    cheerz

Hello,

The NUKIHUB works great, thank you very much.

Does anyone have any tips for me on how to write an automation that flashes an LED every time the NUKI latch is unlocked. Even if the door is opened with Autounlock via the Nuki APP.

Thank you
Torsten

I installed Nuki Hub fresh and it works very well :slight_smile: thx a lot.

I have used the MQTT auto discovery.
image

I have activated the unlatch in Home Assistant and I can unlatch and receive the log in home assistant.
image
However, If I open the door with keypad no message appears.
I only see messages if door is locked or unlocked, no unlatch.
image

Is there a chance to get this message?

From GitHub:

MQTT Interface

Lock

  • lock/state: Reports the current lock state as a string. Possible values are: uncalibrated, locked, unlocked, unlatched, unlockedLnga, unlatching, bootRun, motorBlocked

hi,
next question from my side is how to pair Nuki opener with nukihub:

  • I checked the “opener enabled” checkbox in nukihub admin gui
  • I started the opener setup in Nuki app and came to the subprocess where it says to press opener button for 10 seconds to put opener in pairing mode with bridge (which I assume is surrogates by the nukihub esp32)
  • I tried to reboot the nukihub, as this also worked to pair it with Nuki lock
  • BUT nothing happens
  • and nukihub web gui still shows “opener paired” as disabled

am I missing something ? or is in this case the nukihub not meant to act as a bridge …

thanx

You might need to try several times (and/or move the ESP closer), the opener’s BLE signal is weaker than the lock’s in my experience.

-You should hold the button for 5 seconds, not 10 (the light should be on, not flashing).
-Try disabling and re-enabling the bluetooth pairing from the app (In the Nuki smartphone app, go to “Settings” → “Features & Configuration” → “Button & LED” and make sure “Bluetooh Pairing” is enabled.). This worked for me.

so there is no explicit way to put the nukihub I to pairing mode ?

  • I actually read the setup instructions from opener wrong
  • it says that the bridge (aka nukihub) needs to be put in pairing mode to connect the opener
    hmmm… somehow stuck here …

1 Like

There is: You power-cycle the ESP.

yet I tried that several times … worked only to pair with Nuki lock BUT not with opener …:thinking:

Move the ESP closer and make sure the Opener is actually in pairing mode. It might take a few tries (5-10), but eventually it will work.

First proper post on the topic, so first I should say a proper thank you!
I’ve been having problems with my Opener batteries, so I’m trying to debug a little.
As I understand it, setting the query intervals for the configuration and the battery to 7200 seconds doesn’t hurt. I also disabled presence detection. If these two don’t work, I guess I’ll have to try another set of batteries (my third!).

Anyway, I have a couple questions:

  • Can you set the duration of electricStrikeActuation for the Opener via MQTT?
  • What about the duration of Ring to Open? Didn’t see the option either, but at least this can be replicated by turning CM on and off.
  • And lastly, is ring suppresion not possible?

I’m waiting for my lock and keypad2, so more questions will arise :stuck_out_tongue:

I just use the app for configuring long-term settings like these. You will need it for firmware updates anyway.

Is there any way to set Nuki settings via automations in home assistant?
For example - I’d like to enable/disable night mode or change Nuki LED brightness via automation.

Hi, first of all let me say huge Thanks for this project! I went the whole way from Nuki Pro with it’s own very battery-hungry MQTT over wifi, than the original Nuki Bridge with it’s lacking “last action trigger” information and finely found this project and it has all I need: good battery as with bridge, full mqtt support as with original mqtt over wifi.

The only question I have: is it somehow possible to emulate a Nuki opener using Nuki hub?
I think I should elaborate here a bit. The reason why I want Nuki Hub to emulate Nuki opener is to have it (Opener) in the original Nuki App. So I could open both Building and Appartement doors with the Nuki App.
The way I would achieve it - have some entity/sensor like “Nuki Opener” published in HA via MQTT, so then when it will be triggered from original Nuki App, HA could start some automation (open the building door in my case).

Hi. I’m glad you like the project. If you have questions, I’d suggest to ask them on github in the discussion section, I don’t check this thread very often.

What you propose is a seperate project from Nuki Hub, and unfortunately not easily. The library that Nuki Hub builds on takes the role of a client to lock (or the opener). What you want is the exact opposite, you want to simulate the master device, something the library is not built for. Implementing all that is neither trivial nor fast to do.