{"id":15747350,"url":"https://github.com/henry-spanka/nubli","last_synced_at":"2025-05-13T01:02:39.571Z","repository":{"id":88742310,"uuid":"169305544","full_name":"henry-spanka/nubli","owner":"henry-spanka","description":"Nubli is a Node.JS library for Nuki Smart Locks","archived":false,"fork":false,"pushed_at":"2020-09-01T09:59:45.000Z","size":109,"stargazers_count":15,"open_issues_count":5,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T05:30:48.317Z","etag":null,"topics":["bluetooth","library","node","nuki","smart-lock","smarthome","smartlock"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/henry-spanka.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-05T20:12:10.000Z","updated_at":"2023-05-13T13:53:41.000Z","dependencies_parsed_at":"2023-05-23T00:00:37.039Z","dependency_job_id":null,"html_url":"https://github.com/henry-spanka/nubli","commit_stats":{"total_commits":66,"total_committers":1,"mean_commits":66.0,"dds":0.0,"last_synced_commit":"48e6fcb759bed523fbdf0d71b4f1f3befe0c8ad6"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry-spanka%2Fnubli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry-spanka%2Fnubli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry-spanka%2Fnubli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henry-spanka%2Fnubli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/henry-spanka","download_url":"https://codeload.github.com/henry-spanka/nubli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253850874,"owners_count":21973672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bluetooth","library","node","nuki","smart-lock","smarthome","smartlock"],"created_at":"2024-10-04T05:05:08.367Z","updated_at":"2025-05-13T01:02:39.499Z","avatar_url":"https://github.com/henry-spanka.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nubli\n\nNubli is a Node.JS library for Nuki Smart Locks (**Nu**ki **B**luetooth **Li**brary)\nNubli is very energy efficient when used properly and should't drain more power than a Nuki bridge. It uses the same protocol the App and Bridge uses and therefore communicates securely with the Smart Lock.\n\n[![NPM](https://nodei.co/npm/nubli.png?compact=true)](https://npmjs.org/package/nubli)\n\n# Features\n* Get Lock State of Nuki Smart Lock (including door sensor)\n* Unlock/Lock/Unlatch/LockNGo Door\n* Listen for Lock State and Door Sensor changes\n* Get Authorizations\n* Get Configuration\n* Get Advanced Configuration\n\n# Supported devices\n- Nuki Smart Lock v2\n- Nuki Smart Lock v1 (not yet 100% compatible - Please open an issue if something doesn't work)\n\n# Requirements\n- Linux-based Server (e.g. Raspberry Pi)\n- Bluetooth 4.x Dongle (Tested with $5 CSR Module)\n\n**Note**: Do not use the built-in Bluetooth in a Raspberry Pi. Due to bad hardware design it will not reliably connect to your Smart Lock and cause unexpected disconnects. I've been there and invested a whole week into fixing it.\n\n# Setup / Installation\n1. `npm install nubli --save`\n2. See [Examples](examples/) or [Usage](#usage)\n3. Star the repository ;)\n\n# Notes\n* You can only run one instance of this library simultaneously with one dongle. If want to integrate this library into multiple applications running at the same time on the same device, either pin the applications to different bluetooth dongles or communicate with a single instance of this library via a webserver/websocket/mqtt instead.\n\n# Usage\n```typescript\n    const nubli = require('nubli').default;\n\n    nubli.onReadyToScan()\n    .then(() =\u003e {\n        nubli.startScanning();\n    })\n    .catch((err) =\u003e {\n        console.log(err);\n    });\n```\n\n## Actions\n\n### Start Scanning for Nuki devices\n```typescript\n    nubli.startScanning(): void;\n```\n\n### Start Actively Scanning for Nuki devices (Required for pairing)\n```typescript\n    nubli.startActiveScanning(): void;\n```\n\n**Notes**:\n* Scanning requires the bluetooth device to be powered on. This may take a few milliseconds. Make sure to wait for the promise ```nubli.readyToScan()``` to resolve first.\n* Only use active scanning when you are trying to pair a new device. Active Scanning will drain your Smart Lock's battery very quickly. Passive Scanning only listens for advertisements from the Smart Lock and does not request additionaly information from the Smart Lock.\n\n### Stop Scanning for Nuki devices\n```typescript\n    nubli.stopScanning(): void;\n```\n\n### Connect to a Smart Lock\n```typescript\n    smartlock.connect(): Promise\u003cvoid\u003e;\n```\n\n### Disconnect from a Smart Lock\n```typescript\n    smartlock.disconnect(): Promise\u003cvoid\u003e;\n```\n\n### Check if a config for the Smart Lock already exists\n```typescript\n    smartlock.configExists(path?: string): boolean;\n```\n\n### Read Smart Lock config\n```typescript\n    smartlock.readConfig(path?: string): Promise\u003cvoid\u003e;\n```\n\n### Save Smart Lock config\n```typescript\n    smartlock.saveConfig(path?: string): Promise\u003cvoid\u003e;\n```\n\n### Pair with a Smart Lock\n```typescript\n    smartlock.pair(asBridge = true): Promise\u003cvoid\u003e;\n```\n\n**Note**: By default it will pair as bridge. If you do have a bridge, make sure to pass false as a parameter. The reason is, that when no bridge exists, Nuki will not push any state changes automatically via advertisements, so we set ourselves as a bridge instead.\n\n### Read lock state from Smart Lock\n```typescript\n    smartlock.readLockState(): Promise\u003cSmartLockResponse\u003e;\n```\n\n### Unlock door\n```typescript\n    smartlock.unlock(updateCallback?: (response: SmartLockResponse) =\u003e void): Promise\u003cSmartLockResponse\u003e;\n```\n\n### Lock door\n```typescript\n    smartlock.lock(updateCallback?: (response: SmartLockResponse) =\u003e void): Promise\u003cSmartLockResponse\u003e;\n```\n\n### Unlatch Door\n```typescript\n    smartlock.unlatch(updateCallback?: (response: SmartLockResponse) =\u003e void): Promise\u003cSmartLockResponse\u003e;\n```\n\n### Lock N Go Door\n```typescript\n    smartlock.lockNGo(updateCallback?: (response: SmartLockResponse) =\u003e void): Promise\u003cSmartLockResponse\u003e;\n```\n\n### Lock N Go Unlatch Door\n```typescript\n    smartlock.lockNGoUnlatch(updateCallback?: (response: SmartLockResponse) =\u003e void): Promise\u003cSmartLockResponse\u003e;\n```\n\n### Get Config from Smart Lock\n```typescript\n    smartlock.requestConfig(): Promise\u003cSmartLockResponse\u003e;\n```\n\n### Get Advanced Config from Smart Lock\n```typescript\n    smartlock.requestAdvancedConfig(): Promise\u003cSmartLockResponse\u003e;\n```\n\n## Properties\n\n### Check whether a Smart Lock is already paired\n```typescript\n    smartlock.paired: boolean;\n```\n## Events\n\n### Nubli Smart Lock Discovered Event\n```typescript\n    nubli.on('smartLockDiscovered', (smartlock: SmartLock) =\u003e void);\n```\n\n### Nubli started scanning\n```typescript\n    nubli.on('startedScanning', () =\u003e void);\n```\n\n### Nubli stopped scanning\n```typescript\n    nubli.on('stoppedScanning', () =\u003e void);\n```\n\n### Smart Lock Connected Event\n```typescript\n    smartlock.on('connected', () =\u003e void);\n```\n\n### Smart Lock Disconnected Event\n```typescript\n    smartlock.on('disconnected', () =\u003e void);\n```\n\n### Smart Lock Error Event\n```typescript\n    smartlock.on('error', (err: string) =\u003e void);\n```\n\n### Smart Lock Activity Log Changed Event\n```typescript\n    smartlock.on('activityLogChanged', () =\u003e void);\n```\n\n**Note**: The `activityLogChanged` event only works while scanning because the Smart Lock advertises activity log changes via bluetooth. To get notified when the door opens or closes (Door Sensor) make sure to enable 'Log door sensor status' in the Nuki app.\n\n# Help\nIf you have any questions or help please open an issue on the GitHub project page.\n\n# Contributing\nPull requests are always welcome. If you have an issue or feature request please open a GitHub issue.\n\n# License\nThe project is subject to the MIT license unless otherwise noted. A copy can be found in the root directory of the project [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenry-spanka%2Fnubli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenry-spanka%2Fnubli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenry-spanka%2Fnubli/lists"}