HTTP API callback and the unlatched state

Hello,

I have recently purchased a Nuki 2.0 with the bridge and it’s working great!

I am using the HTTP API with a callback for state changes, however I have noticed that opening the door, when the lock is already unlocked, will cause an unlocked state change to be sent, rather than the unlatched action that I expected.

I did see some topics about the door sensor state and requests to implement them in the Bridge API. I’m not sure if this is the same thing, as a notification is sent when the door is opened, but its state is not what I expected.

The picture below shows a short summary of what I mean. I have labelled the 3 notifications in the picture. The stateName property from the callback is displayed.
1 is sent the moment the door is opened from the inside. Note that the lock was already unlocked prior to opening the door;
2 is sent once the door is closed;
3 is then sent when the lock is locked.

Callbacks 2 and 3 are expected, but I’d expect the state of 1 to be unlatched.

Is this intentional, or am I misunderstanding something?

Thank you in advance for your time.

1 Like

There will be no callback for unlatched state. This is by design.

1 Like

Thanks for your reply!

I did get one unlatched event yesterday though, but I have not been able to reproduce it since.

Not sure how that happened if callbacks should not trigger for that state.

The state change is sent after a completed lock action - which normally does not end on unlatch status.

So there’s no way in our SmartHome systems to detect when the door was opened using the NUKI smartphone app or a fob (in case it was already unlocked before)?

Or is it a reliable to expect an unlatch event when we receive a “unlocked” state while the lockState was already unlocked before?

Not sure if there are other situations where another callback is sent beside an lockaction.

edit:
Ok it doesn’t seem to be a reliable way to detect it.
If I send a lockState request to the API, it does not only send the response back, it also triggers a callback call.

:neutral_face:

Which firmware version does your Bridge have? This was a known issue in the Beta and should have been fixed with the latest updates.

You’re right if I send the statusRequest manually through the browser this isn’t happening.
So I have to take a look at the code of the smart home module.

Nonetheless, this would be a great improvement:

:wink: