#nuki #smart-home #smartlock

nuki-rs

a rust implmentation for BLE API for Nuki Smart Lock

6 releases

0.2.3 Jan 4, 2024
0.2.2 Jan 3, 2024
0.1.1 Jan 2, 2024

#693 in Hardware support

MIT license

45KB
963 lines

nuki-rs

Crates.io Version docs.rs Crates.io License Crates.io Total Downloads

Bluetooth API for Nuki Smartlock

Usage

Pair

let mut nuki = NukiSmartLock::discover_pairable().await.unwrap();
nuki.pair("TestUser").await.unwrap();

// Save the credentials to file.
// The file contains the MAC adresse and the private key. 
nuki.save(&String::from("nuki-credentials.json")).unwrap();

Perform actions

The following actions can be performed: Perform one of the following actions:

  • Unlock,
  • Lock,
  • Unlatch,
  • LockAndGo,
  • LockAnGoUnlatch,
  • FullLock,
  • FobAction1,
  • FobAction2,
  • FobAction3
// Perfom unlock
use nuki_command::LockAction;

let nuki = NukiSmartLock::load(&String::from("nuki-credentials.json")).unwrap();
nuki.perform_lock_action(LockAction::Unlock, "TestUser").unwrap();

Example

see /example.

Dependencies

~26–60MB
~690K SLoC