homebridge / HAP-NodeJS

Node.js implementation of the HomeKit Accessory Protocol (HAP)
Apache License 2.0
2.69k stars 630 forks source link

Smartlock lock / unlocked / open #149

Closed sd8rdb closed 4 years ago

sd8rdb commented 9 years ago

Hi,

for the lock accessoires, I can see UNSECURED (e.g. door is unlocked), SECURED (e.g. door is locked). But there there are models/doors available where you also can open the door. Means you have to use the key to enter the door.

Means the door can also not be entered while the lock is in unsecured mode.

So a another command is necessary: "open"

How can this be implemented? Is it available with Homekit?

BR

KhaosT commented 9 years ago

There is a door service (https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js#L1454)

justme-1968 commented 9 years ago

you can add a TargetDoorState to the LockMechanism service. from get just return TargetDoorState.CLOSED and from the set you can send an open to the smart lock and create a timeout to push TargetDoorState.CLOSED back to homekit after 500ms or so. this will result in the open button in eve always be pressable.

or you can try to use the GarageDoor service. it offers a combination of DoorState and LockState and could be better suited for siri.