NUKI Hub firmware for the ESP32

Suddenly the device is appeared.
A half day later.
Now it works!

Hi, Technyon your solution is just what I am looking for but I am not that familiar with ESP32. Now I bought an ESP32 WROOM 4Mb Devkit V1 Board with WiFi and Bluetooth but the flashing doesnā€™t really want to work. Now I am wondering if I need to install Arduino IDE first before flashing? After all, I get the error message ā€œfailed to initializeā€

Are you trying to flash it via the website tool? Then you donā€™t need anything but your browser, the Arduino IDE is not needed.
Did you select the right com port and have you checked the serialIO driver is installed (go to device manager in windows and look if there is something in COM & LPT that looks like serial IO)?

EDIT:
Maybe itā€™s called something like UART in the device manager. Here is a sample picture:

uart

I will check it out in a moment.

You can also flash via the espressif flash download tool:

https://www.espressif.com/en/support/download/other-tools

A guide is included in the 7z file when you download a release. Thereā€™s another problem that might occur: The ESP has to be in bootloader mode before starting to flash. The devkits are supposed to do this automatically, but sometimes this doesnā€™t work. If you have a devkit there should be two buttons. Try keeping pressed the BOOT button (sometimes also called EN) while pressing the reset switch. That should put the ESP into bootloader mode, you can start flashing after that.

@technyon

Just saw on github you release another version working as an ā€œappā€ and not as a bridge. Just tried it, really cool to use the bridge (for my wife and if we have guests in the house) and the esp32 for me playing with home assistant.
Iā€™m using the esp32 now since 3 weeks only and (with one exception where it did not work and i had to reboot it manually) it does itā€™s job really good. Go on with the good work!

@technyon

Today it happened again, both the opener and the lock are not responsible. The ESP32 is working (i can login via browser and mqtt topics are changing). But if i try to unlock a lock it does nothing. In MQTT the action topic receives an ack, and the commandResult topic goes to failed short after this, every time.
If I lock the lock manual with my hands or open the door, the state and doorSensorState do not change anymore, so i think the ESP32 lost itā€™s communication with the nukis. The bluetooth rssi (it is about -60, there is 1M between ESP and the nukis) on the other hand changes frequently, so i think BT is working.
Restarting fixes the problem. Is there a logging or how i can check what is going wrong?

EDIT:
Just 2 more questions to eventually build a work around:
Is it possible to reset/restart the ESP32 with an mqtt command from home assistant?
And is there a command which i could use to check if the ESP32 communicates with the nukis? I was thinking of something that doesnā€™t lock or unlock but i can see if the commandResult goes to failed, i that case i would reboot the ESP32 with Question Number 1?

You can restart the ESP via the maintenance/reset topic. So the BT RSSI is still changing for both devices, but they do not respond to commands? Thatā€™s weird. Iā€™ve seen similar issues, but for me they are visible in HA because BT RSSI becomes a flat line.

Thanks a lot, i had overseen this topic. To answer my second question by myself, to check if the nukis are responding i can use the fobAction command, since i do not have a fob it does nothing but gives me a commandResult=success.
So as a workaround i would build an automation which once in an hour checks if the nukis respond and if not submit a reset request.

MQTT is required? I use HA only as a docker without any MQTT broker (by now).

Yes, you will need an MQTT broker.

hey all
soā€¦ today my original nuki bridge died, and lucky me, i discovered this threadā€¦

i tried flashing 2 different esp32ā€™s and got stuck in the same place - cant pairā€™em with the lock.

flash process went fine, mqtt status on the web page says ā€œYesā€ - but pairing does not work for me :frowning:
im about 50 cm far from the lock with the esp32, andā€¦ nothing.
tried restoring to factory defaults, delete from the app, repair with the app - but the esp32 does not seem to pick it up.
i did notice something:
when the lock is paired with the app, pressing the button for few seconds make the ring light flash.
only when it is not paired with the app, long press the button will make it light up without blinking - and as i understood - thats the lock ā€œpairing stateā€.
at that stage, i can easily pair it back to the app, but not to the ESP chip.

any help/thought will be apricated
cheers

Hey
Iā€™m having the same issue.
MQTT Connected YES
but when Iā€™m trying to pair it with the lock, nothing happens.
Also, despite MQTT is connected (I can see it on MQTT Explorer), it seems that it is not connected to HA, and I canā€™t find it there.

Any help/thought will be apricated
Thanks

Thereā€™s a setting in the app ā€œBluetooth paringā€, is enabled?

I have a strange behavior of the esp32 with the opener. I donā€™t know when it startet, but in the last days i have several ring actions i can see, but nobody did ring the door.


This happens once or more times a day and i canā€™t reproduce it. Anyone else has something like this?
And again my question, is there a possibility to log the esp32 without the usb connection (the serial interface) but with the same output?

What do u mean a setting in the app?
In order to put in in pairing mode, I need to press the button for about 6-7 seconds, and then the light turn on.
It stays like this for a minute or so, and then turn off cause itla not connect g to anything.
If I do the same, and connect the app, it works fine.

Hi, at the moment thereā€™s no remote logging unfortunately, but itā€™s one of the things i want to look into. The ESP is just reporting what the Opener communicates back. Maybe thereā€™s something wrong with the wiring? I had a similar issue, and if you search for it some people fix it with a resistor, which didnā€™t help in my case. I had to resort to using a relay in parallel to the bell, anything else and the opener would detect rings randomly.

Thereā€™s a setting in the app along with all the other settings that allows you to disable pairing, for security reasons I guess.

Strange.
Didnā€™t see a setting like that, but I will check again