Background:
I got fed up of Homekit to Nuki timeouts since Homekit 16.2 (and 16.4.1).
Nuki is working on FW updates to fix this, but they still result in Homekit connecting to NUKI via Bluetooth. I have 4 Homekit hubs, and two of them are out of Nuki Bluetooth range. Since 16.2 we can’t disable hub function on AppleTVs or Homepods.
Fix:
So, I have setup Nuki 3.0 Pro in HASS, using MQTT (which uses WIFI). Auto discovery did all the work. The Niki lock is visible in HASS and has two nice cards (one for status, one for lock operations, toggle locked/unlock status, unlatch and the lock and go functions. I exposed the Nuki Lock to Homekit. It works immediately (absolutely no timeouts or delay), but it only unlocks and locks the door. It can’t unlatch/open the door lock.
Problem:
As my door has no handle on the outside, I want Homekit unlock function to actually perform unlatch(open) on the NUKI (like the direct NUKI to Homekit connection does). So I can open the door and walk inside.
Question:
So, is what you have done, possible with my MQTT setup, keeping the nice cards with all the functionality?
Basically, I just want to change the homekit exposure to unlatch instead of unlock. My problem is figuring out how, as autodiscover hides all config, so I can’t copy and modify it where I want. Starting with a blank canvas is quite a step…
Any help in the right direction would be really appreciated. I’ll even document it for the next person that runs into this problem.
As you see the status is unlocked. If I slide it down, it locks. If I slide it up, it unlocks, but does not unlatch. And that is the behaviour I want to change. Mor about that under the next shot:
As you see, it’s exposed by Homeassistant 2023.4.6 (It’s not the direct NUKI > Homekit setup).
I’m starting to think that it’s not possible to change the Homekit behaviour for MQTT added NUKI 3.0 Pro locks, due to the way the lock is autodiscovered with MQTT and what functions are handed out to Homeassistant. I see a toggle function for lock/unlock (so don’t think it’s possible to call a lock door function). I see an open door function, but I’m not sure what the exact function name is.
The problem lies in small details, names, IDs, etc.
Yes, I am able to open and unlock the lock with NUKI APP.
The problem is that you are (most likely) using the original NUKI Homeassistant integration OR the extended HACS Nuki integration) and I’m using the MQTT integration.
Which integration are you using?
When you list your entities (Settings > device & Services > (select entities at top) , do you see your device (SoloApriPortaIngresso) and can you lock / unlock it there (I think this requires the status to work).
I can create the template, even see the template listed under entities. But it does nothing.
I have used your template for NUKI 2.0 lock (via Bridge) using the extended HACS NUKI integration. I selected the correct entity ID (see above). I exposed it to Homekit. Nothing happens when sliding the homekid slider, and the status is unknown. I CAN make a button that opens the lock (but this does not help homekit issue):
Your tempolate does work with some modifications, when I use it on another Homeassistant OS installation, whith a NUKI 3.0 Pro lock, using the MQTT integration (although I still have to fix the status):
lock:
- platform: template
name: Front Door HK
unique_id: 3154XXXX_lock
value_template: "{{ is_state('binary_sensor.front_door_door_sensor','off') }}"
lock:
service: lock.lock
target:
entity_id: lock.front_door
unlock:
service: button.press
target:
entity_id: button.front_door_unlatch
The key was adding the unique_id (can be found in mqtt debug). Maybe in stead of requesting the service button.press, requesting lock.open to entity_id lock.front_door would work too.
But I can’t figure out why the template does not work for the Nuki 2.0 via HACS extended integration, that does much more than default HASS integration.