MQTT API Specification v1.4

Works perfectly for me.

Can MDNS/DNS host name be used or is it only enabled for hard-coded MQTT connection?
Because the field name is ā€œHost nameā€ I suppose it is possible almost for DNS name but I prefer to be sure in the case I would have to switch from IP to host name for any reason.

.local domains will be treated as MDNS domains and will be resolved as such. All other domains use standard DNS.

1 Like

This approach can lead to some troubles if you donā€™t distinguish between ā€œmqtt.localā€ and ā€œmqtt.<< domain >>. localā€. Lot of companies, and not only, use ā€œ.localā€ as TLD for their internal DNS/AD domain for separation from internet.

/MfG
ZoloN

Which is wrong as .local is reserved special-use domain name for multicast DNS and should not be resolved using standard DNS.

Iā€™m seeying strange behaviour on the lockActionEvent after replacing my lock.

Iā€™m parsing this event in Home Assistant to identify which user or system performed which action. This was always working fine. But I had to replace my Nuki SL3 Pro due to a mechanical failure. After setting up the new lock in exactly the same way it now always reports 0 on the CodeID parameter (which is unknown), even when a defined / authorized keypad code was used to open the lock. On my previous lock it always reported a specific code based on which keypad code was used.

So my question, is this a bug that was introduced in the MQTT implementation or is it something specific to my refreshed setup. Either way, how can I fix it?

Yes and no. Look here: .local - Wikipedia
Lot of companies have .local as their internal TLD and to change this is connected with lot of effort. So, even when not suggested anymore, is still (and will remain) in use

/MfG
ZoloN

Thanks for reporting. Weā€™ll have a look at it. Could be that adding another code might temporaryily fix it (i.e. it could be that the codeid index starts at 0 for the first code).

Thanx, seems spot on. Already had a code for guests which was created after our famliy code which had ID 1 and after testing did return a proper value for CodeID. Creating another code added it with ID 2.

hallo JĆ¼rgen,

do you have any news?

/MfG
ZoloN

Yes, problem is identified and will be fixed in an upcoming firmware update (most likely 3.6.2).

Which is not up to Nuki to solve.

it depends. just read the wikipedia article again, (please note the difference between ā€œname ending with .localā€ and ā€œdomain name endingā€¦ā€) or look into the RFC 6762 Chapter 3:

this document allows any computer user to
elect to give their computers link-local Multicast DNS host names of
the form: "single-dns-label.local."

that means, ā€œmqtt.localā€ and ā€œmqttā€ should be resolved via mDNS exclusively, but ā€œmqtt.mydomain.localā€ via traditional DNS query.

rule of thumb: if it ends with ā€œlocalā€ and there is more than one dot, itā€™s not mDNS name :sunglasses:

/MfG
ZoloN

Hey there,
I own a Nuki 2.0 and would buy ne Nuki 3.0 Pro. Is the MQTT API usable without internet? So itā€™s okay to block the connection in my router?

Thanks :slight_smile:

Blocking internet access will stop MQTT

Why? This doesnā€™t make any sense to meā€¦

It has been explained in one of the replies on this forum.

It has to do with the lock having to verify if thereā€™s a network connection in a way that is power efficient as well as memory efficient.

You can always suggest a new feature and get it voted :wink:

Donā€™t spend more money buying another lock: keep your Nuki 2.0 and buy a $5 M5Atom ESP32 device with this firmware: technyon/nuki_hub: Use an ESP32 as a Hub between a NUKI Lock and your smarthome. (github.com)

You will have total control of the lock via MQTT and also automatic integration (autodiscovery) with Home Assistant. All LOCAL, no internet dependency.

An MQTT implementation that requires internet is pure non-sense.

1 Like

Thatā€™s really useful to see, thanks!

Does that MQTT / ESP32 integration expose (to Home Assistant) HOW the lock was unlocked / locked (e.g. auto / keypad / manual)?

Iā€™m missing that with the Nuki & Bridge combo in Home Assistant.

Oh wow. Iā€™m using ESP32 and ESP8266 for everything. Havenā€™t heard about this nuki_hub for ESP32. Thanks mate! :slight_smile:

1 Like