{"id":15140454,"url":"https://github.com/efc/homebridge-smooth-lock","last_synced_at":"2026-01-19T22:01:49.564Z","repository":{"id":57266041,"uuid":"451668113","full_name":"efc/homebridge-smooth-lock","owner":"efc","description":"Homebridge plugin for a slightly more secure lock","archived":false,"fork":false,"pushed_at":"2022-01-24T23:49:14.000Z","size":19,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-17T02:24:44.143Z","etag":null,"topics":["adafruit-feather-esp32s2","homebridge","homekit","maker"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/efc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-24T23:26:45.000Z","updated_at":"2024-05-31T08:41:47.000Z","dependencies_parsed_at":"2022-08-25T02:51:48.454Z","dependency_job_id":null,"html_url":"https://github.com/efc/homebridge-smooth-lock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/efc/homebridge-smooth-lock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efc%2Fhomebridge-smooth-lock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efc%2Fhomebridge-smooth-lock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efc%2Fhomebridge-smooth-lock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efc%2Fhomebridge-smooth-lock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efc","download_url":"https://codeload.github.com/efc/homebridge-smooth-lock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efc%2Fhomebridge-smooth-lock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28587065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adafruit-feather-esp32s2","homebridge","homekit","maker"],"created_at":"2024-09-26T08:21:41.142Z","updated_at":"2026-01-19T22:01:49.531Z","avatar_url":"https://github.com/efc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# homebridge-smooth-lock\n[![NPM Version](https://img.shields.io/npm/v/homebridge-smooth-lock.svg)](https://www.npmjs.com/package/homebridge-smooth-lock)\n\n## Description\n\nThis [Homebridge](https://github.com/homebridge/homebridge) plugin exposes a web-based lock to Apple's [HomeKit](http://www.apple.com/ios/home/). This plugin expects the lock to expose a specific REST API to allow Homebridge to lock and unlock the device. It also expects that once the lock completes the requested action, it will inform a Homebridge \"listener\" which will then inform HomeKit of the locks new state.\n\n## Motivation\n\nWe built a lock for our sliding door with a microcontroller and wanted to be able to control it with HomeKit. Homebridge looked like the best bet, but we wanted a lock plugin that could allow our microcontroller to handle the auto-lock delay (so that it could be sensitive to whether or not the door was open). We also wanted to include a one-time token in each transaction between Homebridge and the device so that lock would not accept instructions from an unknown source. We don't believe in security-by-firewall, we believe that we should not trust even our home network.\n\nThis plugin allows either the plugin or the device to manage automatically re-securing the lock after a delay. It also facilitates the delivery of a one-time token with each call to the device, and provides a validator so that the device can check that the token is authentic before changing the state of the lock.\n\n## Installation\n\n1. Install [Homebridge](https://github.com/homebridge/homebridge#installation)\n2. Install this plugin in a directory on the same server\n3. Use `sudo npm link` to link that installation to your Node package manager\n4. Update your `config.json`\n\nNote, once we have a real NPM package available we should simplify this installation procedure.\n\n## Configuration\n\nThe configuration of each accessory using this plugin is done by directly editing a bit of JSON in the Homebridge application. The configuration will look something like this.\n\n```json\n\"accessories\": [\n     {\n       \"accessory\": \"SmoothLock\",\n       \"name\": \"Smooth Lock\",\n       \"deviceRoot\": \"http://host.org:port/path\",\n     }\n]\n```\n### Core configuration\n\nNone of these core items have default values, so you must define them in the configuration.\n\n| Key          | Description                    |\n| ------------ | ------------------------------ |\n| `accessory`  | Must be `SmoothLock`           |\n| `name`       | Name to appear in the Home app |\n| `deviceRoot` | Root URL of your device        |\n\n### Optional configuration\n\nEach of these optional items either has a default value or is not necessary to the operation of the plugin. Of course, you may override any of these default values.\n\n| Key             | Description                                                                                                | Default    |\n| --------------- | ---------------------------------------------------------------------------------------------------------- | ---------- |\n| `listenerPort`  | Port for your HTTP listener (only one listener per port)                                                   | `8282`     |\n| `autolock`      | Whether autolocking is handled by this plugin (`plugin`), by the device (`device`), or not at all (`none`) | `none`     |\n| `autolockDelay` | Time (in seconds) to delay autolock if either the plugin or device is autolocking                          | `300`      |\n| `pollInterval`  | Time (in seconds) between device polls                                                                     | `300`      |\n| `timeout`       | Time (in seconds) until the accessory will be marked as _Not Responding_ if it is unreachable              | `3`        |\n| `method`        | HTTP method used to communicate with the device                                                            | `GET`      |\n| `username`      | Username if HTTP authentication is enabled                                                                 | N/A        |\n| `password`      | Password if HTTP authentication is enabled                                                                 | N/A        |\n| `model`         | Appears under the _Model_ field for the accessory                                                          | plugin     |\n| `serial`        | Appears under the _Serial_ field for the accessory                                                         | deviceRoot |\n| `manufacturer`  | Appears under the _Manufacturer_ field for the accessory                                                   | author     |\n| `firmware`      | Appears under the _Firmware_ field for the accessory                                                       | version    |\n| `tokenTimeout`  | Time (seconds) until a validation token becomes invalid, use `0` to ignore validation tokens               | `2`        |\n\n## Device API\n\nThe device is the microcontroller managing the lock itself. We expect that this device is on the network and running a web server capable of responding to the following REST requests.\n\n### Status\n```\n/status?token=RANDOM_STRING\n```\n\nAsks the device to report its locked or unlocked state. The device will respond with JSON describing both the target lock state and the current lock state where `1` means secured, a `0` means unsecured.\n\n```\n{\n  \"target\": 1,\n  \"current\": 1\n}\n```\n\n### Lock\n\n```\n/lock?token=RANDOM_STRING\n```\n\nAsks the device to secure itself. The response will be ignored. The `token` value will be one that the listener is prepared to validate with a `/validate` call.\n\nNote that once the lock is confirmed to be secured, the device should send the listener a `/locked` call.\n\n### Unlock\n\n```\n/unlock?token=RANDOM_STRING\u0026auto=INTEGER\n```\n\nAsks the device to unsecure itself. The response will be ignored. The `token` value will be one that the listener is prepared to validate with a `/validate` call. If the configuration specifies that the device is managing the `autolock` timing itself, then the desired delay will be included as seconds in the `auto` value.\n\nNote that once the lock is confirmed to be unsecured, the device should send the listener an `/unlocked` call.\n\n## Listener API\n\nThe listener will be set up by this plugin using the Homebridge's own host name and the `listenerPort` supplied in the configuration. You will have to configure your device to communicate with this specific listener. The listener server responds to the following REST requests.\n\n### Locked\n\n```\n/locked\n```\n\nInforms the Homebridge listener that the device has been successfully locked.\n\n### Unlocked\n\n```\n/unlocked\n```\n\nInforms the Homebridge listener that the device has been successfully unlocked.\n\n### Validate\n\n```\n/validate?token=STRING\n```\n\nAsks the Homebridge listener to validate a token. The listener will respond with 1 if the token was valid or 0 if the token was invalid. This token should be the same token that the device received with the calls to its own API. The listener will respond `valid` if the token is valid, any other response should be considered invalid.\n\nNote that if the `tokenTimeout` supplied in the configuration is set to `0` (zero), then any string you try to validate will be accepted as valid. This effectively breaks security, but can make certain testing easier.\n\n## Changelog\n\n### 1.0.1 - January 2022\n\nAdd NPM shield to readme.\n\n### 1.0.0\n\nInitial version. This plugin owes a lot to [homebridge-web-lock](https://github.com/phenotypic/homebridge-web-lock). While we made quite a few changes, that plugin showed us how all this fits together and works.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefc%2Fhomebridge-smooth-lock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefc%2Fhomebridge-smooth-lock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefc%2Fhomebridge-smooth-lock/lists"}