Skip to content

lock Device

Erik Baauw edited this page Nov 25, 2021 · 6 revisions

lock Device

A lock device exposes any switchable on/off device connected to a GPIO pin, like a relay, LED, or fan. Homebridge RPi configures the GPIO pin for output. Homebridge RPi configures pigpiod to send real-time notifications when the GPIO state changes.

The device is exposed as a separate HomeKit accessory, with a Lock Mechanism service. Through setting Lock Target State, you can control the GPIO output from HomeKit. Lock Current State is updated automatically, 500ms after the Lock Target State has changed.

Set pulse for an electric strike lock. With this setting, the lock locks automatically after being unlocked.

The lock device uses the following config.json keys:

key type Description
name string The name for the device in HomeKit.
gpio integer The GPIO pin.
reversed boolean The device state is reversed, i.e. set or report the lock as unlocked when the GPIO state is low instead of high.
pulse integer The time (between 20ms and 5000ms) after which the lock is locked automatically.