Protocol from Nuki per Webhook to Homey?

After a long search and discussions on the Nuki Developer Forum, I found a solution to use Nuki’s API in Homey:

  1. Turn on Nuki Web in the Nuki app

  2. Register/log in to Nuki Web: https://web.nuki.io/

  3. Install the “Webhook” app for Homey: Webhooks App für Homey | Homey. ​​You need this because I was unable to add one or more tags to the webhook sent by Nuki. So you get exactly one webhook, no matter what the lock does. This app can read the information in the webhook. This is not possible with the system’s own trigger “Logic → Webhook received with tag” (or I don’t check it).

  4. In the app under Settings, copy the webhook URL and think of an event name and add this to the URL

  5. On Nuki Web, under the menu item “API”, apply for an Advanced API. Copy the webhook URL from step 4 here. I specified “Smart Home” as the reason and the relevant website of the discussion in the Nuki forum (Help for Webhooks to Homey - #6 by poonam.chavan - Questions - Nuki Developers) as the homepage. Don’t be put off by the fact that this is actually intended for companies. It also works for end users.

  6. After Nuki has set up the API (took 2 days), go to the “Nuki Advanced API Integration” tab on Nuki Web, which is now visible. Here you can adjust the webhook URL to Homey again if necessary and select which information you want from Nuki. “Device Logs” was enough for me.

  7. You can test this right away. Close/Open Nuki and see if the webhook is sent successfully.

  8. Go back to Homey and build a flow with the “Webhook” app (If). Now the webhook from Nuki Web arrives at Homey.

  9. To trigger specific reactions, the webhook must be read. This consists of JSON. So you need another app that can read the information in the JSON. This is “Json Handler”: JSON Handler App für Homey | Homey

  10. Unfortunately, I haven’t found any documentation on Nuki that tells you which action is acknowledged with which variable. To find out, simply read the sent webhooks on Nuki Web. “Name”, “action”, “source” and “state” seem particularly interesting. I can’t program JSON at all and just searched forums and tried things out. Since each variable only occurs once, “$…name” is sufficient. Flows can then be built from this, see screenshot:

3 Likes