Accessing your Nuki bridge from the command-line - nukibridgectl

Hello everbody,

I just completed nukibridgectl, a command-line application which makes accessing the Nuki Bridge API a breeze. It wrote it primarily for my personal fun and use but maybe it’s useful for you, too.

It is written in Go and runs on Linux, Windows and Mac OS - although I only tested it on Mac OS yet. Feedback is highly appreciated.

Best regards
Christian Schmizz

4 Likes

Hello,

Nice, I’ll have a try.
Why did not you put a link here?

1 Like

Sorry for the missing link. :upside_down_face:

The latest release can be found on GitHub

Cheers
Christian

2 Likes

Hi Christian,
I find this awesome, just what I’ve been looking for for my Nukis. I just tried the Windows command line version of nukibridgectl and found that while the basic commands like bridge discover and bridge list work smoothly at first try, I’m having trouble finding the exact syntax for unlocking a lock (for example), generally accessing specific devices.
I tried something like nukibridgectl bridge unlock <0> <12345678> and it gave me a syntax error concerning the “<” sign.
I’d be grateful if you could give me a hint concerning the syntax in the Windows version and maybe a few more examples of actual commands.
Thank you very much for your effort!
Alex

Hi Alex,
than you for your feedback.

You just have to leave off the “<” signs. They are just placeholders for obligatory parameters when using nukibridgectl. Square brackets signalise optional parameters. I’ll add some more examples to the documentation.

The call should look like this:

 nukibridgectl bridge unlock 0 12345678

Another way of locking/unlocking is via the more elaborate lockAction. Available lockAction actions can be found at https://developer.nuki.io/page/nuki-bridge-http-api-1-12/4#heading--lock-actions

# Locking
nukibridgectl bridge lockAction 0 12345678 lock

# Unlocking
nukibridgectl bridge lockAction 0 12345678 unlock

Best regards
Christian

Hi Christian,
this is getting very interesting. Unlocking, unlatching etc. works just fine the way you described.
I tried the list command and found that here I get results that are different from the JSON list that I get when using the list command via URL in a browser. Is there any way to get the additional info (like the ringactionTimestamp from a specific device which I’m planning to use) with your nukibridgectl tool? Would be very convenient, and besides I found that your nukibridgectl seems to be much more reliable than my direct access via URL (don’t know why).
Thank you and cheers,
Alex

Hi Alex,
I added a flag for showing the last known state of the devices when listing:

$ nukibridgectl bridge list --show-last-known-state

Please update to latest v1.0.11 for this to work.

Cheers
Christian

1 Like