Homebridge plugin to control electric rim locks using Raspberry Pi GPIO pins. This plugin allows you to open electric rim locks from Apple HomeKit by triggering a relay connected to a Raspberry Pi.
This plugin is designed to run only on Raspberry Pi hardware because it uses the rpio library to access GPIO pins.
- non-Raspberry Pi Linux systems
- virtual machines
- Docker containers without GPIO access
This plugin assumes that the Raspberry Pi controls an electric rim lock via a relay module.
Electric rim locks usually include a wall button that briefly closes a circuit to unlock the door.
On many systems this is a 12V AC circuit.
The Raspberry Pi must not be connected directly to the lock, therefore a relay module is required.
When HomeKit sends the unlock command:
- the GPIO pin activates the relay
- the relay closes the circuit
- the door unlocks
- the relay is released after the configured delay
- Open the Homebridge UI
- Navigate to Plugins
- Search for:
homebridge-gpio-electric-rim-lock - Click Install
npm install -g homebridge-gpio-electric-rim-lock
Restart Homebridge after installation.
The plugin includes a configuration interface.
Navigate to: Plugins → Homebridge GPIO Electric Rim Lock → Settings
Add the following to your Homebridge config.json.
Example:
{
"platforms": [
{
"platform": "Tiro",
"locks": [
{
"name": "Front Door",
"pin": 11,
"duration": 500
},
{
"name": "Back Door",
"pin": 12,
"duration": 700
}
]
}
]
}| Field | Required | Description |
|---|---|---|
name |
yes | Name of the door lock shown in HomeKit |
pin |
yes | Physical GPIO pin connected to the relay (recommended 11, 12, 13 or 15) |
duration |
no | Relay activation time in milliseconds (from 100 to 2000, default 500 ms) |
Make sure Homebridge is running on a Raspberry Pi.
You can verify this with:
cat /proc/cpuinfo
Check:
- correct GPIO pin number
- relay module power supply
- GPIO permissions
Run Homebridge with appropriate permissions or add the user to the gpio group.
Example:
sudo usermod -aG gpio homebridge
Restart the system after changing group permissions.
This plugin controls physical door locks.
Always ensure:
- your wiring is correct
- relay modules are properly isolated
- the door can still be opened manually in case of failure
The author is not responsible for damage or security issues caused by improper installation.