@350d/homebridge-http-lock
Version:
Modern Homebridge plugin for controlling HTTP-enabled lock mechanisms via Apple HomeKit. Supports various HTTP methods, custom authentication, automatic locking, and flexible device integration for smart home automation.
248 lines • 8.36 kB
JSON
{
"pluginAlias": "HTTPLock",
"pluginType": "platform",
"singular": false,
"headerDisplay": "Modern Homebridge platform for controlling HTTP-enabled lock mechanisms via Apple HomeKit. Configure multiple lock devices through HTTP requests.",
"footerDisplay": "For detailed configuration examples and troubleshooting, visit: [GitHub Repository](https://github.com/350d/homebridge-http-lock#readme)",
"schema": {
"type": "object",
"properties": {
"platform": {
"title": "Platform",
"type": "string",
"const": "HTTPLock",
"description": "Platform identifier (automatically set)"
},
"name": {
"title": "Platform Name",
"type": "string",
"default": "HTTP Lock Platform",
"description": "Name for this platform instance",
"placeholder": "HTTP Lock Platform"
},
"locks": {
"title": "Lock Devices",
"type": "array",
"minItems": 1,
"description": "Configure lock devices for this platform",
"items": {
"type": "object",
"properties": {
"name": {
"title": "Device Name",
"type": "string",
"required": true,
"description": "Name of the lock device as it will appear in HomeKit",
"placeholder": "Front Door Lock"
},
"openURL": {
"title": "Unlock URL",
"type": "string",
"format": "uri",
"description": "HTTP endpoint to unlock the device",
"placeholder": "http://192.168.1.100/relay/0?turn=on"
},
"closeURL": {
"title": "Lock URL",
"type": "string",
"format": "uri",
"description": "HTTP endpoint to lock the device",
"placeholder": "http://192.168.1.100/relay/0?turn=off"
},
"http_method": {
"title": "HTTP Method",
"type": "string",
"default": "GET",
"oneOf": [
{"title": "GET", "enum": ["GET"]},
{"title": "POST", "enum": ["POST"]},
{"title": "PUT", "enum": ["PUT"]},
{"title": "PATCH", "enum": ["PATCH"]}
],
"description": "HTTP method for requests"
},
"timeout": {
"title": "Timeout (seconds)",
"type": "integer",
"default": 5,
"minimum": 1,
"maximum": 30,
"description": "Request timeout in seconds"
},
"username": {
"title": "Username",
"type": "string",
"description": "HTTP Basic Authentication username"
},
"password": {
"title": "Password",
"type": "string",
"description": "HTTP Basic Authentication password"
},
"openHeader": {
"title": "Unlock Headers",
"type": "object",
"description": "Custom HTTP headers for unlock requests"
},
"closeHeader": {
"title": "Lock Headers",
"type": "object",
"description": "Custom HTTP headers for lock requests"
},
"openBody": {
"title": "Unlock Body",
"type": "string",
"description": "HTTP request body for unlock operation",
"placeholder": "{\"action\":\"unlock\",\"device_id\":\"lock_01\"}"
},
"closeBody": {
"title": "Lock Body",
"type": "string",
"description": "HTTP request body for lock operation",
"placeholder": "{\"action\":\"lock\",\"device_id\":\"lock_01\"}"
},
"autoLock": {
"title": "Enable Auto-Lock",
"type": "boolean",
"default": false,
"description": "Automatically lock after unlock operation"
},
"autoLockDelay": {
"title": "Auto-Lock Delay (seconds)",
"type": "integer",
"default": 5,
"minimum": 1,
"maximum": 600,
"description": "Delay before automatic lock in seconds"
},
"resetLock": {
"title": "Enable Lock State Reset",
"type": "boolean",
"default": false,
"description": "Reset lock state to secured without triggering HTTP request"
},
"resetLockTime": {
"title": "Reset Delay (seconds)",
"type": "integer",
"default": 5,
"minimum": 1,
"maximum": 3600,
"description": "Delay before state reset in seconds"
},
"manufacturer": {
"title": "Manufacturer",
"type": "string",
"description": "Device manufacturer name (optional)",
"placeholder": "Homebridge"
},
"model": {
"title": "Model",
"type": "string",
"description": "Device model identifier (optional)",
"placeholder": "HTTP Lock Device"
},
"serial": {
"title": "Serial Number",
"type": "string",
"description": "Device serial number (optional)",
"placeholder": "1.0.0"
},
"firmware": {
"title": "Firmware Version",
"type": "string",
"description": "Device firmware version (optional)",
"placeholder": "2.0.0"
}
},
"required": ["name"],
"anyOf": [
{"required": ["openURL"]},
{"required": ["closeURL"]}
]
}
}
},
"required": ["platform", "name", "locks"]
},
"layout": [
"platform",
"name",
{
"type": "help",
"helpvalue": "<div class='alert alert-info'><strong>Platform Setup:</strong> This platform manages multiple HTTP lock devices. Configure each lock using the tabs below.</div>"
},
{
"type": "section",
"title": "Lock Devices",
"expandable": true,
"expanded": true,
"items": [
{
"key": "locks",
"type": "tabarray",
"title": "{{ value.name || 'New Lock Device' }}",
"expandable": true,
"expanded": false,
"orderable": false,
"items": [
"locks[].name",
"locks[].openURL",
"locks[].closeURL",
{
"key": "locks[]",
"type": "section",
"title": "HTTP Configuration",
"expandable": true,
"expanded": false,
"items": [
"locks[].http_method",
"locks[].timeout",
"locks[].username",
"locks[].password"
]
},
{
"key": "locks[]",
"type": "section",
"title": "Request Headers & Body",
"expandable": true,
"expanded": false,
"items": [
"locks[].openHeader",
"locks[].openBody",
"locks[].closeHeader",
"locks[].closeBody"
]
},
{
"key": "locks[]",
"type": "section",
"title": "Automation Features",
"expandable": true,
"expanded": false,
"items": [
"locks[].autoLock",
"locks[].autoLockDelay",
"locks[].resetLock",
"locks[].resetLockTime"
]
},
{
"key": "locks[]",
"type": "section",
"title": "Device Information",
"expandable": true,
"expanded": false,
"items": [
"locks[].manufacturer",
"locks[].model",
"locks[].serial",
"locks[].firmware"
]
}
]
}
]
}
]
}