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.
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.
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.