Control4 UniFi Protect / Access / Network: Receiving Custom Webhooks
This guide describes how to trigger actions in control4 based on custom UniFi Webhooks. This can be used to perform actions based on advanced UniFi triggers which may not be handled directly.
Procedure
The Chowmain UniFi Drivers must be 20251215 or later. Custom Webhooks requires a local UniFi Controller
- Ensure that the Primary Control4 Controller utilises a static IP, or a reserved DHCP address. If the Control4 IP address controller changes IP, the UniFi applications may be unable to trigger the custom webhooks. Ensure that the latest firmware is in use by UniFi
- Log into the UniFi Controller. Select the correct Application (Protect, Network or Access)
- Open Alarm Manager. Please note, on some controllers, this may be found in a different location. For the latest info, check UniFi's documentation

- Create an Alarm

- Set the Alarm Conditions and name as required

- Using the Custom Webhook URL Property in the Controller driver in Control4, set the webhook action. Change <CUSTOM_WEBHOOK_NAME> to a reference name to use. Set Delivery Method to "POST". It is not recommended to have spaces in the Delivery URL. Press Create

Using the Webhooks in Control4
- Control4 provides 2 variables you can program against. The webhook url is capitalised (as an example, for 192.168.1.1/custom/Arrival, LAST_CUSTOM_WEBHOOK_NAME will contain "ARRIVAL". For more info about the current state, use Variables Agent

- As an alternative, events can be used instead. Set the "Auto Create Events For Custom Webhooks" Property to "Automatic", and events will be created as they are triggered

Some webhooks may trigger rapidly, and require a debounce using a timer (via the timer agent), to block the event being fired multiple times in a second. Ensure you test all webhooks