Thanks for posting this solution to the door sensor but my door sensor state just shows ‘closed’ all the time even when the door is open. I tried changing the bridge API call to /lockstate and /list but did not see any difference. I also tried the code posted by @svh1985 and got the same result.
Both the /lockstate and /list return the correct values on the web browser and so does the nuki app. Its just it doesn’t change in home assistant.
Below is the template I used:
binary_sensor:
platform: rest
name: Front Door Sensor
device_class: door
resource: http://192.168.1.30:8080/lockstate?token=XXXXXX
value_template: >
{% if value_json[0].lastKnownState.doorsensorState in [ 2, 3 ] %}
{{ value_json[0].lastKnownState.doorsensorState == 3 }}
{% else %}
Unknown
{% endif %}
Can someone please help?
Please ignore - finally got it to work. User error
I want to get a nuki smart lock, but have a question for the home assistant integration: Is the opener also integrated, can it fire events if someone rings at the door, and is it possible to turn off the bell from Home Assistant?
As for me the Opener does not integrate with the doorbell signal, I can only answer the first part of your question:
Yes, at least for me the Opener was recognized without any further work by the HA Nuki integration. Ring-to-open functionality is activated by service lock.unlock, door opener by lock.open.
ah ok, I used the Nello opener till they stopped the service, and I really liked that it fired events when somebody ringed at the door, so I could notify myself for example if I have headphones on and couldn’t hear the bell. If the nuki integration would have this feature I would buy it instantly
Hi,
since bridge API update last year it is possible to get the Opener bell ring event. I guess a dev could integrate in few minutes for easier nuki integration. Miss that feature too… in my understanding it is possible to register a callback url. So all we need is a webhook? as trigger in Homeassistant to fire a bell ring event???
I tried this in the meantime and it was really easy. Once you setup the callback in nuki bridge just publish a mqtt message in homeassistant and voila, perfect to use in automation as bell ring event.
Use this payload instead:
payload: ‘{{ trigger.json.ringactionState }}’
I used as topic: nuki/klingel
Only thing to do is create 2nd automation with trigger mqtt, mqtt topic nuki/klingel and True as payload
i create my lock, script, sensor on my HA because with integration (need bridge on internet) my smart lock every day is offline. I have problem with my bridge(?) or smartlock(?) when is on internet. I stop internet connection bridge on router. Only LAN.
Pardon my ignorance.
I just read through the whole thread and I have one question.
Is this lock local control?
I see some posts hinting that. Or did I misunderstand something.
Wow!
This is what I have been searching for.
I’m just a bit unsure about the door in the apartment we bought.
It looks like one of those doors you need to lift the handle to be able to lock it.
I read some reviews about this lock and it seems it has the same issues as Danalock.
Unlocking the door when it shouldn’t and keeping it locked when it should unlock.
But those of you who use local control with HA. What is your opinions?
Is it reliable? How does your automations work and what do they look like?
I use the automatic unlock from the app, I think it works via Bluetooth. You can finetune it in the settings how you like.
I use Hass mostly to show the status and announce unlocking via Alexa (to not be surprised by someone entering the house). There is a few seconds delay of the status to hass unfortunately.
The app has a protocol of every lock/unlock/door opening which I found very useful. Never had any problems, except when I ignored the battery warning for a day and couldn’t get in anymore. this works better with the powerpack they sell now, gives you more time. Just in case, have a spare key somewhere, I would not rely on Nuki 100%, it becomes a single point of failure. 99% of the time it works eprfect.
No automation by HA, but we have it automatically locked by the App when my wife or me leave a defined Geofence area and unlocked when one of us steps back into the defined area.
When we’re close enough for our mobiles are being recognized by Bluetooth (~8m) it opens the door after a short delay.
Since the lock is a bit noisy I don’t want to have it locked when one of us just went out to get something from the bakery or supermarket which are just 80m away.
So far we never had any problems.