Nuki Bridge: callback data - enrich the json response with more data about the system

Product name

Nuki Bridge

Summary

I successfully integrated Nuki with Home Assistant, it works fine, callback included. The official integration lacked the callback, so there was a huge delay for lock/door events, solved introducing the callback. Here’s the Home Assistant card with all the sensors:

Unfortunately, since I also wanted to know the status of the system, I also implemented /list and /info commands via a REST sensor (http GET) and I started facing the well-known communication problems (http 503) due to the fact that the bridge accepts only 1 call at a time. So I introduced serialization, and things are way better than before.

The problem though is that also if you serialize, when the bridge is busy with the lock via BT/BLE (I see several entries in the bridge log), http calls are not honored, even when serialized.

Now, since the callback mechanism is way more efficient, would it be possible to implement a callback for all the info provided in list/info commands? That way we’d have no need to query the lock, we would only rely on the bridge calling and passing info about events or periodic updates of the system status.

It would greatly simplify the integration and automation of the Nuki, making it more efficient.

Features

  • Add to the json data response of the callback, all the json data of the /list and /info commands.
  • Configure a time frequency for an unsolicited callback to trigger, even in absence of a trigger event

Reason

Because the http GET mechanism, with the bridge limitation of 1 call at a time with no queue can make integrating the Nuki much more difficult than it should be. Devs/integrators could avoid introducing serialization and only listen for events, not having to query the bridge anymore. Less errors, much more efficiency due to the elimination of polling.

Examples

For any kind of home automation or integration.