Unifi and webhooks - G4 Pro doorbell fingerprint reader

Earlier this week, Ubiquiti released a beta firmware update that enables the fingerprint reader on their G4 Pro doorbell (I didn't even know my doorbell HAD a fingerprint reader!!)

It works via sending a webhook to a hub which would then trigger a lock. I can't find much info on Hubitat supporting webhooks. Is this something that's supported?

@snell or @tomw may be able to help with that.

1 Like

Don't have a doorbell, but I didn't know UniFi Protect had webhooks. Maybe I can get rid of my awkward integration methods now. :slight_smile:

In any case, to set this up, assuming it works similarly to anything in Protect, you don't need any special apps or drivers on the hub to do this.* You just need a Rule, Maker API instance (plus some device you'd use for this), or any other method of creating a local (or cloud if you really need to, I guess) endpoint on your hub that UniFi can hit.

(*That being said, I am not familiar with any community offerings, and it's possible some option can do this that way without needing to use the webhook...)

In your "Delivery URL" for the webhook settings, just provide the right endpoint. For example, you could create a virtual button and make Maker API push button 1 on that device by doing something like this — though get the actual token, app and device IDs, etc. from your Maker API instance:

http://[hub_ip_address]/apps/api/[maker_api_app_id]/devices/[device_id]/push/1?access_token=[access_token]

Then you can have a Button Rule or some other automation that responds to this button event, among many other possibilities (including just using a local endpoint trigger for a Rule and using that instead of Maker API if you were just going to use a rule for this in the first place and don't need some kind of device representation for this on the hub as I am assuming).

UniFi Protect settings with above settings

1 Like

@bertabcd1234 got it as far as I know. I am not playing with the webhooks, since I have put so much effort into my drivers otherwise.

I am looking into adding the fingerprint information to my Protect driver. I was sent a sample because the doorbell also sends a fingerprint identified notification over WebSockets. Trying to confirm if the UserID listed is actually matched up with a specific person, what happens when there is an invalid fingerprint, etc... I do not have a doorbell myself so I have to rely on the community for that information. Of course the ID provided is one of Ubiquiti's many character "internal" IDs that are not displayed on any visible page for the end users... so it would require some work to use but hopefully it will be possible.

3 Likes

@snell
Was there any development on this? I just got the G4 doorbell during Black Friday and would be awesome to have the fingerprint reader unlock the front door lock.

1 Like

FingerprintUserID is reported as an event/attribute in my Unifi Protect driver. Someone CAN use it to create a Rule to do things based on the ID provided. However, you would have to check IDs for a bit so you can copy the correct string in as the IDs are using Unifi's "internal" structure in the API (they are long alphanumeric strings that are not displayed in the Unifi UIs anywhere). I have no good way to match those up with actual users and present that in a usable interface within the drivers (just like profiles or such).

Did anyone get this working? I just RMA'd my 3rd v1 doorbell, and was thinking of ebay'ing the replacement and getting this one.

I already have a controllable lock, so I was hoping to take the fingerprint trigger from the G2 doorbell, and run a rule to unlock the lock.

What is it exactly you are trying to do?

I have some rules setup using @snell integration that use the fingerprint.

I believe they're wanting to unlock a lock using the fingerprint from the doorbell fingerprint reader. Many are doing this in Home Assistant.

2 Likes

Well @snell pointed out how to do it. Here is the rule I have using his integration.


It isn't hard to do, the problem is that it isn't easy to identify what the unique UUID is. That will take testing it and then tracking it yourself.

The other option is to use a "Maker API" instance that is connected tothe "Unifi Protect" Parent Device. Then call "ApplyWebHook" command with the correct parms from the Unifi Protect Alarm Manager.

2 Likes

Does anyone know which integration has the most functionality? I'm using the tomw one now, but I see there's one from snell, and then a couple of others. It's not looking like the tomw one has fingerprint, unless I'm on an old version.

What has the most functionality is fairly subjective.

It is actually quite confusing with the Unifi platform on Hubitat. It seems there are a few different integrations with varying functionality based on what the developer was trying to accomplish. I really like what @snell has and it does support passing the Fingerprint UUID to hubitat. He also has the ability to use Unifi Protects Alarm Manager to call webhooks on Hubitat based off events. That opens up allot of possibilities.

@tomw and I have shared a lot of information for our drivers. I am not familiar with any of the other integrations (I have my Network, Protect, and Connect ones) although I know there is an Access one also.

1 Like

@snell Can your driver push data to the screen on the doorbell? I had a rule with the tomw driver that would take a changed temp from an outdoor yolink sensor and then display it on the doorbell screen. I tried using the "push" option, but that doesn't seem to work.

Also, I don't seem to be getting fingerprint auth messages when I put my finger on the reader. Do I have to use the webhook?

No, at present it cannot because I was not aware that was even a thing until I saw your post. I did some research and made a parent and doorbell driver that MAY do it (I do not have a doorbell to try it myself). If you are willing to give it a go, shoot me a message and I will give you the two links.

As for fingerprint, there is the WebHook portion but there is also the notices via WebSockets.

1 Like

Yeah, I'll test it. The tomw driver supports the message to the display. The only problem is that the stupid doorbell doesn't honor newlines, so it just wraps stuff randomly. I'm just displaying "Temp: xx.xF" on it, so not a big deal.

When I scan my fingerprint, nothing is showing up in the logs for the doorbell or the parent device at all. Is there something else I need to configure?

Thanks for being willing to check it! Here are the two links:
ProtectAPI Parent Driver
Doorbell Child Driver

For the WebSockets, do you have Enable WebSocket Monitoring enabled in the preferences for the Parent device? Are all the other normal features working? What level of logging do you have set on the Parent and Doorbell child device? Info logging will not show much usually and Trace logging can reveal a LOT of stuff.

Since I do not have a doorbell, it is a tough area for me to check on (oddly, I had floodlight data worked out early on because I got one of those pretty cheap!). I worked with @mavrrick58 to get the fingerprint and webhook portions working not too long ago and nothing has changed in those areas... so definitely want to figure out what might be wrong.

Websockets are enabled, but still not getting Fingerprint messages from the doorbell. The new driver doesn't error out or anything when sending a notification message to the doorbell. But, it does not update the display. I tried both through the commands menu, and by updating my rule that updates the display with the temp:

[sigh] The difficulty of not having the device... I will try to take a deeper look, but most likely I will need to send you an update to the driver(s) with some debug logging to get information on what might be happening.

I compared your code to tomw's, and it looks like you guys are doing the same thing.

1 Like