Nuki Card with Callback support (supports both Lock & Opener, it replaces the official integration)

You seriously think that I didn’t think to do that? :slight_smile:

Unfortunately the REST sensor, believe it or not, doesn’t provide a result status http code. So if that’s not available, you can’t even retry the call, and with the bridge limitation of 1 call, retrying is not the recommended approach. Broken json response is due to the failure of the rest call.

Bridges are all the same, make sure you’re on latest firmware, and if you can, post the /log output of the bridge so we can take a look at the timings. The 503 error is well known and documented, it has to do with multiple commands run at the same time to the bridge. So if you want to sniff the network to understand what’s happening, try to catch which client is sending commands to the bridge.

Hi,

I have created an automation to send a notification if the door is unlocked whilst my alarm is armed away.

This works fine however if I understand automations correctly I believe this is checking the status of the lock at frequent intervals (I don’t know what the default value in HA is?) and therefore waking the smart lock more frequently, thus consuming more battery. If there a way to set this up without HA constantly checking the status of the lock?

Hi,
this integration is reporting the status of the lock to HA a couple of seconds after it changed. There is IMO no need to check (poll) the status from the lock/bridge.
The status is reflected in lock.nuki_lock_action - in your automation you’d check if this changes from locked to unlocked.

That’s what I thought but then isn’t HA constantly checking the status of lock.nuki_lock_action and therefore repeatedly waking the smart lock?

Nope, when the state of the lock changes the lock reports that via callback to HA, the automation is monitoring and reacting on a change of lock.nuki_lock_action

Ok thanks. Would that be the same if I use the value from “input_text.nuki_bridge_lock_sensor” ?

Yes, you can monitor the change in the developer section. It takes here ~5 seconds until the callback reports the change to HA.
Click this:

This integration/automation has been created exactly because the official integration relied on polling the bridge to get the lock status every X seconds, so notifications were significantly delayed. The battery is not an issue also for official integration, because the bridge communicates with the lock via BT/BLE, then caches its status, so when you query the bridge, even through polling, you never communicate with the lock, but with the bridge.

The Nuki Card leverages the bridge callback functionality: when an event happens, the bridge notifies HA, and we intercept this through an automation trigger. So we never poll the bridge.

For the rest, Joerg has answered to your questions.

Use lock.nuki_lock_action, input_texts are used as variables in the automation, they might change in the future.

This is not technically correct: the nuki card creates and updates lock.nuki_lock_action status. :slight_smile:
Basically, it receives the callback, analyzes it, and updates the template lock, the door sensor, etc.

Joerg, thanks for all the support you give to users while I’m not around, I appreciate it.

Well I think it is, because I was referring to his automation, in which he should use lock.nuki_lock_action :wink:

I don’t agree, but it’s not a problem. I took the chance to explain how it technically works. :slight_smile:

Than please let me know…
As said I was referring to his automation:
“if my alarm is armed and the lock state changes from locked to unlock (by checking lock.nuki_lock_action) send me a notification”

Yes but saying:

the automation is monitoring and reacting on a change of lock.nuki_lock_action

is technically not correct. But really, it’s not important, I just wanted to explain that all the sensors are created and managed by the automation, and updated through the info received from the bridge callback.

Then please enlighten me.

I was not talking about the automation of the nuki card.
But as said please enlighten me - i feel we talk past each other.
This automation is checking if the value of lock.nuki_lock_action changes, no?

alias: Nuki was unlocked
description: ''
trigger:
  - platform: state
    entity_id: lock.nuki_lock_action
    from: locked
    to: unlocked
condition: []
action:
  - service: notify.events
    data:
      message: Nuki was unlocked
      title: Nuki was unlocked
mode: single

I did, specifiying what the integration actually does. :slight_smile:
But really, I don’t want to have a discussion on this, it’s not a big deal.

Sorry, than I don’t understand and I want to understand. I know what the integration does, but I am interested in what my automation is doing.

Ok, I understand now you were referring to his automation, not to Nuki Card. When you wrote “the automation” I thought you were referring to Nuki Card. :slight_smile:

Yeah… I wrote two times → his automation … and one time you were even quoting it.
I believe you might need more vacation :yum:

I believe you should have wrote Nuki Card and “your automation” and be more clear. :rofl: