{"id":37787133,"url":"https://github.com/christianschmizz/go-nukibridgeapi","last_synced_at":"2026-01-16T15:13:25.535Z","repository":{"id":44584838,"uuid":"307460522","full_name":"christianschmizz/go-nukibridgeapi","owner":"christianschmizz","description":"Makes Nuki's Bridge API accessible from the command-line. ","archived":false,"fork":false,"pushed_at":"2022-08-20T16:50:54.000Z","size":178,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2024-06-20T22:37:27.868Z","etag":null,"topics":["bridge","nuki","nuki-bridge-api","nuki-opener","nuki-smartlock","opener","smartlock"],"latest_commit_sha":null,"homepage":"","language":"Go","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/christianschmizz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-26T17:58:25.000Z","updated_at":"2023-11-27T06:44:49.000Z","dependencies_parsed_at":"2022-08-12T11:20:42.889Z","dependency_job_id":null,"html_url":"https://github.com/christianschmizz/go-nukibridgeapi","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/christianschmizz/go-nukibridgeapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianschmizz%2Fgo-nukibridgeapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianschmizz%2Fgo-nukibridgeapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianschmizz%2Fgo-nukibridgeapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianschmizz%2Fgo-nukibridgeapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christianschmizz","download_url":"https://codeload.github.com/christianschmizz/go-nukibridgeapi/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianschmizz%2Fgo-nukibridgeapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bridge","nuki","nuki-bridge-api","nuki-opener","nuki-smartlock","opener","smartlock"],"created_at":"2026-01-16T15:13:24.949Z","updated_at":"2026-01-16T15:13:25.505Z","avatar_url":"https://github.com/christianschmizz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-nukibridgeapi\n\nThis project aims to make Nuki's Bridge API accessible. Either through the \nprovided library or as a program from the command-line.\n\nThe [Nuki Bridge](https://nuki.io/en/bridge/) acts as gateway between your [Nuki \nSmartlock](https://nuki.io/en/smart-lock/) and your Wifi network, which enables \nyou to access your Nuki devices remotely.\n\n![Develop](https://github.com/christianschmizz/go-nukibridgeapi/workflows/Build/badge.svg?branch=develop)\n\nTherefore it is introducing a command-line tool called `nukibridgectl` which \nimplements access to the basic functions of your Nuki bridge for now.\n\n:warning: **Encrypted token support**: There is currently no automatic detection for \nsupport of encrypted tokens. Users of the library have to make use of the `UseEncryptedToken` \noption to enable the use of encrypted tokens. Therefor **the CLI tool only supports hashed tokens**.\n\n# Activate the Bridge API\n\nBefore you can access the bridge's API you have to activate it. *It's not active\nby default.*\n\n## Check API status\n\nIf you are unsure about whether the bridge's API is already activated or not \nyou can check with curl:\n\n    $ curl http://\u003cbridge-address\u003e\n    \nIt will come up with `HTTP 400 Bad Request` when active. Otherwise you'll see \nsomething like `Connection refused`. \n\n## Activate the API\n\nTo activate the bridge API you have to bring you bridge into maintenance mode \ngo to \"Manage Bridge\" in the Nuki app. During the Bridge's setup procedure you \ncan configure the settings of your Wi-Fi as well as the developer mode. To use \nthe API you have to *enable the developer mode*.\n\nThe token you need for accessing the API is shown only once when activating \nthe developer mode. So, make a note of it.\n\n# Discover bridges\n\nNote: The discovery of bridges does not require a valid token.\n\nFor discovering bridges you need a working internet-connection, and you have to \nexecute `nukibridgectl` from the LAN the bridge is in. Afterwards the `discover`\ncommand should report your bridge.\n\n    $ nukibridgectl discover\n    ID        IP             Port Updated\n    123456789 192.168.178.1  8080 2020-10-01 20:00:00 +0000 UTC\n\n# Help\n\nTo get a quick overview of the capabilities `nukibridgectl` offers I recommend\nhaving a look at the help:\n\n    $ nukibridgectl --help\n\nWhich might look like this:\n\n    Work seamlessly with your Nuki Bridge from the command line.\n    \n    Usage:\n      nukibridgectl \u003ccommand\u003e \u003csubcommand\u003e [flags]\n      nukibridgectl [command]\n    \n    Available Commands:\n      bridge      Bridge commands\n      discover    Discover bridges\n      help        Help about any command\n    \n    Flags:\n          --config string   config file (default is $HOME/.nukibridgectl.yaml)\n      -h, --help            help for nukibridgectl\n    \n    Use \"nukibridgectl [command] --help\" for more information about a command.\n\n# Configuration\n\n## Config file\n\nFor ease of use I would recommend the use of a settings-file named \n`.nukibridgectl.yaml` in one of the subsequent locations:\n\n- `/etc/nukibridgectl/`\n- Your home directory\n- Working dir\n\nThe file should look like this:\n\n    host: \"192.168.178.1:8080\"\n    token: abcde6\n\nTo use a custom name or location for your configuration file:\n\n    $ nukibridgectl --config /my/config/feelfree.yaml ...\n\n## Params\n\nIf you want to pass on your configuration at the command-line you can do so, too:\n\n    $ nukibridgectl bridge --host 192.168.178.1:8080 --token abcde6 \u003ccommand\u003e\n\n# Examples\n\n## List devices\n\nAfter you set up your configuration you can query the bridge for available devices: \n\n    $ nukibridgectl bridge list\n    Type ID        Name        Battery Firmware Version\n    0    123456789 Wohnungstür 68%     2.9.10\n    2    123456789 Haustür     0%      1.6.4\n\nA type of 0 means a Smartlock, a type of 2 an Opener.\n\n## Simple Locking / Unlocking of a Nuki Smartlock\n\nTo just lock/unlock a smart lock (type: 0) you type:\n\n    $ nukibridgectl bridge lock 0 \u003cdeviceID\u003e\n    $ nukibridgectl bridge unlock 0 \u003cdeviceID\u003e\n\n## Applying more elaborate lock actions\n\nSee [nuki Bridge's API docs on lock action](https://developer.nuki.io/page/nuki-bridge-http-api-1-12/4#heading--lock-actions) for \na list of available actions and their purpose. \n\n    # Execute actions at a smart lock (type: 0) via lockAction\n    $ nukibridgectl bridge lockAction 0 \u003cdeviceID\u003e \u003clock|unlock|unlatch|lockandgo|lockandgowithunlatch\u003e\n\n    # Execute actions at an opener (type: 2) via lockAction\n    $ nukibridgectl bridge lockAction 2 \u003cdeviceID\u003e \u003crto_on|rto_off|esa|cm_on|cm_off\u003e\n\n## Query the state\n\nSee [nuki Bridge's API docs on lock states](https://developer.nuki.io/page/nuki-bridge-http-api-1-12/4#heading--lock-states) for \nfurther details on the available information.\n\nShort reminder from the Nuki docs:\n\n\u003e Warning: /lockstate gets the current state directly from the device and so should not be used for constant polling to avoid draining the batteries too fast. /list can be used to get regular updates on the state, as is it cached on the bridge.\n\n    $ ./nukibridgectl bridge lockState 2 123456789\n\n# Tests\n\n## Integration tests\n\nTo run the tests on a physical bridge at your LAN:\n\n    % make integration-test BRIDGE_HOST=\u003cip:port\u003e BRIDGE_TOKEN=\u003ctoken\u003e\n\n# Debugging things\n\nYou noticed some unexpected behaviour or just want to know whats going on\nbehind the scenes? You can enable debug logging by setting DEBUG at your env.\n\n    $ DEBUG=1 nukibridgectl bridge --host 192.168.178.1:8080 --token abcde6 info\n\n# DBus Bridge\n\n`nukibridgectl` can also forward all events of your Nuki bridge to a DBus \ninstance. This is useful if you want to open up your Nuki events to a broader \naudience, e.g. 3rd party applications.\n\nTherefor `nukibridgectl` will launch a local webserver and registers itself for\ncallbacks.\n\n## Fire up a local DBus instance for testing\n\n    $ MY_SESSION_BUS_SOCKET=/tmp/dbus/$USER.session.usock\n    $ dbus-daemon --session --nofork --address unix:path=$MY_SESSION_BUS_SOCKET\n\n## Run nukibridgectl\n\n    $ DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus/$USER.session.usock DEBUG=1 go run cmd/nukibridgectl/main.go bridge watch en0\n\n    2020-11-21T15:43:58+01:00 DBG   bridge.CallbackData{\n            ... // 5 identical fields\n            BatteryCritical:       false,\n            KeypadBatteryCritical: false,\n    -       DoorsensorState:       3,\n    +       DoorsensorState:       2,\n    -       DoorsensorStateName:   \"door opened\",\n    +       DoorsensorStateName:   \"door closed\",\n            RingactionTimestamp:   s\"0001-01-01 00:00:00 +0000 UTC\",\n            RingactionState:       false,\n      }\n    \n    2020-11-21T15:44:04+01:00 DBG   bridge.CallbackData{\n            ... // 5 identical fields\n            BatteryCritical:       false,\n            KeypadBatteryCritical: false,\n    -       DoorsensorState:       2,\n    +       DoorsensorState:       3,\n    -       DoorsensorStateName:   \"door closed\",\n    +       DoorsensorStateName:   \"door opened\",\n            RingactionTimestamp:   s\"0001-01-01 00:00:00 +0000 UTC\",\n            RingactionState:       false,\n      }\n\n## Monitoring\n\n    $ dbus-monitor --address unix:path=/tmp/$USER.session.usock\n    \n    signal time=1605969838.072019 sender=:1.0 -\u003e destination=(null destination) serial=7 path=/nuki/bridge; interface=nuki.bridge; member=Event\n       struct {\n          int32 597123456\n          int32 0\n          int32 2\n          int32 3\n          string \"unlocked\"\n          boolean false\n          boolean false\n          int32 3\n          string \"door opened\"\n          boolean false\n       }\n    \n    signal time=1605969844.810805 sender=:1.0 -\u003e destination=(null destination) serial=8 path=/nuki/bridge; interface=nuki.bridge; member=Event\n       struct {\n          int32 597123456\n          int32 0\n          int32 2\n          int32 3\n          string \"unlocked\"\n          boolean false\n          boolean false\n          int32 2\n          string \"door closed\"\n          boolean false\n       }\n    \n    \n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianschmizz%2Fgo-nukibridgeapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristianschmizz%2Fgo-nukibridgeapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianschmizz%2Fgo-nukibridgeapi/lists"}