Add user to bridge HTTP API notifications

Hi everyone!

This feature would be very welcome!

I’m developing an integration/driver to use Nuki directly on my hub of choice: Hubitat Elevation (HE).

Since HE approach is local processing (whenever possible, of course), getting a POST directly from the Bridge itself (no web interface involved) about who locked/unlocked the lock would open a bunch of automation possibilities, e.g., start playing a playlist based on who opened the lock, send a notification about who get in/get out of the house, to command a camera to start recording when a delivery person uses the keypad code that I’ve provided specifically to unlock the door for the delivery and so on. As I said before, a bunch of possibilities!

I hope @MatthiasK that this feature gets into Nuki’s feature development queue soon - for a developer point of view it would be awesome!

Best for everyone!

1 Like

Here I’m again … hope Nuki releases this feature soon !

This feature would indeed be super useful, in particular when also knowing which Keypad user opened the door / or which pin.

Any news on timeline?

1 Like

No upates yet on this as we do not communicate our timelines, priorities and roadmaps in the public.

@MatthiasK could you at least let us know if this is actually still on the roadmap?

1 Like

Is there any chance getting the code used in the JSON or possibly programming the keypad through the bridge API’s? This opens up many possibilities for integrating the Nuki Keypad with various different home automation systems. There is a lack of good keypads in the EU region and this would be great!

1 Like

@MatthiasK could you elaborate on what “planned” really means? Are there actually actions being taking to get this feature request done or is it just sitting somewhere at the bottom of a long backlog?

1 Like

@Phuturist That was a somewhat awkward formulation on my part as we do not communicate our timelines, priorities and roadmaps in the public. So yes, we (still) see it as a valid feature request. But no, I can’t give you any more details about it.

I’m loosing faith in this feature request every getting resolved (and in Nuki in general but that’s a different topic). For now I want to see if I can use this work around. Is there anyone that has some working code available for what’s described above. My own programming skills are limited but with some working code I’m sure I can adopt it for my own situation.

The reason why I switched from z-wave DANALOCK locks was hardware quality and reliability, unfortunately there I could easily recognise in Homeassistant if the lock was opened by PIN from keypad or the lock was opened by zwave or manually. This was sufficient for my home automations which I miss so much right now. Please, if you could possibly speed this up, I would be grateful.

As I need this notification for my home automation I have switched to Homematic. I will change back in case this notification is working. If you can tell me that this will not included I will sell my device. Sorry, but my priorities seems to look different from the developer…

For what it’s worth. I was able to work around this with the suggestion of using the WebAPI. I added this REST sensor to Home Assistant.

  - resource: https://api.nuki.io/smartlock/4xxxx9/log?limit=1
    scan_interval: 3600
    headers:
      Authorization: !secret nuki_web_api_token
      Accept: 'application/json'
    sensor:
      - name: "Nuki Last Log Entry"
        value_template: "{{ states('sensor.date') + ' ' +states('sensor.time') }}"
        json_attributes_path: "$.[0]"
        json_attributes:
          - "name"
          - "action"
          - "trigger"
          - "state"
          - "autoUnlock"
          - "date"

This gets the data about who/waht triggered the lateste action. The scan interval is to make sure it does not trigger often, I update the sensor directly after the Bridge API detects a change in lockstate with this.

- service: homeassistant.update_entity
      target:
        entity_id: sensor.nuki_last_log_entry

That gives you the raw data about who/what triggered the lockstate change and allows for further automation.

3 Likes

Thanks. This works for me too. I use FHEM:

defmod NUKI_WEB JsonMod https://api.nuki.io/smartlock/logattr NUKI_WEB DbLogExclude .*attr NUKI_WEB httpHeader Authorization: Bearer [KEY]attr NUKI_WEB readingList complete();;

I always get an empty name, is there something special need to have it filled ?

Not that I know of. You have named the users and keypad codes in the app I assume?

If you have a door sensor as well like me, the name is always empty for the related open/close events. In my case the solution of @Phuturist is therefore not optimal: by retrieving always the last event, some events may be overlooked when several ones are triggered and logged one right after the other, which happens with a door sensor.
Ideally, I think log entries should be retreived using the filter fromDate, then loop in the results and update e.g. a text helper entity, and store the latest date from the results to be used as parameter for the next update.

I found that filtering by action=3 & limit = 1 i get the last operation with name filled, except when the door was opened using the nuki button

the problem is that this log is not inmediatelly available when i get the callback so i have to delay and retry, not very reliable, the problem solution is to include the name in the callback

Hello,
I would also really like to get some context information in the callback from bridge. Basically right now I have no way to distinguish between users that open the lock. Web API log function seems to be delayed by 10 - 20 seconds which is not acceptable for my use case.

It is really frustrating bc Nukki products are great, and I really appreciate how open the api is and how easy it is to integrate with it - at the same time small little things like this one makes it almost not usable for my case. It seems to me it is easier to achieve this functionality by integrating third party keypad.

2 Likes

Hi, everyone.

Does anyone who voted for this topic use smart home automation systems such as OpenHAB or Home Assistant? I believe the feature request that I created could complement this one for the Bridge HTTP API and Lock Pro.

If you also find it useful, you can vote for it.

Best regards

1 Like