homebridge-unifi-protect-webhook
v0.3.1
Published
Homebridge plugin: expose local webhook endpoints and email triggers as HomeKit Motion sensors for UniFi Protect/Reolink integration.
Maintainers
Readme
homebridge-unifi-protect-webhook
Homebridge plugin to expose local Webhooks (and optional IMAP email triggers) as HomeKit Motion Sensors. Integrated UI in Homebridge Config UI X.
Quick Start
- Install the plugin in Homebridge UI.
- Open the plugin page, set
publicHostorpublicBaseUrl, then SAVE. - Create a Webhook, click “Reveal URL” or “Regenerate” to get the full link (with token), then SAVE.
- Paste the URL into UniFi Protect (Outgoing Webhook).
The UI is draft‑only: it updates in‑memory config and enables the SAVE button. No direct calls to UniFi.
Minimal Config
publicHost: IP/hostname of the Homebridge machine (e.g.192.168.1.50).- Or
publicBaseUrl: full external URL (e.g.https://homebridge.example.com/hb). UsetrustProxyHeaders: truebehind reverse proxies. - Default port:
12050.
LAN example:
{
"platform": "ProtectWebhookPlatform",
"publicHost": "192.168.1.50",
"port": 12050
}HTTPS / reverse proxy example:
{
"platform": "ProtectWebhookPlatform",
"publicBaseUrl": "https://homebridge.example.com/hb",
"trustProxyHeaders": true
}Base URL priority: 1) publicBaseUrl 2) X‑Forwarded‑* (when trustProxyHeaders=true) 3) publicHost 4) auto‑detected private IPv4 5) bindAddress.
Create and Use a Webhook
- Enter Name (no spaces) and create.
- “Reveal URL” (first reveal) or “Regenerate” (new token): UI generates the token client‑side and shows the full URL.
- Click SAVE to persist the token to
config.json. - In UniFi Protect: Settings → Integrations → Webhooks → Outgoing → paste the URL (including
?token=...).
If you see 127.0.0.1
Set publicHost (Homebridge IP) or publicBaseUrl (with trustProxyHeaders=true behind proxy). The UI URLs will use those values.
Email Triggers (optional)
Add an IMAP trigger with host, user, password and subjectMatch. SAVE to activate.
Security
enforceLocalOnly=truelimits access to LAN; use a secure reverse proxy for internet exposure.- Set
adminSecretif you’ll use admin endpoints via external scripts.
