Setting up Alerts with Webhooks

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
grabrail
Posts: 3
Joined: Mon Mar 09, 2020 1:52 pm

Setting up Alerts with Webhooks

Post by grabrail »

Hi

I am brand new to Zoneminder and I have managed to get a good install working on an Ubuntu server with the latest version of Zoneminder.

My camera is connect to an Rpi in my garage and streaming using ffmpeg via an rtsp stream and all is working fine.

I am now setting up alerting for when an event or alarm is triggered and this is what I have so far.

1) set up anapplet in IFTTT using webhooks and Telegram
2) configured a small script on my Ubuntu server that triggers the IFTTT webhook when run as a .py file
3) When this is triggered IFTTT sends a message to my Telegram messeging account which gives me an alert.

This all works perctly so far.

4) in Zoneminder, i have created a filter that monitors alarm frames with a threshold of 50. This will then Execute command on all matches and i out the path to my script that triggers the web hook.

This still all works perfectly.

Now, my problem is when i get an alert I get loads of alerts. I get my lad to walk in front fo the camera for a few minutes and I recieve around 50 to 60 alerts

What I want to achieve is that I get one alert when the "event" happens, I want it to then record for 5 mins or 300ms withou any more alerts being triggered.

On the settings for my camera I have section length set to 300 which I assume is 300ms, but this doesnt seem to make any difference, I still get loads of alerts and also varying size recordings.

Can someone help me to

a) set up so when motion is detected I will get a 5 minute recording every time
b) only one alert ( or run of the script ) per recording

Thank you
grabrail
Posts: 3
Joined: Mon Mar 09, 2020 1:52 pm

Re: Setting up Alerts with Webhooks

Post by grabrail »

ok so I am one step closer to resolving this. I hadn't see then Min Section length otion, which I have now set to 180 seconds, and also set section length to 180 seconds and tested. The recording length is ideal now (3mins instead of 5)

Also only one alert per recording, which is great, but. The alert comes as teh recording ends, rather than when it starts. Looking through the available options within the filters I'm not sure how I would get it to run the trigger as the event starts. :x
rockedge
Posts: 1174
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Setting up Alerts with Webhooks

Post by rockedge »

I will have to look way back in this forum under an older version of ZM. I had written a script that limited only one message per alarm event and posted the code. Maybe I can find it again because I think you can modify it or use the same mechanism for your application.

Someone had a similar problem with being flooded by emails and text messages.
grabrail
Posts: 3
Joined: Mon Mar 09, 2020 1:52 pm

Re: Setting up Alerts with Webhooks

Post by grabrail »

Hi, thanks for that. That is more or less what is happening to me. It seems the alarms are being produced at the end of the event, which would be nice if i can chage that to be at the beggining of the event.

My camera appears to also be having some issues with temporarily dropping out thus ending the event svery early, and ending up with me being flooded with messages again.

I am currently using a USB cam but may move to the Pi Camera module to see if this works better
Post Reply