-
Notifications
You must be signed in to change notification settings - Fork 8
Webhooks
This plugin supports webhooks that can be used to supplement polling of the SkyBell cloud to detect button press and motion events. Use of the webhooks is entirely optional.
Webhooks are enabled by adding a port
value in the config.json
file to specify the port number on which the web server should listen for requests. An optional secret
phrase may also be specified to authenticate webhook requests.
To trigger an event issue a PUT
request to one of these URLs:
URL | Description |
---|---|
/homebridge-skybell/trigger/button |
Trigger a Single Press event on the Programmable Switch Event characteristic of the Doorbell service. |
/homebridge-skybell/trigger/motion |
Trigger the Motion Detected characteristic of the Motion Sensor service. |
with the following data in the body:
{
"name": "Front Door",
"secret": "My webhooks secret"
}
The request's parameters are:
Parameter | Description |
---|---|
name |
The name of the doorbell as configured in the SkyBell HD app. |
secret |
The same as the secret value specified in the config.json file. |
This plugin continues to poll the SkyBell cloud API even if webhooks are enabled. Events can be triggered from either source.
In order to prevent duplicate HomeKit triggers, if a webhook event is received then this plugin suppresses events from the SkyBell cloud for a period of 10 minutes afterwards (or vice versa if the SkyBell cloud event occurred first). This behaviour is implemented independently for each combination of doorbell and event type (button press or motion).
In practice this means that the event notification will be used from the quickest source.
To trigger a button press on the same machine that is running the Homebridge server:
curl -d '{"name":"Front Door","secret":"My webhooks secret"}' http://localhost:47569/homebridge-skybell/trigger/button
Obviously the name, secret phrase, and port number should be replaced by appropriate values.
IFTTT announced that the SkyBell HD service would be removed from 7th October 2020 because it was no longer supported by the SkyBell HD team.
(This particular example is of dubious benefit because the SkyBell IFTTT channel is typically slower than this plugin polling the SkyBell cloud directly. See below for a better alternative.)
This plugin's webhooks can be invoked from an IFTTT applet. For example to trigger from SkyBell IFTTT channel events an applet should be created as follows:
-
If this
-
SkyBell HD
- Your SkyBell HD's button was pressed
-
SkyBell HD
-
then that:
-
Webhooks
-
Make a web request
- URL:
http://myserver.duckdns.org:47569/homebridge-skybell/trigger/button
- Method:
POST
- Content Type:
application/json
- Body:
{"name":"{{DeviceName}}","secret":"My webhooks secret"}
- URL:
-
Make a web request
-
Webhooks
Again, the host name, port number and secret should be replace
863F
d by appropriate values. IFTTT will substitute the doorbell's name for {{DeviceName}}
; it is does not need to be set manually.
If the webhooks server is behind NAT (network address translation) then a suitable port forwarding rule may need to be configured on the router. It may also be necessary to use a dynamic DNS host such as Duck DNS to obtain a static hostname.
Separate applets will need to be created for each doorbell. For motion detection events the Your SkyBell HD detected motion trigger should be used instead.
A better approach is to snoop on the CoAP packets sent and received by the doorbell. This allows the HomeKit triggers to achieve similar latency to that of the SkyBell HD mobile push notifications.
An example doorbell packet sniffer is provided with this plugin. It requires the ability to run tcpdump
on the gateway through which the doorbell's traffic is routed to the internet.
Copyright © 2017-2020 Alexander Thoukydides