Bridge discovery & HTTP-API activation

This is part of the Nuki Bridge API documentation.

Calling the URL https://api.nuki.io/discover/bridges returns a JSON array with all bridges which
have been connected to the Nuki Servers through the same IP address than the one calling the URL
within the last 30 days. The array contains the local IP address, port, the ID of each bridge and the
date of the last change of the entry in the JSON array.

Example:

{
 "bridges": [
 {
 "bridgeId":2117604523,"ip":"192.168.1.50","port":8080,"dateUpdated":"2017-06-14T06:53:44Z"
 }
 ],
 "errorCode":0
}

Once a bridge has been discovered on the LAN the API can be activated and the API token retrieved
by calling the /auth command. The user has to confirm this request by pressing the button on the
bridge. For more details see the description of the /auth command.

If discovery is disabled via /configAuth or through the Nuki App, the IP is 0.0.0.0 and the port 0. In
this case the /auth command fails with HTTP error 403.

See also the HTTP-API overview:

unfortnunatly that does not work for me. There is no ip written:
{ā€œbridgesā€:[{ā€œbridgeIdā€:833645707,ā€œdateUpdatedā€:ā€œ2018-12-14T14:08:14Zā€}],ā€œerrorCodeā€:0}

and the answer to http://ip:8080 is:
{ā€œerrorā€:ā€œinvalid api tokenā€}

No idea what to do

Please try to restart Bridge.

You can also check the IP and the port via ā€œmanage Bridgeā€ from the App (where you most probably set up your Bridge and paired the Smart Lock) by clicking on the Bridge icon.

Restart already done without success. I know the IP. Thatā€™s not the problem. As showed the command http://192.168.0.189:8080 I only get the error message. I also tried another smartphone as bridge with the same result.

HTTP API ist activated and token is set and you still get this error when calling an endpoint?

Http API is activated. ā€œToken is setā€ means in the bridge app? Then yes. Is that to be done somewhere else?

Yes, I meant the token in the Bridge management.

Then you call an endpoint with e.g.
http://192.168.1.50:8080/list?token=123456

Which is working here for me. So I canā€™t reproduce your problem yet.
The error should only come, when you send a wrong token or no token at all.

I am using software bridge. I understood bridge management does not work.
In the bridge app I activated the option ā€œhttp APIā€ where I also found the local IP-address and an API token. Is this the token I should use? Or the API-token I created via web?
Sorry. I am a bit confused.

In addition:
The connection seems to work but I canā€™t reach the smart lock. Doesnā€™t make sense for me.

I deleted the smart lock in the software bridge and reconnected again. Now it seems to work. I get responces and it is also reachable from outside.

Thanks for helpā€¦

1 Like

Nice to hear it is working now! :slight_smile:

Hi there!

When Iā€™m trying to list all smart locks, I get an ā€˜HTTP 503 Unavailableā€™ response, although I already activated the API in the app bridge management (while using the api key for the http request, of course).

A restart of bridge doesnā€™t work either. I also tried Holgers approach, but I wasnā€™t lucky.

In the app the smart locks have a green connection to the bridge and Iā€™m able to performe lock/unlock etc.

Do you have an idea how to fix this?

Edit: Just found this new thread from today:

On the back of my bridge there is a Nuki-ID starting with the number 15. Is this the mentioned serial id of the new hardware revision? Iā€™m a bit confused, because you mentioned shipping next week, but I got my bridge today. Did I got an early bird? :smiley:

Yes. First units shipped already this week.

1 Like

Hello!

maybe my question fits the topic. I would like to operate my bridge only ā€œlocallyā€. That means the bridge should not connect to a Nuki server to register itself or my Nukis or to oush states or allow actions from the internet. Firmware updates are allowed of course.

I have the bridge for the REST API.

Do I have to configure that extra, or is that the standard?

1 Like

Iā€™d be also interested in an answer to that question.Is it possible to operate the bridge totally without a connection to any Nuki server? And bonus question: Can I still use the Nuki app when Iā€™m (e.g. via VPN) in the local WiFi of the Bridge?

Or maybe Iā€™ll formulate my question more exactly:

After issuing

curl -s "192.168.1.10:8080/configAuth?enable=0&token=TOKEN"

for Nuki itā€™s not possible to access the bridge - means itā€™s LAN only mode and uses the WiFi only for local connections and firmware updates. Right? @MatthiasK?

The Nuki Bridge in general works in an Wifi without connection to our server (except for it not getting firmware updates). We had some problems with new hardware revision bridges (FW 2.x) though, which should be solved with the current firmware (so please make sure to get it only for an update at least once; the bridge checks for updates 1 hour after a restart and then all subsequent 24 hours).

The Nuki App does never directly communicate with the bridge. The Bridge just ā€œbridgesā€ commands from the App to the Smart Lock (received via Nuki server) if the App is not in BLE range of the Smart Lock.

The local Bridge API on the other hand is independent from internet access, as it only works locally.

Hm, Iā€™d appreciate if one could somewhere find an architecture diagram when who talks to who. Iā€™d like to avoid that Nuki Bridge talks to your servers except for Firmware Updates.

When does the Nuki Bridge talk to your servers in which configurations? What happens when I do a VPN to my local network?

Sorry to ask these basic questions, but Iā€™ve never found sufficient answers on your site.

Hi!

Just a quick answer as I try to catch up after being back in the office :slight_smile:

The bridge will always try to push status updates of the lock to enable remote access. You canā€™t just restrict that to firmware updates. If you set it up in an local network without internet access you can still use it locally and could for example bring it only from time to time to force an firmware update via Bridge API call.

PM me for more details if needed.

Leider lƤsst sich nach Aktivierung der API und trotz Eingabe einer fixen IP-Adresse diese nicht halten. Die IP Ƥndert sich auf 0.0.0.0 und lƤsst sich auch nicht Ƥndern.