kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
185 stars 36 forks source link

Expose unlatch service on homekit #138

Open pilot1981 opened 1 year ago

pilot1981 commented 1 year ago

Hi, Anyone know howto expose unlatch service on HomeKit?

I know howto expose switch on HomeKit using home assistant, but I’m not able to create a new switch/button starting from your unlatch service….

can you help me?

regards

magicbenny commented 1 year ago

you need to make a template switch which you can expose. maybe there is a better way but this is how I solved it.

`switch:

pilot1981 commented 1 year ago

Hi, I tried to do this one:

template switch per NUKI:

switch:

But I only want a button with unlatch feature, this could be the best solution to use with homekit automation...if I use switch with open and lock feature I could have an issue when door is open, in this case homekit automation can't unlatch the door...

magicbenny commented 1 year ago

"service: lock.open" is the unlatch feature you are looking for. you should have 3 services: lock.lock lock.unlock lock.open where again, lock.open is unlatch ;)

image

as you can see, this is the switch I generate with the code above and it's exposed to HK and it simply unlatch the door if lock is open. if lock is locked it will first unlock and then unlatch the door.

pilot1981 commented 1 year ago

"service: lock.open" is the unlatch feature you are looking for. you should have 3 services: lock.lock lock.unlock lock.open where again, lock.open is unlatch ;)

image

as you can see, this is the switch I generate with the code above and it's exposed to HK and it simply unlatch the door if lock is open. if lock is locked it will first unlock and then unlatch the door.

what you see on homekit? a switch with 2 or 3 positions...

what happen when door is opened and you ask to open/unlatch? homekit is able to unlatch it? I know Homekit know only open command but not unlatch...

pilot1981 commented 1 year ago

"service: lock.open" is the unlatch feature you are looking for. you should have 3 services: lock.lock lock.unlock lock.open where again, lock.open is unlatch ;)

image

as you can see, this is the switch I generate with the code above and it's exposed to HK and it simply unlatch the door if lock is open. if lock is locked it will first unlock and then unlatch the door.

I tried it, but when door is opened, and I try to unlatch door:. nothing happen...

I have knob in external side of door....