MQTT and Wifi connections


I explain my problem here.


When nuki sends an MQTT command with a new state,
my MQTT server sends me a notification.

When the nuki loses wifi signal for a few seconds, the Nuki sends two MQTT messages with the new states, off and on.

My MQTT server send me 2 notifications.


No status message is received during Wi-Fi signal loss if the status has not changed.


Model: Nuki 4 pro (Firmware 4.1.8)

Can you please post in detail which messages you receive?

The mqtt server does not save the received commands in the log. From the client I only see the changes.
I do not know how to do it.

Anyhow, the Smart Lock republishes everything to the MQTT server once it reconnects. This has to happen because it could have also been a server restart / crash and some servers do not retain all informations during a restart. Therefore the Smart Lock needs to republish everything in order to make sure that the server is up to date.

1 Like

What you say seems fine to me, but there should not be a change of state, I do not see necessary to send an “off” and an “on”, only the current state. With the two messages you are causing home automation actions to be triggered when there really has been no change in state.

Hi again, any comment about last post?

Which Topic exactly is the on / off sent to?

There are topics where you want to see an offline state, and that’s why there might be a „last will“ setting sent to the broker for this case.

Have a look at the MQTT spec. The /connected topic carries a last will message which will be sent out by the MQTT broker automatically:

Indicates if the device is currently
connected to the MQTT server or not.
Uses “false” as the last will message,
which will be set by the mqtt server
automatically if the device disconnects.

Ok, I understand, but I have many devices connected via MQTT in my house, the only device that changes its status from off to on when it loses the signal is the Smart Lock.

One thing is the status of the connection and another is the status of the smart lock.