Björns Welt
15. Februar 2025

Nuki SmartLock 4.0 Pro & openHAB

Gepostet am 15. Februar 2025  •  2 Minuten  • 410 Wörter
Table of contents

Ich habe mir ein Nuki SmartLock 4.0 Pro zugelegt, welches natürlich auch direkt in openHAB eingebunden werden soll. Das SmartLock kann direkt und ohne Bridge in das heimische WLAN integriert werden. Die Anbindung erfolgt per MQTT.

Dokumentiert hat Nuki die MQTT-API hier . Die Topics lassen sich nicht konfigurieren und bei der Verschlüsselung setzt Nuki voll und ganz auf die WLAN-Verschlüsselung.

Einrichtung MQTT

Dokumentiert hat Nuki die MQTT-API hier . Die Topics lassen sich nicht konfigurieren und bei der Verschlüsselung setzt Nuki voll und ganz auf die WLAN-Verschlüsselung.

Einbindung in openHAB

Auch hier setze ich auf die Konfiguration per Textdateien. Erforderlich ist lediglich das MQTT-Binding . einen Grßteil der Konfiguration konnte ich aus dem Community-Post übernehmen/adaptieren.

nuki.things

// Nuki Smart-Lock
Thing topic smartLock "Haustür" {
    Channels:
	    Type switch   : online "Online" [ stateTopic="nuki/<nuki-id>/connected", on="true", off="false" ]
    	Type number   : devicetype "devicetype" [ stateTopic = "nuki/<nuki-id>/deviceType" ]
	    Type string   : name "Name" [ stateTopic="nuki/<nuki-id>/name" ]
	    Type number   : state "state" [ stateTopic = "nuki/<nuki-id>/state" ]
    	Type number   : mode "mode" [ stateTopic = "nuki/<nuki-id>/mode" ]
    	Type switch   : battcritic "battcritic" [ stateTopic="nuki/<nuki-id>/batteryCritical", on="true", off="false" ]
	    Type number   : battcharge "battcharge" [ stateTopic = "nuki/<nuki-id>/batteryChargeState" ]
    	Type switch   : battcharging "battcharging" [ stateTopic="nuki/<nuki-id>/batteryCharging", on="true", off="false" ]
	    Type datetime : lastseen "lastseen" [ stateTopic="nuki/<nuki-id>/timestamp" ]
    	Type string   : lockaction "lockaction" [ commandTopic="nuki/<nuki-id>/lockAction" ]
	    Type string   : firmware "firmware" [ stateTopic="nuki/<nuki-id>/firmware" ]
    	Type string   : actionevent "actionevent" [ stateTopic="nuki/<nuki-id>/lockActionEvent" ]
	    Type number   : doorsensor "doorsensor" [ stateTopic = "nuki/<nuki-id>/doorsensorState" ]

        // Simple Lock Actions
        Type switch   : lock "lock" [ commandTopic="nuki/<nuki-id>/lock", on="true", off="false" ]
    	Type switch   : unlock "unlock" [ commandTopic="nuki/<nuki-id>/unlock", on="true", off="false" ]
}

nuki.items

Group    SmartLock                 "Haustür"
Switch   SmartLock_connected       "connected"         (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:online" }       
Number   SmartLock_devicetype      "devicetype"        (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:devicetype" }      
String   SmartLock_name            "Name"              (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:name" }            
Number   SmartLock_state           "state"             (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:state", stateDescription=" "[options="0=nicht kalibriert,1=Verriegelt,2=schließt auf,3=Entriegelt,4=schließt ab,5=Offen,6=lock'n'go,7=kann geöffnet werden,254=Motor blockiert,255=Undefiniert"]}
Number   SmartLock_mode            "Mode"              (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:mode" }            
Switch   SmartLock_battcritic      "battcritic"        (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:battcritic" }      
Number   SmartLock_battcharge      "Akku [%d %%]"      (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:battcharge" }      
Switch   SmartLock_battcharging    "Akku wird geladen" (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:battcharging" }    
DateTime SmartLock_lastseen        "Zuletzt gesehen"   (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:lastseen" }        
Switch   SmartLock_lock            "Verriegeln"        (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:lock" }            
Switch   SmartLock_unlock          "Entriegeln"        (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:unlock" }          
String   SmartLock_lockaction      "Aktion"            (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:lockaction", stateDescription=" "[options="1=aufschließen,2=abschließen,3=öffnen,4=lock'n'go,5=lock'n'go mit öffnen,6=2x abschließen,NULL=unbekannt"]}      
String   SmartLock_firmware        "Firmware"          (SmartLock) ["Point"]  { channel="mqtt:topic:secureBroker:smartLock:firmware" }        

UI-Widget

- component: oh-label-card
  config:
    action: options
    actionItem: SmartLock_lockaction
    item: SmartLock_state
    title: Haustür

widget

options

Bildnachweis Banner

Follow me