MQTT Beta Feedback & Beta 3.5.0

Hi,
my Wi-Fi router can´t run DNS server so I installed Dnsmasq add-on to Home Assistant with these records in configuration:

  • host: mqtt
    ip: 192.168.1.2
  • host: mqtt.local
    ip: 192.168.1.2

and change my DHCP server tu use this DNS server as the first DNS in the network. The you must reboot your Nuki device to obtain new settings from DHCP. Thas´t all. The Nuki try to connect to MQTT server immediatelly after start.
But if you´re able to ping mqtt and mqtt.local, it seems that you don´t need additional DNS server. I installed the server because in my network the resolve of mqtt does not worked.
PS: in the add-on in HA you can check if the Nuki asked for the correct DNS mqtt record.
PS2: have you created in the MQTT server the user nuki with the SHA-256 hash of your WiFi password?

Yep, I did… and I can connect to the broker from different devices across my network with those credentials…

I run into the same problem, dns records are set but nuki was not able to find and connect. All other devices could resolve it. My workaround was to publish them.

Try:

avahi-resolve -n mqtt.local -v

If that will not work, try to publish your mqtt ip:

avahi-publish-address mqtt.local 192.168.50.220 &

Thank you very much. This helped and now everything seems to work :pray: :+1:

1 Like

Where you run the command? On HA server or somewhere else?

Actually I ran it on the Raspi where the Mqtt broker runs… It did not help (I believe) so I tried to run the same command on Nuc where I have HA and other stuff… And suddenly it started working :slight_smile:

1 Like

Hmmm,
I tried to run Terminal & SSH addon in HA but there is no command avahi-publish-address available.

You need to install it.
sudo apt-get install -y avahi-utils

but the apt-get command can´t be used in build-in HASoS. no problem, I´ll stay on my DNS server settings. It seems thit is out-of-scope HASoS.

Just for the records, now the locks are renamed in mqtt. No idea when this happened.

Apart from the late renaming the current beta works fine. Did not discover any other problem so far. Locks are now always responding directly when somebody uses them. Thumbs up!
:+1:

1 Like

Is it possible to expose the wifi/connection status info to MQTT?

Not sure if it makes sense to show the wifi status via wifi. :wink:

I have a lot of esphome devices in my home, all exposing their wifi info. It gives me insight in the stability of the connections and allows me to create an alert when the connection is in stable.

Ok. So this “wifi status” is more detailed than connected/not connected.

I always monitor battery and RSSI for BT and WiFi in Home Assistant:

image

I’ve been running it for a few days to integrate my lock with my Home Automation / alarm system. No issues and no impact on battery life.

Question for the Nuki dev team: do you already have a date for public release? Just curious

Such things are usually made public in our official communication channels and not here in the forum. Launch date of MQTT API has been communicated as “in 2023”.

Question: I’m away from home and of course the lock is there sitting idle. Checking the MQTT server logs I’m seeing the following:

2022-12-21T14:23:16.135760953Z 1671632596: New connection from 192.168.38.67:52477 on port 1883.

2022-12-21T14:23:16.139606214Z 1671632596: New client connected from 192.168.38.67:52477 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-22T00:02:14.999744714Z 1671667334: New connection from 192.168.38.67:52480 on port 1883.

2022-12-22T00:02:14.999832547Z 1671667334: Client SL3P_3323C664 already connected, closing old connection.

2022-12-22T00:02:14.999859806Z 1671667334: New client connected from 192.168.38.67:52480 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-22T06:03:14.777978393Z 1671688994: Client SL3P_3323C664 has exceeded timeout, disconnecting.

2022-12-22T06:03:21.862273798Z 1671689001: New connection from 192.168.38.67:52483 on port 1883.

2022-12-22T06:03:21.862651573Z 1671689001: New client connected from 192.168.38.67:52483 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-22T06:16:08.681748086Z 1671689768: Client SL3P_3323C664 has exceeded timeout, disconnecting.

2022-12-22T06:16:28.807866095Z 1671689788: New connection from 192.168.38.67:52486 on port 1883.

2022-12-22T06:16:28.807960687Z 1671689788: New client connected from 192.168.38.67:52486 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-22T12:02:29.734042797Z 1671710549: New connection from 192.168.38.67:52489 on port 1883.

2022-12-22T12:02:29.734270851Z 1671710549: Client SL3P_3323C664 already connected, closing old connection.

2022-12-22T12:02:29.734350257Z 1671710549: New client connected from 192.168.38.67:52489 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-22T21:18:18.312125174Z 1671743898: New connection from 192.168.38.67:52492 on port 1883.

2022-12-22T21:18:18.312688076Z 1671743898: Client SL3P_3323C664 already connected, closing old connection.

2022-12-22T21:18:18.312774353Z 1671743898: New client connected from 192.168.38.67:52492 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-23T12:03:33.512318935Z 1671797013: New connection from 192.168.38.67:52495 on port 1883.

2022-12-23T12:03:33.512420008Z 1671797013: Client SL3P_3323C664 already connected, closing old connection.

2022-12-23T12:03:33.513159502Z 1671797013: New client connected from 192.168.38.67:52495 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-24T06:03:08.741965785Z 1671861788: Client SL3P_3323C664 has exceeded timeout, disconnecting.

2022-12-24T06:03:16.822219450Z 1671861796: New connection from 192.168.38.67:52498 on port 1883.

2022-12-24T06:03:16.822295338Z 1671861796: New client connected from 192.168.38.67:52498 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-25T03:52:56.699621394Z 1671940376: Client SL3P_3323C664 has exceeded timeout, disconnecting.

2022-12-25T03:53:44.654673024Z 1671940424: New connection from 192.168.38.67:52501 on port 1883.

2022-12-25T03:53:44.654754394Z 1671940424: New client connected from 192.168.38.67:52501 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-25T10:46:38.706316439Z 1671965198: Client SL3P_3323C664 has exceeded timeout, disconnecting.

2022-12-25T10:46:48.797231263Z 1671965208: New connection from 192.168.38.67:52504 on port 1883.

2022-12-25T10:46:48.797316521Z 1671965208: New client connected from 192.168.38.67:52504 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-25T12:03:24.009773752Z 1671969804: New connection from 192.168.38.67:52507 on port 1883.

2022-12-25T12:03:24.009851196Z 1671969804: Client SL3P_3323C664 already connected, closing old connection.

2022-12-25T12:03:24.009915306Z 1671969804: New client connected from 192.168.38.67:52507 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-26T06:03:02.733682281Z 1672034582: Client SL3P_3323C664 has exceeded timeout, disconnecting.

2022-12-26T06:03:41.114637768Z 1672034621: New connection from 192.168.38.67:52510 on port 1883.

2022-12-26T06:03:41.114798730Z 1672034621: New client connected from 192.168.38.67:52510 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-26T16:38:49.461421329Z 1672072729: New connection from 192.168.38.67:52513 on port 1883.

2022-12-26T16:38:49.461726326Z 1672072729: Client SL3P_3323C664 already connected, closing old connection.

2022-12-26T16:38:49.461848899Z 1672072729: New client connected from 192.168.38.67:52513 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-26T20:19:55.339217702Z 1672085995: New connection from 192.168.38.67:52516 on port 1883.

2022-12-26T20:19:55.339312071Z 1672085995: Client SL3P_3323C664 already connected, closing old connection.

2022-12-26T20:19:55.341078334Z 1672085995: New client connected from 192.168.38.67:52516 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-26T22:05:58.254681367Z 1672092358: Client SL3P_3323C664 closed its connection.

2022-12-26T22:08:51.001854848Z 1672092531: New connection from 192.168.38.67:52519 on port 1883.

2022-12-26T22:08:51.001951292Z 1672092531: New client connected from 192.168.38.67:52519 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-27T08:02:02.699334456Z 1672128122: Client SL3P_3323C664 has exceeded timeout, disconnecting.

2022-12-27T08:02:40.136739197Z 1672128160: New connection from 192.168.38.67:52522 on port 1883.

2022-12-27T08:02:40.136895622Z 1672128160: New client connected from 192.168.38.67:52522 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

2022-12-27T12:03:28.909520553Z 1672142608: New connection from 192.168.38.67:52525 on port 1883.

2022-12-27T12:03:28.909656403Z 1672142608: Client SL3P_3323C664 already connected, closing old connection.

2022-12-27T12:03:28.910221325Z 1672142608: New client connected from 192.168.38.67:52525 as SL3P_3323C664 (p2, c1, k300, u’nuki’).

Is that expected behaviour? Checking the logs it did not happen before (maybe because the lock was in constant use). It started disconnecting as soon as I’ve left

There is this remark in the API spec:

The reconnect mechanism for the Smart Lock 3.0 Pros WIFI connection is bound to
a successful connection to the Nuki server. i.e. you can not isolate the Smart Lock
from the internet as this will lead to reconnect attempts involving WIFI log off/ons
with exponentially growing downtimes in between. Likewise an unstable internet
connection can lead to MQTT reconnects and downtimes.

WiFi or internet connection drop outs are quite common. Especially for a low power, low data device. Your log looks pretty normal.

Will it be possible to adjust configuration over MQTT?

I would like to be able to switch Auto Open on/off on certain situations. My Home Assistant knows best what te situation is (how long have I been from home, was I by car or bike, are there any other people at home etc.) so it would be nice if HA can turn auto open on or off when I like to.

When I come at home by bike, I’ll go via the back door so there is no use for auto open. But by car it is.