Questions - Unifi Protect Alarm Manager using Webhooks to control Hubitat devices

Hello, I am new to all this programming. I have an extensive Ubiquiti UniFi Protect system configuration and use Hubitat for some condo automation.

UniFi Protect release their Alarm Manager and it has the ability to send a webhook and I am not a programmer so I hope to find others here that have mastered this integration.

I have Maker API loaded and looking at its documentation but I am over my head.

If anyone has dabbled or mastered this with some easy to understand details it would be appreciated if you would share here. I am sure many other are looking to do the same thing and this would be a powerful integration for the Hubitat Community.

Thank you,

There are 2 Protect integrations. They may give you what you are looking for without the additional complexity of webhooks. Both are available in Hubitat Package Manager

2 Likes

Thank you very much.

I also have UniFi Protect, and was just experimenting with the new Alarm Manager feature. It was pretty trivial to use the new Webhook feature to call the Hubitat MakerAPI using a local LAN URL call.

The first step is to get the Hubitat MakerAPI app installed and TESTED using your normal web browser.

Then, in the UniFi Protect Alarm manager, create a new alarm, configure it to monitor whatever you'd like, and then add an Action that is a Custom Webhook. Paste in the URL that you used above in your web browser when testing the Hubitat MakerAPI.

Here is an example that I just created that works great.

The nice thing about this solution is that it requires no custom code whatsoever on your Hubitat hub. It just needs the built-in MakerAPI app. Also, I like that I can use LOCAL MakerAPI URLs to keep all of this data local to my LAN.

This is a feature that I asked Wyze to add to their cameras years ago. I am glad I switched over to UniFi Protect! This will allow me to easily trigger Hubitat automations for very specific UniFi Protect events, such as when a car pulls in the driveway, or an animal walks through the yard, etc...

2 Likes

Can you show me your webhook, Delete the key code from ? on but where I am having issue is knowing if i have the syntax correct. The device is a simple lamp to test.

The documentation shows - http://192.168.7.10/apps/api/33/devices/[Device ID]/[Command]/[Secondary value]?access_token=(deleted the token)

[Device ID] C0C9E########

[Command] on

[Secondary value] 100

http://192.168.7.10/apps/api/33/devices/C0C9#######/on/100?access_token=(I deleted the token)

I can find the device code, I think the command is just on but not sure what to do with the secondary value, just guessing.

Thanks

Your URL is incorrect. The DeviceID is not the Device Network ID. It is the numeric ID of the device which you can find by viewing the Device you want to control in your browser, then look at the URL to see the numeric device ID.

For example

http://192.168.1.144/apps/api/3390/devices/3261/on?access_token=TOKEN_REMOVED

Remember, please get this working in your browser before attempting to use it in the UniFi Protect Alarm Manager.

1 Like

I want to note, the integrations linked above (mine and @tomw's) are both local also. They use the local API running on a person's Unifi Controller itself.

2 Likes

Good point! I did not mean to imply otherwise.

1 Like

Thank you, That device ID and no "/? after the "on" command worked, I am off to the races now and I will work to implement the other integration soon.

Off to implement this on 3 UNVR4s and 1 UNVRPro

Thank you all so very much.

1 Like

Great! Glad to hear it is working. Have fun!

Can confirm this is working great. Just set it up to unlock my gate using Konnected.