homebridge-electromagnetic-lock-v2
v2.0.0
Published
Homebridge2 Electromagnetic Lock plugin to control electromagnetic lock via Raspberry Pi GPIO lines
Maintainers
Readme
Homebridge2 Electromagnetic Lock
Homebridge2 Electromagnetic Lock plugin to control electromagnetic lock via Raspberry Pi GPIO lines.
Objective
Electromagnetic lock controlled through libgpiod.
Installation
- install homebridge
npm install -g homebridge - install libgpiod
sudo apt install -y gpiod libgpiod-dev - install this plugin
npm install -g homebridge-electromagnetic-lock-v2 - update your
~/.homebridge/config.jsonfile (usesample-config.jsonas a reference)
Configuration
Sample accessory:
"accessories": [
{
"accessory": "ElectromagneticLock2",
"name": "Lock",
"lockPin": 18,
"gpioChip": 0,
"activeLow": true,
"unlockingDuration": 2
}
]Fields:
accessorymust always be ElectromagneticLock2nameaccessory name, e.g. LocklockPinBCM GPIO / libgpiod line number for unlocking lock, not physical board pingpioChip[optional, default: 0] GPIO chip number used by libgpiod, usually 0 on Raspberry PiactiveLow[optional, default: true] true: relay activated by low state (0), false: relay activated by high state (1), affects lockPinunlockingDuration[optional, default: 2] how long lockPin should be active (seconds)
For example, Raspberry Pi physical pin 12 is BCM GPIO 18, so use "lockPin": 18.
Troubleshooting
- check platform: Homebridge
- check plugin dependency: [underscore](Install: npm install underscore -> https://www.npmjs.com/package/underscore)
- check plugin dependency: node-libgpiod
Attribution
This project is based on Homebridge GPIO Electromagnetic Lock by Panda Unit sp. z o.o. (github.com/pandaunit/homebridge-gpio-electromagnetic-lock).
