Proposed Integration: Camera Rich Notifcations

I’ve been working on an integration (in my head) to provide sophisticated rich notifications for security cameras (e.g., Reolink). I plan to work on it (in code) over the coming weeks and hope to start a discussion for feedback, suggestions, questions, architectural advice, etc. Or maybe advice that my requirements are already met by tweaking some Reolink settings, and it’s not that big of a deal?

And, most of all, anything that already exists. I have a Reolink NVR system and have seen a handful of Blueprint-based solutions (such as this one by @jterrace, which I’m generally pretty happy with). However, his blueprint and others aren’t sophisticated enough for my fairly simple setup, and I feel like I need more. It seems to me an integration is necessary.

My background: Reolink NVR with 2 “overhead” cameras (Front and Backyard) and a Doorbell cam (which has similar coverage to the front yard cam). My main problem with ha-reolink-rich-notifications is that I get WAY too many notifications. If I’m in the front yard for 20 minutes I’ll get a dozen or more notifications duplicated by two cameras. If I have my dog with me I’ll get another two dozen (animal detection on the Reolink).

I’m planing this with my setup in mind – several cameras. Reolink, etc. Of course, I’ll try to make it as generic as possible, but I don’t know what I don’t know.

Requirements:

  1. Sophisticated persistence of recent camera state and recent notifications sent. This is, IMO, one of the biggest things lacking from blue-print based solutions. This isn’t a feature by itself, but enables a bunch of other stuff.

  2. Camera notification “cooldown” period. Some of the BP-based solutions have a “skip notifications if the same camera has already triggered a notification within a short time period (20 seconds by default)”. This makes sense in some scenarios but not others. If I’m in the front yard then that just means I’ll “only” get 60 notifications in 20 minutes. I think a better design (using the persistence) is to send a notification when there is a new person (or animal / car / etc). “New” is determined by the fact that the sensor didn’t come OFF->ON for some period of time. (In theory cameras could solve for this by not switching the sensor ON->OFF if the person doesn’t leave the frame, but my Reolinks don’t do this in practice.)

  3. Ability to configure camera overlap. E.g., “front doorbell” and “front yard”. A notification for a person in “front yard” isn’t sent if a notification for person on “front doorbell” has recently been sent. (Maybe respecting the cooldown period?) These could be configured directly, or use HA’s areas?

  4. Helper(s) to disable notifications for different cameras and/or areas and/or event types. Once I have “home state” setup (e.g., home / away / guests), I’ll set up something to stop notifications. You could do things like turn off notifications for 2 minutes after you unlock your door in the morning to prevent notifications of your back as you leave the house.

  5. Configurable notification actions to Mute notifications for some period of time. Provide configuration to run other scripts (e.g., unlock the door).

  6. Version 2? - Configurable hierarchy of cameras for the “best” camera. E.g., if both Front Yard and doorbell alert then I want the image from the doorbell as it’s probably higher quality. (One issue is that the doorbell might alert 0.2 seconds after the front yard cam alerts, so maybe it would be useful to delay any automation for, e…g, 0.25 seconds so that it has time to determine the best.)

  7. Related, would be the ability to delete older notifications. So a doorbell alert 5 seconds after a front yard alert (and while the front yard hasn’t passed the cooldown period) might be deemed “better” and cause the doorbell notification to be sent (even though it otherwise wouldn’t since they’re in the same zone and shorter than cooldown period) and also delete the previous front yard cam notification.

  8. Version 3? “Better” image detection. The first alert of a person is probably the person pretty far away, and the image is likely to get better a few seconds later. Detect that the image is “better” and replace the previous notification.

  9. Version 3? Face recognition. (I was really bummed to realize that Reolink doesn’t do this.)