GithubHelp home page GithubHelp logo

technyon / nuki_hub Goto Github PK

View Code? Open in Web Editor NEW
440.0 13.0 34.0 42.46 MB

Use an ESP32 as a Hub between a NUKI Lock and your smarthome.

License: MIT License

CMake 0.30% C++ 42.38% C 56.47% HTML 0.65% JavaScript 0.02% Shell 0.11% Makefile 0.01% Python 0.02% Dockerfile 0.03%
bluetooth bluetooth-low-energy cmake cpp esp32 fhem home-assistant home-automation iobroker iot

nuki_hub's People

Contributors

alexdelprete avatar bcutter avatar iranl avatar jressel01 avatar mkoppanen avatar mundschenk-at avatar nemon avatar regevbr avatar rodriguezst avatar technyon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nuki_hub's Issues

OTA Update

Please add the possibility to use directly the offered 7z file. The update doesn't work with the extracted nuki_hub.bin

Wifi Reconnect Issue

Hi,

As already reported in the ioBroker forum, I have problems with the wifi connection. Version 4.2 has not fixed the problem. Can I provide you with any logs ?

Thanks
abu

nuki_hub... not as hub but as keyfob

Hi,
Thanks for the great job! I have a particular request I suppose... I would like to continue using the official bridge, but be able to open the door from an esp32 (and better : to be able to use gpio, too). Problem is, the lock doesn't recognize two hubs. Once paired with nuki_hub, it isn't paired with the official bridge anymore.
I know that it should be possible to advertise as a keyfob when pairing rather than as a hub (taken from another library) :

# method to authenticate yourself (only needed the very first time) to the Nuki Lock
#	-publicKeyHex: a public key (as hex string) you created to talk with the Nuki Lock
#	-privateKeyHex: a private key (complementing the public key, described above) you created to talk with the Nuki Lock
#	-ID : a unique number to identify yourself to the Nuki Lock
**#	-IDType : '00' for 'app', '01' for 'bridge' and '02' for 'fob'**
#	-name : a unique name to identify yourself to the Nuki Lock (will also appear in the logs of the Nuki Lock)
def authenticateUser(self, publicKeyHex, privateKeyHex, ID, IDType, name):
    self._makeBLEConnection()

That means, of course, no more information returned directly from the lock to the esp. But then, it's still possible to open the door, and to keep the official bridge...

I wonder if it would be possible to implement such an option...
Thanks! Laurent

Adding supported model to read.me

Could be great to have the supported model list in the readme file.

I can't figure out if its compatible with nuki 3.0 Pro or if the Nuki 3.0 is supported too.

However the right question I think: is this using bluetooth or wifi

MQTT vs GPIO (GPIO seems unstable and slower to respond)

I'm controlling the nuki hub via home assistant (which is installed on an RPi 4). On the (maybe mistaken) assumption that a direct gpio connection will have faster and more reliable response times, I've enabled gpio control. But I find that the response times are very similar. Also, the lock often fails to respond via gpio whereas via mqtt it always responds.

I notice that with mqtt I can send another command as soon as the last one completes. But with GPIO I usually get no response if I do that. Does the GPIO implementation have a minimum time between commands?

I haven't been able to find any logging for nuki hub, where would I find that?

Separately - Bluetooth: how does distance between nuki hub and lock affect response time? To co-locate the nuki hub with home assistant, the nuki hub is about 4m away from the lock with a brick wall in between. Note: for the MQTT vs GPIO tests above, the nuki hub was colocated with homeassistant. So

Thanks.

mqtt restart command

Hi,
Great project!
Everything is working great, but sometimes the esp32 is losing connectivity.

May I know what the MQTT restart command that I will have a failsafe process for these kinds of problems is?

Protokoll vom Lock als JSON senden

Hallo,

besteht die Möglichkeit nach der Statusänderung vom Lock die Daten authorizationId, authorizationName, state und trigger als json über MQTT zu senden?

Gruß Tom

auto discovery fails - seems like a race condition

I can't get auto discovery to work for me - I keep getting
Unable to setup HASS. Invalid config received.
But it seems that the config is then received properly (see below)
Can you please help?

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13516
load:0x40080400,len:3604
entry 0x400805f0
Network device: Builtin WiFi
MQTT without TLS.
*wm:[1] AutoConnect 
*wm:[2] ESP32 event handler enabled 
*wm:[2] Setting Hostnames:  nukihub
*wm:[2] Setting WiFi hostname 
*wm:[2] Connecting as wifi client... 
*wm:[2] setSTAConfig static ip not set, skipping 
*wm:[1] Connecting to SAVED AP: notforanyone
*wm:[1] connectTimeout not set, ESP waitForConnectResult... 
*wm:[2] Connection result: WL_CONNECTED
*wm:[1] AutoConnect: SUCCESS 
*wm:[2] Connected in 1634 ms
*wm:[1] STA IP Address: 192.168.31.91
WiFi connected: 192.168.31.91
Host name: nukihub
MQTT Broker: 192.168.31.92:1883
NUKI Lock enabled
Lock state interval: 1800 | Battery interval: 1800 | Publish auth data: no
NUKI Opener disabled
Presence detection timeout (ms): 60000
Attempting MQTT connection
MQTT: Connecting with user: mqtt
MQTT connected
Nuki start pairing
Nuki paired
lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
Unable to setup HASS. Invalid config received.
lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
Nuki lock state: locked
Reading config. Result: 1
Reading advanced config. Result: 1

MQTT output as JSON

Hi @technyon
first of all I appreciate all the work you've done so far, the code quality is very high!

I'm creator/maintainer of https://github.com/kvj/hass_nuki_ng custom Nuki component for HASS and I've been also hacking Bluetooth API recently.

How much are you open discussing changes in MQTT ouput format?
I see that you purposely decided to expose each field of status, config, last auth, etc entry as a topic instead of JSON object. e.g.

Topic: xxx/yyy/config and payload: {"auto_lock": true, "led_enabled": false}
Then you can push multiple updates via single mqtt payload (anyway you get all the config updates via one BLE payload), but more importantly, you can greatly simplify MQTT discovery and expose all the attributes as state properties instead of making single entity for each field.

Tell me WDYT and I can contribute to the project

Cannot connect to the smartlock

Hello,
I cannot pair the smartlock

*wm:[2] Connection result: WL_CONNECTED
*wm:[1] AutoConnect: SUCCESS
*wm:[2] Connected in 4634 ms
*wm:[1] STA IP Address: xxx.xxx.xxx.xxx
WiFi connected: xxx.xxx.xxx.xxx
Host name: nukihub
MQTT Broker: xxx.xxx.xxx.xxx
NUKI Lock enabled
Lock state interval: 1800 | Battery interval: 1800 | Publish auth data: yes
NUKI Opener disabled
Presence detection timeout (ms): 60000
Attempting MQTT connection
MQTT: Connecting without credentials
MQTT connected
Nuki start pairing
Nuki start pairing
Nuki start pairing
Nuki start pairing
Nuki start pairing

Nuki and ESP32 are separated by 5 centimeters.
I use the latest Nuki 2.0 firmware 2.12.4

Nuki is of course in pair mode (white circle)

I tried to factory reset the smartlock but still trying to pair without success.

Do you have an idea?

Thank you

OTA update attempt makes web server return 401

When I try to update via the OTA mechanism, I get the page indicating that it will automatically reload when the update is ready. A few seconds later, the browser tries to reload, but the authentication credentials are not accepted (so I'm getting the popup to enter different ones).

This happens sometimes randomly, but with OTA updates, it is reproducible for me. Here's two simulated requests using telnet:

Normal:

$ telnet <hostname> 80
Trying <IP>...
Connected to <hostname>.
Escape character is '^]'.
GET / HTTP/1.1
HOST: nukihub.local
Authorization: Basic <base64-encoded-credentials>
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1034
Connection: close

<HTML><HEAD><meta name='viewport' content='width=device-width, initial-scale=1'><link rel='stylesheet' href='/inter.css'><link rel='stylesheet' href='/new.css'><TITLE>NUKI Hub</TITLE></HEAD><BODY><br><h3>Info</h3>
<table><tr><td>Hostname</td><td>nukihub</td></tr><tr><td>MQTT Connected</td><td>Yes</td></tr><tr><td>NUKI Lock paired</td><td>Yes</td></tr><tr><td>NUKI Lock state</td><td>locked</td></tr><tr><td>Firmware</td><td>5.2</td></tr></table><br><br><h3>MQTT and Network Configuration</h3><form method="get" action="/mqttconfig"><button type="submit">Edit</button></form><BR><BR><h3>NUKI Configuration</h3><form method="get" action="/nukicfg"><button type="submit">Edit</button></form><BR><BR><h3>Credentials</h3><form method="get" action="/cred"><button type="submit">Edit</button></form><BR><BR><h3>Firmware update</h3><form method="get" action="/ota"><button type="submit">Open</button></form><br><br><h3>WiFi</h3><form method="get" action="/wifi"><button type="submit">Restart and configure wifi</button></form></BODY></HTML>Connection closed by foreign host.

After update attempt:

$ telnet <hostname> 80
Trying <IP>...
Connected to <hostname>.
Escape character is '^]'.
GET / HTTP/1.1
HOST: nukihub.local
Authorization: Basic <base64-encoded-credentials>
HTTP/1.1 401 Unauthorized
Content-Type: text/html
WWW-Authenticate: Basic realm="Login Required"
Content-Length: 0
Connection: close

Lock'n'go not recognized when initial state is 'closed'

After some further testing it looks like the lock'n'go state change is not recognized anymore, at least not reliably. I monitored the MQTT messages and it appears that lock'n'go did not update nuki/lock/state (and consequently also not nuki/lock/binaryState for HA).

CSS load issue

Hello,

Every other time I can't load the CSS of the pages and I get this error in the console :

http://192.168.1.26/new.css net::ERR_CONNECTION_RESET

I have to refresh the page to get the display back.
I use this ESP32: https://www.amazon.fr/gp/product/B08BTLYSTM
I use firmware 6.0

Thank you

Github workflow not working anymore

After the last upgrade, the workflow fails and can't find the arduino board anymore. Have to figure out what's happening there.

Run mkdir -p build
/home/runner/arduino-1.8.19
-- Found Arduino Platform: /home/runner/arduino-1.8.19/hardware/arduino/avr
-- Selected Arduino Board:  []
CMake Error at arduino-toolchain/Platform/Arduino-Determine.cmake:3 (message):
  Please select a valid arduino board and its menu options using one of the
  below methods.
  1.  From CMake GUI
  2.  From the generated BoardOptions.cmake at
  /home/runner/work/nuki_hub/nuki_hub/build/BoardOptions.cmake
  3.  Use yor own preset BoardOptions.cmake
  -DARDUINO_BOARD_OPTIONS_FILE=<file>
  4.  Use -DARDUINO_BOARD=<board_id> and
  -DARDUINO_<BOARD_ID>_MENU_<MENU_ID>_<MENU_OPT_ID>=<TRUE/FALSE>!!!
Call Stack (most recent call first):
  /usr/local/share/cmake-3.23/Modules/CMakeDetermineSystem.cmake:160 (include)
  CMakeLists.txt:5 (project)
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Error: Process completed with exit code 1.

2 nuki smart lock in the same house

Hi,
I have a Nuki smart lock 3.0 (only BLE) and a Nuki smart lock 3.0 pro (BLE+WIFI) in the same house. they are not accesible via BLE from an unique point.

I can use only one ESP32 to control both smart locks? it can connect via BLE near to Smart Lock 3.0 and via WIFI to the Smart lock 3.0 Pro?

or I have to use n.2 ESP32? one dedicated for each Smart lock?

regards

Battery Level

I miss the battery level in the mqtt information.

Is this just a problem for me or do others have it too?

I use mqtt in ioBroker and the nuki_hub.bin from 28.06. (4.5-testing because of the Wifi problem)

Support for MQTT retain

Could you implement an option for the state topics to configure a retain option?
This way the MQTT Broker will save the last known state of the lock or battery etc even if the hub is not reachable

Add bluetooth and wifi RSSI

To help with positioning the ESP32, it would be great if the firmware would report BT and WiFi RSSI values (also as diagnostic sensors in HA).

Nuki Opener: How to pair (as app) with the nuki_hub

Hi,
I am desperately trying to pair my nuki opener to the nuki hub.
The procedure for the nuki lock was clear: press the button 5 seconds and (re)start the esp32.
But I am not able to connect the opener.
What am I doing wrong?

In the esp32 log I can see that the device is trying to pair with the opener at least...

image

Nuki Opener Ring doesnt get recognized everytime

Hello everyone,
im testing nuki_hub as an alternative to nuki_ng, which always seems to drop connection for a few seconds, so i get 5-10 times the homekit announcement, that my door is now shut / opener is off.

i have it paired as app at the moment, because of the Wife Acceptance Factor. The Bridge is annoying with the messages, but if it doesn't work, would be much worse.

Nuki Hub seems to not register all the events, that are going on.
Here is a screen of the states in HA
image

And here is a MQTT Debug Log
image

So, what am i doing wrong?

Slow/no response for lock/unlock action over MQTT

Im using this project together with HA. Whenever I try to unlock/lock both of my doors (have 2 Nukis and 2 AZDelivery ESP32, https://www.amazon.nl/dp/B071P98VTG/ref=pe_28126711_487102941_TE_SCE_dp_1?th=1), I get a 30/70 percent success rate.

Success:

front-door/lock/action unlock
front-door/maintenance/wifiRssi -33
front-door/lock/rssi -64
front-door/lock/action ack
front-door/maintenance/wifiRssi -34
front-door/presence/devices 54:d2:72:xx:1a:xx;Nuki_xxxx;-65
front-door/lock/commandResult success
front-door/lock/rssi -65
front-door/maintenance/wifiRssi -33

No ack/commandResult:

front-door/lock/action unlock
front-door/maintenance/wifiRssi -33
front-door/presence/devices 54:d2:72:xx:1a:xx;Nuki_xxxx;-76
front-door/maintenance/wifiRssi -33
front-door/maintenance/wifiRssi -32
front-door/maintenance/wifiRssi -32

Simply nothing happens. Any idea how to debug this?

_mqttMaxBufferSize filling most of the heap

I am implementing TLS support to MQTT to encrypt communications. It was working fine with version 2.6 (before opener support) but does not work now when rebasing to master.
It seems that there is no heap space available for the SSL due to an increase of the MQTT buffer.
_mqttMaxBufferSize = 16384;
If I decrease the value of _mqttMaxBufferSize from 16k to the default value (256bytes) it works fine.
Have you measured the maximum needed buffer? Are those 16k really needed?

Nuki 1.0 stopped working since 6.2+

After upgrading to version 6.2+, communication with Nuki 1.0 stopped working, pairing will not happen after upgrading.
Re-pairing won't help too.

When downgrading to 6.1, everything works immediately.

obrazek

Using "Lock'n'go" does not change the lock state

It appears that when using the "Lock'n'go" feature (e.g. via a double click of the lock button), the state of the lock entity in Home Assistant is not updated (i.e. neither the lock nor unlock action register in the logbook, it looks as if the lock remained closed).

Integrated wiegand Keypad

It works perfekt and stable. I used one more ESP32 with wiegand interface to use keypad and Rfid. One output pin connected to the unlatch pin of your nuki hub. It was a first version for testing and it works. So I could use Fingerprint Keypad and your nuki hub.
Now I am thinking of integrating these wiegand interface code into your nuki hub code as a all in one solution.

Compilation information

This job is incredible, I have lot of time searching a project like this!.
Is it possible to add some information to compile and create the bin file using the expressiff tools?

Thank you in advance,
BR

Inconsistent lock binaryState/state in MQTT

Today I noticed that lock sensor in HA was reporting unlocked when Nuki was locked, I checked MQTT and noticed this:

image

You will notice that lock/binaryState is unlocked but lock/state is locked.

I restarted Nuki Hub to force it to reset the states from the lock and everything was good again.

BTW: is it possible to add a restart button in the UI? right now I go into settings and hit save to force it to restart)

Unable to add new keypad user

I am having trouble getting the add a new keypad user process to work. Everything else seems to work well (great job btw!), for example, I can delete a user that I have previously created using the Nuki app. But If I run a HA script to add a new user I get a failed commandResult (monitored using MQTT Explorer). I am running the Mosquito broker add-on in HA. Below are my script yaml's:

alias: "Nuki: Add New User Code"
sequence:
  - service: mqtt.publish
    data:
      topic: nuki/keypad/command/name
      payload: fred
      qos: "2"
  - service: mqtt.publish
    data:
      topic: nuki/keypad/command/code
      payload: "123456"
      qos: "2"
  - service: mqtt.publish
    data:
      topic: nuki/keypad/command/enabled
      payload: "1"
      qos: "2"
  - service: mqtt.publish
    data:
      topic: nuki/keypad/command/action
      payload: add
      qos: "2"
mode: single

alias: "Nuki: Delete User Code "
sequence:
  - service: mqtt.publish
    data:
      topic: nuki/keypad/command/id
      payload: "4"
      qos: "0"
  - service: mqtt.publish
    data:
      topic: nuki/keypad/command/action
      payload: delete
      qos: "0"
mode: single

Any help or pointers to aid debugging will be greatly appreciated.

Also, I did not see any way to set time limited access on the keypad codes. Is this possible using nuki_hub and, if not, are there plans to introduce such functionality?

Port nuki_hub to Olimex ESP32-POE-ISO Board

Hi,

i was wondering porting this app to an Olimex ESP32 PoE Board?

this has several benefits:

  • LAN Mode with PoE, no need to wire power
  • All in one Board
  • No wifi connection drop issues

Unfortunately, the board uses a LAN8710A Chip in RMII Mode for managing Ethernet, which is not supported by the current firmware.

the board is well documentated, maybe we can write a port for this particular board?
the shematic: https://github.com/OLIMEX/ESP32-POE-ISO/blob/master/HARDWARE/ESP32-PoE-ISO-Rev.H/ESP32-PoE-ISO_Rev_H.pdf

Config for Homeassistant

This is just a little help, not a question.
I have the nuke v3
To use the mqtt lock in home assistant, i wrote this in the configuation.yaml:

mqtt:
lock:
- name: Haustür
unique_id: 'nuki1'
state_topic: 'nuki/lock/state'
command_topic: 'nuki/lock/action'
payload_lock: 'lock'
payload_unlock: 'unlock'
state_locked: 'locked'
state_unlocked: 'unlocked'
optimistic: false
qos: 1
retain: true
value_template: "{{ value }}"

Keypad Control: when enabled Nuki Hub doesn't work anymore

Hi,

I just configured Nuki Hub: flashed fw, configured wifi, set mqtt parameters and paired the Lock. Automagically HA had all the entities available, they were refreshing quickly. Everything worked out beautifully.

While checking the other features, I enabled Keypad Control: the device rebooter, and NOTHING was working anymore. Ping timeouts on the network, ping timings were huge, and then it stopped responding to pings. I cyvled power a couple of times but the behaviour was consistent, after the boot, things weren't working anymore, the device was not reachable. Luckily, I managed to open the web interface for 10 secs one time and I could disable the Keypad Control, the device rebooted and everything was perfect again.

While it wasn't working, I noticed a LOT of MQTT msgs on the nuki/keypad topic. I think the CPU of the device was in a loop, that's why nothing was working anymore (that was the impression at least).

Hope you'll find the issue. Meanwhile, thanks a lot for this project.

Flashing suceed but ESP32 in constant reboot loop

Device chinese copy of "Wemos D1 mini ESP32"
Previously worked fine with arduino firmware with OTA, wifi, MQTT&Home assistent...Then I wanted to try your hub with my lock

Tried erase and then flash trough edge browser, also with espresif tool, all went fine.
After flashing I cant find it's access point and here is a log from your web flashing tool

ELF file SHA256: 0000000000000000

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13516
load:0x40080400,len:3604
entry 0x400805f0

assert failed: do_core_init startup.c:298 (flash_ret == ESP_OK)

Backtrace:0x40083b79:0x3ffe3aa00x4009314d:0x3ffe3ac0 0x40098b65:0x3ffe3ae0 0x401305a2:0x3ffe3c10 0x4008327a:0x3ffe3c40 0x4007920a:0x3ffe3c90 |<-CORRUPTED

ELF file SHA256: 0000000000000000

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13516
load:0x40080400,len:3604
entry 0x400805f0

assert failed: do_core_init startup.c:298 (flash_ret == ESP_OK)

Backtrace:0x40083b79:0x3ffe3aa00x4009314d:0x3ffe3ac0 0x40098b65:0x3ffe3ae0 0x401305a2:0x3ffe3c10 0x4008327a:0x3ffe3c40 0x4007920a:0x3ffe3c90 |<-CORRUPTED
...

add retry mechanism

Oftentimes, lock and unlock commands fail. When using automation this isn't very pleasant :-) to overcome it I created a somewhat "complex" NodeRed flow that handles command retries incase of failures to ensure that the commands sent are executed.
It will be great if we can support such a feature built-in.

image

It should ignore command in queue after restart

Hi,
first at all, thank you for the work! It's a great project!

Here is my problem:

Sometimes I have to restart the ESP by myself because it has no connection anymore. But after the restart It will run the last command which I sent over MQTT while it was unreachable. Is there any way to Ignore that?
When I'm staying at home and restart it, it's no problem I'm there. But in case there is an power outage and I'm not at home and for whatever reason there is an command in queue like to open the door and the power is back. I think it's not good when the door will open then. :) I hope you understand my concern and maybe there is something to fix it.

For your information: I'm using Firmware v6.2 with ESP32 CP2102 over MQTT to ioBroker.

Anyway thanks again.

Error reading MQTT broker host from preferences

After upgrading to version 5.0 I am having issues connecting to MQTT.

It seems that the broker address is not being set. This is how it gets printed in the serial console:
MQTT Broker: :8883
But this is what is displayed in the web interface:
image

Home Assistant Support

Hello.

I am trying to configure my Nuki device. I have done the following steps: I have connected it to the WiFi and I have paired it. I just have to connect it to Home Assistant. But I have never used mqtt and I don't know how to connect it.

The console at https://technyon.github.io/nuki_hub/ shows me the following messages:

Attempting MQTT connection
MQTT: Connecting without credentials
MQTT connect failed, rc=-2
Free Heap: 116552
Nuki start pairing
Nuki paired
Attempting MQTT connection
MQTT: Connecting without credentials
MQTT connect failed, rc=-2
Free Heap: 114892
Attempting MQTT connection
MQTT: Connecting without credentials
MQTT connect failed, rc=-2
Free Heap: 113956
...

I also have MQTT enabled in Home Assistant.
image

What else should I do?

Thanks in advance.

Bluetooth stack issues (was: No updates in HA despite network connection / MQTT reconnect loop)

This morning I noticed a peculiar phenomenon while I was leaving for work: The lock state in HA did not change, yet the ESP web interface was reachable by Wifi and told me it was connected to MQTT (and the lock) just fine. When I came home and wanted to check more deeply, I noticed the state updating was working again.

Here are my restart settings:
image

The last time the lock entity in HA worked was Saturday 18:34 (unlock/lock event pair). (There was a lock event recorded by HA on Sunday 22:11, but that was just because I restarted HA at that time.)

According to Mosquitto, the last login by the ESP user yesterday was 20:14, replacing a still existing connection. Today at 08:21, the client closed the connection and opened a new one, and again at 08:24, and yet again at 08:40, and at 08:45. (Interestingly, there was a 3 second delay between closing and opening the new connection this time.)

Again at 08:47, also with the 3 second delay, and yet again 09:07 (no delay). Another fast reconnect at 09:12, at 09:23, 09:28, 09:43, 09:48, 09:50, and then finally at 10:20. No reconnects since then, and HA has recorded the lock/unlock events correctly after that.

I am not sure what was going there, but it sure looks weird. I've looked at the logs of the AP the ESP was connected to and there only three events in the relevant time frame:

Sun Aug  7 20:14:27 2022 daemon.info hostapd: if-iot: STA <nuki_hub_mac> IEEE 802.11: authenticated
Sun Aug  7 20:14:28 2022 daemon.info hostapd: if-iot: STA <nuki_hub_mac> IEEE 802.11: associated (aid 7)
Sun Aug  7 20:14:28 2022 daemon.info hostapd: if-iot: STA <nuki_hub_mac> RADIUS: starting accounting session <session1>
Sun Aug  7 20:14:28 2022 daemon.info hostapd: if-iot: STA <nuki_hub_mac> WPA: pairwise key handshake completed (RSN)
...
Mon Aug  8 06:47:42 2022 daemon.info hostapd: if-iot: STA <nuki_hub_mac> WPA: group key handshake completed (RSN)
...
Mon Aug  8 12:25:23 2022 daemon.info hostapd: if-iot: STA <nuki_hub_mac> IEEE 802.11: authenticated
Mon Aug  8 12:25:24 2022 daemon.info hostapd: if-iot: STA <nuki_hub_mac> IEEE 802.11: associated (aid 7)
Mon Aug  8 12:25:24 2022 daemon.info hostapd: if-iot: STA <nuki_hub_mac> RADIUS: starting accounting session <session2>
Mon Aug  8 12:25:24 2022 daemon.info hostapd: if-iot: STA <nuki_hub_mac> WPA: pairwise key handshake completed (RSN)

So the MQTT reconnect on Sunday 20:14 was related to a WiFi reconnect, probably after a reboot due to network timeouts (I fiddled with some settings at that time). The numerous reconnects today don't seem to have anything to do with the network itself.

No open entity in HA

Hi, I just installed this for use with a Nuki 3.0 and everything is ok except I'm missing the open door entity, I just have lock and unlock.

Any idea why?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.