NUKI Hub firmware for the ESP32

Thank you very much, it works now :blush:
Only thing is that my cloud-based tuya contact sensor is waaaaaay faster than this :sweat_smile:

Even with the native Nuki app, the state door take several seconds to be refreshed. I think Nuki hub cannot do anything about that. May be it is faster with the smartlock v3 ?

I switched from the official bridge to this hardware because the nuki_ng was not really working well with the underpowered bridge. So far everything seems to be working fine. I have a few questions, howerver:

  1. Is it correct that the hub does register with the Smartlock as bridge, but not rwith Nuki Web like the original bridge? Yes, one less cloud service to rely on, but it was sometimes handy to be able to use the wab app or the Android app from afar.
  2. Are there any implementatione examples (blueprints, automations, scripts) for keypad administration via the Nuki Hub?
  3. I don’t get any readings for wifi and Bluetooth signal strength?!
  4. I have the Smartlock Pro. This has an internal wifi, which gets disabled as soon as a bridge is connected. Not that it is absolutely necessary, but would it be possible to run the internal wifi in parallel to the bridge (would probably solve 1.)?
  5. What does the “trigger” attribute mean?

Hi - it’s been 10 days since I installed v8.0 and set the query intervals to 7200. Battery drain has reduced from 6% per day to 2.7% per day. A good improvment, but still a bit high in my opinion.

v8.0 has been rock solid after periods of uptime of 3-4 days and a few HA updates along the way. Just installed v8.7 today to see if there are any improvements. I have set all the new config interval to 7200 as well.

P.S: The system information page in v8.7 is quite handy. Any chance of placing an uptime and/or time of last disconnect data in there (just saw a “RestartOnDisconnectWatchdog” for Restart Reason FW message in there).

I went from 2.5% per day to 0% in 7 days since I completely reset my esp32 (re-installed the bootloader) then re-flashed via the usb cable and left the default fw settings. It may be due to something else (e.g. less restart => less battery drain) but you could try it.

:+1: +1 definitely helpful

Disconnect time isn’t possible, since the ESP doesn’t know the date. I’ve added uptime which will be included in the next release. There’s already an mqtt node that holds the uptime (maintenance/uptime). If you log it you put it in a chart and track restarts.

1 Like

Any kick-start information for MQTT newbies to achieve this?

Just add this to your configuration yaml:

mqtt:
  sensor:
    - name: "nuki_esp32_upti"
      state_topic: "nuki/maintenance/uptime"
      value_template: "{{ value }}"
      unit_of_measurement: minutes
      unique_id: nuki_esp32_upti_unique_id

If you already have the mqtt: sensor: part (i think you would), just start with the -name line and add it under your last mqtt sensor. Reload mqtt and now you have a sensor with the uptime, if the sensor drops to below 10 you have had a restart.

1 Like

Thanks. Too easy. Looking at MQTT Sensor - Home Assistant I added some minor stuff (e. g. make it show up in the diagnostics section of the respective Nuki Hub device).

I used:

mqtt:
  sensor:
    - name: "lock_door_a_uptime_nukihub"
      state_topic: "nuki_door_a/maintenance/uptime"
      value_template: "{{ value }}"
      unit_of_measurement: minutes
      unique_id: generated-by-vs-code
      state_class: total
      icon: mdi:clock
      device:
        identifiers: nuki_XXXXXXXX
      entity_category: diagnostic

Interestingly, both Nuki Hubs restart after almost exactly 12 hours:

Too precise for a coincidence, that’s a pattern. I have the restart flag set.

How to further investigate the reason for this behavior?

I have the restart flag set.

Do you mean the “Restart timer” or “Restart on disconnect” ?

Restart on disconnect:

restdisc: true
resttmr: -1
Restart reason FW: RestartOnDisconnectWatchdog
Restart reason ESP: ESP_RST_SW: Software reset via esp_restart.

May be it is a stupid idea but you could check the DHCP lease duration of your AP.

Not stupid at all. But not relevant in this case as

  • set to static addresses and
  • the lease time is something around 10 days.

Hi everyone, after a while, with a Little bit more Experience, i tried again and everything works super fine smart lock 3.0 pro.

But now, after a few hours, the nuki app reports the lock as offline!
IT still works via HA though.

Did this happen with anyone else?

My Nuki hub is running without problem now but this night it re-started (after 4 days of uptime) :

Restart reason FW: NetworkDeviceCriticalFailure
Restart reason ESP: ESP_RST_PANIC: Software reset due to exception/panic.

What could lead to a “NetworkDeviceCriticalFailure” ?

Hi,

the message is a bit misleading, it’s the W5500 detection triggering this message. I think the actual reason is the second line, ESP_RST_PANIC. What’s caused this is hard to tell without having a debugger running.

Hi everyone, i have an issue, all is working well but every 2-3 days, i cannot communicate with nuki via mqtt. It looks good in the Web interface, connected wifi and Bluetooth but no link on the Nuki apps !

The only way to troobleshoot is restart Nuki smart locker by removing batterie and plus it again. If i restart the Bridge, it is not working.

Did i miss something ?

Thanks