Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

Archived, no longer maintained because MQTT is now publicly available on smart lock 3.0 pro. Python Script creating HA auto-discovery topics for you Nuki Lock 3 Pro with MQTT enabled (Beta Firmware

License

Nardol/Nuki-MQTT-auto.-Discovery

 
 

Repository files navigation

Nuki MQTT auto. Discovery

This repository is no longer maintained and has been archived. MQTT final has reehashed its final phase and is available in latest stable Firmware for Nuki smart lock 3.0 pro.

Warning: The implementation in the stable Nuki firmware is not the same as the last one of this repository, instead Nuki use the version 2.0.0 which is also archived in the current branch.

This repository is a fork of MattDog06/Nuki-MQTT-auto.-Discovery

hass_badge hacs_badge Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Python script for creating Home Assistant MQTT auto. discovery topics for a Nuki Smart Lock 3.0 Pro with enabled MQTT client. (currently only available in the beta firmware) Execute this script once to create a MQTT device with all necessary entities.

Usage

Just copy the URL of this repository and add it under HACS --> Custom Repositories (Category: Python-Script)

Parameters

Parameter Type Required Description Example
device_id string Yes The device ID also known as Nuki Smart Lock ID. 12345ABC
device_name string Yes The device name Front Door Lock
device_model string Yes The device model Smart Lock 3.0 Pro
discovery_topic string No The home assistant auto. discovery topic (Default: homeassistant) homeassistant
door_sensor_available boolean No If true, the door sensor data is also discovered (Default: false) true
keypad_available boolean No If true, the keypad data is also discovered (Default: false) false
remove_lock boolean No If true, all MQTT Nuki related topics are removed (Default: false) false

Example

service: python_script.nuki_mqtt_discovery
data:
  device_id: 12345ABC
  device_name: Front Door Lock
  device_model: Smart Lock 3.0 Pro
  discovery_topic: homeassistant
  door_sensor_available: true
  keypad_available: false

Home Assistant Device

Sample

Differences with original script

  • The smartlock ID is used for entity unique IDs instead of the name which could be changed Using this method, if the smartlock is renamed in the Nuki app, the existing entities will be updated instead of create new entities
  • Node ID is not used anymore for MQTT topics
  • MQTT abbreviations are used
  • Locking, unlocking and jammed states are implemented. This change should be visible from Home Assistant 2023.2
  • Open and opening states are removed, these don't exist in Home Assistant for lock entities
  • Apply conventional namming for entities, for example the door sensor of the smartlock Front door will be named Front door Door sensor instead of Front door Door Sensor
  • In the root of this repository, there is now a script to remove original device and entities. It uses the same parameters you used to add the smartlock entities, nuki_remove_old has to be used instead of nuki_mqtt_discovery when calling the service, you must place the nuki_remove_old.py to the python_script subdirectory of your Home Assistant configuration directory

About

Archived, no longer maintained because MQTT is now publicly available on smart lock 3.0 pro. Python Script creating HA auto-discovery topics for you Nuki Lock 3 Pro with MQTT enabled (Beta Firmware

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Python 100.0%