sp-engineering / frigate-viewer

GNU General Public License v3.0
11 stars 4 forks source link

Feature request: Event notifications #2

Open cybersholt opened 7 months ago

cybersholt commented 7 months ago

Recently started using Frigate and found this app, it would be awesome if there was a setting that could be toggled that enabled notifications whenever an event occurs.

Possibly could also filter the events to only get notifications for person for example.

piwko28 commented 7 months ago

I've considered such feature, but the problem is that Frigate does not provide API to achieve it. There are two ways to achieve it:

  1. Push notifications - by installing additional service next to Frigate, which would collect events and send notifications. Complexity increases drastically for normal users and in fact it would be easier to install Home Assistant or similar software to achieve same goal.
  2. Local notifications - does not need to install anything, but this approach has some limitations: events would be checked periodically and not often that each 15 minutes; it also drains phone battery, because the phone would be responsible for cheching for new events.

I'm not such whether it's still so desirable with that perspective.

cybersholt commented 7 months ago

@piwko28 Thanks for the detailed response, I was surprised myself that they don't have any API for this. I was thinking the app may be able to do something since it has access to the events, sort of like check every 5 minutes, if the event count has increased send notification. Obviously there are several ways to get there.

Right now what I use is docker-wyze-bridge to generate my camera feeds, it then supports ntfy.sh which is pretty cool universal notification platform.

Anyways Thanks again for the feedback and keep up the great work!

P.S. Any plans on releasing an iOS version? I'd love to have this for my iPad.

piwko28 commented 7 months ago

I'm working on proof-of-concept of local notifications, but I'm sure your solution will work better for you.

Re. iOS: I don't earn any money on it, and maintaining developer account on Apple costs $100 per year. I even don't have any iOS devices ;) But I don't mind if anyone with dev account would publish it on iOS app store, it's open source though.

cybersholt commented 7 months ago

@piwko28 that's awesome to hear!

My system does work but isn't the easiest solution for sure. I also have experience with Android apps and can help you test it out. Speaking of that you might find it beneficial to enable a beta channel on Android store, really helps test new releases.

I also agree with you 100% about Apple, paid them for years for the privilege of an app developer account really for nothing but I do have an iPad that makes a killer desktop monitor for cameras.

Anyways if I can help in any way just let me know. I'll also start another issue for some visual bugs I found in the log section.

Keep up the good work!

maxdd commented 2 months ago

I was also looking into this particularly to receive notifications over telegram for example. I was thinking of adding a telegram.py to handle the notification directly inside of frigate comms since the main issue is that polling is really terrible for this use case.

I was also thinking of a simple standalone http python like

  1. GET http://ip:port/api/events?after=<now-1m>
  2. get last item and save its <id>
  3. if <id> is different than previous send over telegram the event together with http://ip:port/api/events/<id>/clip.mp4
  4. send last <id>
  5. sleep(1m)

This could be even extended to include all the id that have never seen before e.g. in a list but still it is more of a "delayed" notifications