Nuki Smart Lock and Matter (or mqtt)

I noticed that there now is no dedicated open/unlatch control, but rather I need to click on the lock symbol or name to open the control modal. The button to open/unlatch is shown there below the lock/unlock slider control.

Yes, it is for MQTT, but not for Matter. Also the corresponding service to open the door will not allow you to pick the matter entity. I even removed the device and paired it anew yesterday, but still it isnā€™t there.

Using mqtt forces me to configure either Matter (actually Thread, but Nuki isnā€™t mentioning that) or wifi. So it seems like a waste to turn on mqtt as well as matter, since wifi is more power hungry.

Same lock (mqtt is disabled for now):


Does anyone know if thereā€™s a way to manage key codes on the Nuki Keypad 2.0 from home assistant?

Hi there,
i just setup up my Nuki lock via mqtt.

It is working fine but i do not see the ā€œlast lock userā€.

How exactly do i get that info?

Thank you in advance
/Bo

Not 100% sure but usually, if you use home assistant to lock/unlock the nuki, then the user identified as performing the lock/unlock will be MQTT and not the actual user.

Good luck!
Daniel

Hi,
i do not use HA to lock/ unlock.

I am using the keypad or the Nuki app.

When using the Nuki Web API the ā€œlast_unlock_userā€ information is available in HA.
When using the mqtt integration that information is not immediate available, which makes me wonder how i can gain access to that info as well.

Of course, i could just use the Nuki web api but it takes up to 30 seconds for any lock actions to update in HA, whereas the lock actions updates immediately when using mqttā€¦

I am grateful to anyone who can point me in the direction of how to get ā€œlast_unlock_userā€ information via mqtt.

/Bo

No problem - this is how I did it:
So first of all, you need to create a separate PIN and Fingerprint if needed for each single person to be able to distinguish.
(at first I had one PIN and all users / fingerprints under the same PIN).

Then I created an entry for the topic reporting the user (in my case an extra mqtt.yaml)

- text:
    command_topic: "nuki/pups" # required but not used AFAIK
    state_topic: "nuki/YOUR_LOCK_ID/lockActionEvent"
    name: "Letzter HaustĆ¼rschloss Benutzer (MQTT roh)"
    icon: mdi:raw
    unique_id: text_letzter_hausturschloss_benutzer_mqtt_roh

Finally I check the text entity for its content:

alias: "Sicherheit: Letzter HaustĆ¼r Benutzer (AufschlieƟer)"
description: ""
trigger:
  - platform: state
    entity_id:
      - text.letzter_hausturschloss_benutzer_mqtt_roh
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: text.letzter_hausturschloss_benutzer_mqtt_roh
        state: unavailable
action:
  - choose:
      - conditions:
          - condition: template
            value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[2]|int == 122136 }} "
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[3]|int == 8193 }} "
                sequence:
                  - service: input_select.select_option
                    target:
                      entity_id: input_select.letzter_schloss_benutzer
                    data:
                      option: Homer (Finger)
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[3]|int == 8194 }} "
                sequence:
                  - service: input_select.select_option
                    target:
                      entity_id: input_select.letzter_schloss_benutzer
                    data:
                      option: Marge (Finger)
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[3]|int == 8195 }} "
                sequence:
                  - service: input_select.select_option
                    target:
                      entity_id: input_select.letzter_schloss_benutzer
                    data:
                      option: Maggie (Finger)
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[3]|int == 8192 }} "
                sequence:
                  - service: input_select.select_option
                    target:
                      entity_id: input_select.letzter_schloss_benutzer
                    data:
                      option: Lisa (Finger)
      - conditions:
          - condition: template
            value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[1]|int == 172 }} "
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[0]|int == 2 }} "
                sequence:
                  - service: input_select.select_option
                    target:
                      entity_id: input_select.letzter_schloss_benutzer
                    data:
                      option: MQTT (zu)
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[0]|int == 1 }} "
                sequence:
                  - service: input_select.select_option
                    target:
                      entity_id: input_select.letzter_schloss_benutzer
                    data:
                      option: MQTT (auf)
      - conditions:
          - condition: template
            value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[2]|int == 197120 }} "
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[0]|int == 2 }} "
                sequence:
                  - service: input_select.select_option
                    target:
                      entity_id: input_select.letzter_schloss_benutzer
                    data:
                      option: Homer App (zu)
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[0]|int == 1 }} "
                sequence:
                  - service: input_select.select_option
                    target:
                      entity_id: input_select.letzter_schloss_benutzer
                    data:
                      option: Homer App (auf)
      - conditions:
          - condition: template
            value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[1]|int == 2 }} "
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[4]|int == 1 }} "
                sequence:
                  - choose:
                      - conditions:
                          - condition: template
                            value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[0]|int == 2 }} "
                        sequence:
                          - service: input_select.select_option
                            target:
                              entity_id: input_select.letzter_schloss_benutzer
                            data:
                              option: Knopf (zu)
                      - conditions:
                          - condition: template
                            value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[0]|int == 1 }} "
                        sequence:
                          - service: input_select.select_option
                            target:
                              entity_id: input_select.letzter_schloss_benutzer
                            data:
                              option: Knopf (auf)
      - conditions:
          - condition: template
            value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[1]|int == 1 }} "
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[0]|int == 2 }} "
                sequence:
                  - service: input_select.select_option
                    target:
                      entity_id: input_select.letzter_schloss_benutzer
                    data:
                      option: Manuell (zu)
              - conditions:
                  - condition: template
                    value_template: " {{ states(\"text.letzter_hausturschloss_benutzer_mqtt_roh\").split(\",\")[0]|int == 1 }} "
                sequence:
                  - service: input_select.select_option
                    target:
                      entity_id: input_select.letzter_schloss_benutzer
                    data:
                      option: Manuell (auf)
    default:
      - service: telegram_bot.send_message
        metadata: {}
        data:
          message: UNBEKANNTE HaustĆ¼r AktivitƤt!
          title: Sicherheit
  - service: logbook.log
    metadata: {}
    data:
      name: sensor.letzter_hausturschloss_benutzer
      message: Last door lock user changed to {{trigger.to_state.state}}
      entity_id: sensor.letzter_hausturschloss_benutzer
    enabled: false
mode: single

Hello, is anyone else having the issue described on Nuki Smart Lock Pro 4.0 suddenly cannot connect Ā· Issue #118715 Ā· home-assistant/core Ā· GitHub since the latest home assist core release?

1 Like

I have just got a nuki 4 pro and am trying to setup with mqtt over WiFi. The nuki app is working over WiFi. Mosquito setup in ha is working as I have z2m with several devices all working.

Every time I try to set up mqtt in the nuki app I get the following error:

MQTT activation failed MQTT connection can not be established as the hostname was not resolvable. Please check your configuration. Error code: 8D

Am I supposed to enter the username and password for my ha account or for the mqtt user? Could someone please check I am entering the correct details.

For host name I have tried the following formats with the IP of my ha server.
http://192.168.xx.xxx
http://192.168.xx.xxx:8123
http://192.168.xx.xxx:1883

User and password I have tried the one that I use to log in to ha and also the mqtt user and password. Cant get it working at all. Would appreciate some help.

The hostname shouldnā€™t have http:// before it, or a port, so just 192.168.x.y

1 Like

Thank you!
Finally working now

Armaturenbrett?

Iā€™ve been looking at the Nuki Ultion for a while but canā€™t decide which version to get.

I wanted the Ultion version, but it seems the Nuki Ultion only comes with the Nuki 3.0.

Iā€™d prefer the Nuki 4 as I think my zigbee network is currently stronger than my wifi network by my front door. Also battery life benefits.

Can anyone help recommend which device would be best? Nuki 4 (non pro) looks good. Will that work in my set up?

My set up has everything running on docker containers on my home server:

  • HA container
  • Mosquitto MQTT container
  • Zigbee2MQTT container which has the SkyConnect

Iā€™m still not even sure I can do Matter/Thread with my SkyConnect. Everywhere I read it says ā€œcoming in the futureā€ and not sure if itā€™ll work as the SkyConnect is passed through to the Z2M container, not the HA container. I could always buy a separate Sonoff dongle for Zigbee if needed.

Help! Iā€™m very confused.

Hi Gary,
I have the Ultion Nuki, I was under the impression it is Nuki 4th Gen device - I have the Pro version that support Matter, out of the box.
I have it connected via Matter, and not Wi-fi but couldnā€™t get it to work with my SOnoff dongle. It is connected via an Apple HomePod mini that I have, which in turn is connected to HA, I can see the Nuki lock as a Matter device, but I use the MQTT off the lock as the Matter device is only showing as 1 device, 2 entities

Where did you buy it to get Nuki Ultion with a Nuki 4? EDIT: Oh I see on the Ultion Nuki page it says:

Includes Nuki 3.0 (Matter compatible 4.0 with Ultion Nuki PLUS)

So looks like you get Nuki 4 Pro with Ultion Nuki Plus. But Nuki 3 with Ultion Nuki. I just want the Nuki 4 non pro, which is annoying.

What containers/services do you need to run to get a nuki 4 to communicate with HA via matter?

Hi I recently bought a ultion lock with nuki. I had the pro version and at the time, didnā€™t say online that it was a v4, but when I spoke to the customer services, they said they were all v4. Id ring their customer service they were very helpful and i think you can ask for the one you want.

Personally id go pro for the extra features and 1 less hub and built in wifi. Battery pack is easier too.

Im using mqtt to control mine as im waiting for a skyconnect

Iā€™m just using the OpenThread Border Router add-on, Matter and Tread integrations.

I know that HA is talking via Matter, as I havenā€™t enabled the wi-fi in the Lock, and I can see the lock in the Matter integration. I use a Apple Home Pod mini as well, this is visible in HA. Im using the default MQTT integration in the lock, rather than the ESP32 one (which I had running)

From the sounds of it I donā€™t need the Nuki 4 Pro to get it working with Home Assistant. However I have bought the Nuki Ultion Plus (which includes 4 pro) anyway.

I figured I canā€™t be bothered to mess around with the possibility that it might not work in the way I want it to, and WiFi will be the easy fallback. Especially since I just spent an entire morning trying to fix my broken Zigbee network. sigh

Thanks for your help.

Hi everyone,

I would like to come back to my issue (disconnect on mqtt) in post# 47:

Every now and then the Nuki Pro gets offline and I donā€™t know why.
I also have one in my garden shed which recovers automatically, but on the front door itā€™s different even though the Wifi should be more stable.

When this happend I tried to restart mqtt, update the lock entity, but nothing helps.
The only thing I can do is to go the the NUKI app ā†’ Settings ā†’ SmartHome ā†’ mqtt, go in there and save without changing something.
This seems to re-establish the connection to HA right away.

Does anyone have a suggestion how to solve this in HA automatically?
Any suggestion would be greatly appreciated.

If HA Canā€™t communicate, HA cant fix it either. Have you compared lock firmware versions and settings? Maybe some power save function lowers communication and Matter marks it unavailable on account of no communication for some time?