hjdhjd / homebridge-unifi-protect

:video_camera: Complete HomeKit integration for all UniFi Protect device types with full support for most features including HomeKit Secure Video, and more. https://homebridge.io
Other
1.45k stars 93 forks source link

Managing smart notifications on protect vs homekit #1049

Closed reustmd closed 6 months ago

reustmd commented 6 months ago

Homebridge UniFi Protect Version

v6.19.0

Homebridge Platform and OS

Synology DSM 7

Homebridge Version

v1.7.0

Node Version

v18.15.0

UniFi OS Version

v3.2.12

UniFi Protect Controller Version

v3.0.22

Describe the problem

Here's what I'd like to happen, I have a unifi doorbell camera. There's actually 2 cameras, one is human level, the other is package level, but let's just focus on the human level camera. When that camera detects a person on my porch (not on the sidewalk or street it also sees, so I need a detect zone to filter those out) I'd like a notification on Homekit (popup on phone, ipad, actually pop up the camera on apple tv, etc).

Now, I'm trying to follow the best practices here: https://github.com/hjdhjd/homebridge-unifi-protect/blob/main/docs/BestPractices.md, but I'm afraid it's not 100% clear to me how to fully configure things.

So per the guide, I am trying to set up protect to be the smart notification detection system, and then just turn on vanilla notifications in homekit. The problem is that homekit doesn't seem to care about the unifi protect smart detection zones. I get a protect app notification as expected, only when a person enters the smart zone, but homekit shows person alerts regardless of whether a person is inside or outside of the protect zone. I can fix this by also adding homekit activity zones, but my reading of the guide suggests that the smarts (zones, type of items to detect, etc) should only be in protect, and just have basic notifications setup in homekit.

Can you please point me in the right direction?

Perhaps it'd be helpful if you enumerate all the correct options on each system for my desired behavior, assume I've got a smart detect zone setup in protect:

  1. Does it matter what detection targets are in protect? Will it pass the type of item into homekit?

In homekit, for that same camera with the protect smart detect zone:

  1. Do I need stream & allow recording on?
  2. Should there be activity zones setup in homekit as well, or no?
  3. I should have Activity Notifications on?
  4. If so, should those be for a clip is recorded, any motion, or specific motion?

Homebridge HBUP JSON configuration

n/a

Relevant log output

n/a

Acknowledgment that you are only running UniFi OS and UniFi Protect releases from the Ubiquiti Official release channel

hjdhjd commented 6 months ago

I’m going to have to revisit the best practices. It’s a couple of years out of date at this point for some things.

Read: https://github.com/hjdhjd/homebridge-unifi-protect/blob/main/docs/HomeKitSecureVideo.md

For a sense of how HomeKit Secure Video and the native Protect notifications interact with each other. That’s the crux of your question.

The TL;DR: if you want to use HKSV, simply enable it and ignore anything from the Protect controller itself and allow all motion detection to happen that way. Enabling HKSV -> lots of how-to guides out there on any Apple-related news site (iMore, etc.). Meaning: leave the defaults as-is on the Protect controller and simply configure things in the Home app.

This type of question is best addressed on the Discord - I’d suggest you hop on there, the community it quite helpful.

Hope this helps.

reustmd commented 6 months ago

Super helpful, thank you.

Honestly, I don't care about HKSV one way or another, I was just fussing around trying to get this to work. I'll read that doc and take follow-up questions to the discord, thanks!

hjdhjd commented 6 months ago

It’s all in what is the definition of “getting it to work”. 😄

By default, “out of the box”, HBUP makes all your cameras available in HomeKit. That’s the whole promise of HBUP after all. There’s a lot of customization you can choose to embark on from there. If you’re beginning your journey: just focus on HomeKit. Meaning you’ve left all the defaults on the Protect controller (e.g. not trying to customize activity zones for individual camera on the Protect controller, etc.). HomeKit will see all the cameras as truly native, full-featured cameras complete with HomeKit Secure Video support.

Within HomeKit: motion detection works by default. When you want to get “fancy”…meaning (hey, I want person detection or animal detection, etc.)…the “easy” way to do it within the HomeKit universe: enable HKSV. It is the only way that HomeKit will provide you specific notifications like: The “XYZ” camera has detected an animal. It’s crucial to note: there is no other way to generate a rich notification like that within HomeKit. So if that’s the goal you’re targeting, that’s the path to do it.

If you want something that is more than what HomeKit allows you to customize through it’s version of activity zones and activity notifications - then you’re back to interacting with the Protect controller, along with the potential subsequent loss of a certain elegance within the HomeKit rich notification scheme, but with the ability to create generic motion event notifications.

Hope this helps…and thank you for calling the best practices document to my attention. I’ll need to get into a good headspace and revise it substantively soon. What’s there is correct and makes sense for a pre-HKSV world.

github-actions[bot] commented 6 months ago

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.