Doorsensor in API

Hey, is it possible to check the state of the doorsensor of V2 Locks with the Web API?
I don’t find anything in the docs right now but maybe something is in the working, as it would be also useful to know if the door gets closed via code.

You can poll

https://api.nuki.io/#!/Smartlock/get_0

to get
state.doorState

with
doorState (integer): The door state: 0 .. unavailable, 1 .. deactivated, 2 .. door closed, 3 .. door opened, 4 .. door state unknown, 5 .. calibrating

But no, there is no possibility to get a callback for state changes. But there is already a feature request for this you could support:

2 Likes

Thanks, this is exactly what I was looking for.
Am I correct assuming that the doorState equals 0 if a V1 Lock is used?

Exactly. For Smart Lock 1.0 you will get state.doorState : 0.

1 is for deactivated door sensor in Smart Lock 2.0 and 4 a jammed door sensor which may need recalibration.

Hi Stephan,

I’m also interested in this. I could use polling as a workaround, but I was interested in whether each request polls the lock itself or just the bridge. Don’t want to drain battery life on the lock with a 2s poll.

Thanks!

The Web API gets its data from the server where updates from the Smart Lock are pushed to. So it doesn’t really matter (regarding battery life). This is only relevant for the (local) Bridge HTTP API which can poll data directly from the Smart Lock.

The door Sensor is ugly imho

I have an integrated Sensor in my door which I can read via KNX and respective openhab. Is it possible to push the door state via API to the nuki bridge to have the correct door state in nuki without using the Sensor?

No. This is not possible with our API.

Any future plans for this?

Integrating data from other devices in our APIs is nothing we planned as something like this is normally done centralized with setups dedicated for that task.
To be honest there are also more straightforward feature requests waiting for some time now, we will look into with higher priority.

I am new to Nuki 2.0 (not to the “first edition”) and was wondering, that the door sensor is not pushed by the Bridge API Callback.
Therefore, this is my feature request that also door state is pushed as a separate json property in the Bridge callback.
Cu, Christian

1 Like