billw2 / pikrellcam

Raspberry Pi motion vector detection program with OSD web interface.
GNU General Public License v3.0
262 stars 70 forks source link

Request: Motion Event in Region Triggers Custom URL #15

Open ghost opened 8 years ago

ghost commented 8 years ago

Is it possible to have http triggers? That is notion is detected it opens an custom url?

The reason I ask is that I would like it to have it included in my home automation. Such that I can send myself a message when a motion happens (in a region).

The other reason is I would like to use the motion detection with regions to detect walk direction and zone (= room or part of room) occupation. And of course record everything.

https://www.domoticz.com/forum/viewtopic.php?f=35&t=8390&p=90277&hilit=motioneye#p90277 http://domoticz.com/forum/viewtopic.php?f=23&t=11908&p=85624&hilit=camera+zones#p85624

billw2 commented 8 years ago

On Fri, 08 Jul 2016 21:38:49 -0700 Tristan Crispijn notifications@github.com wrote:

Is it possible to have http triggers? That is notion is detected it opens an custom url?

The reason I ask is that I would like it to have it included in my home automation. Such that I can send myself a message when a motion happens (in a region).

The other reason is I would like to use the motion detection with regions to detect walk direction and zone (= room or part of room) occupation. And of course record everything.

https://www.domoticz.com/forum/viewtopic.php?f=35&t=8390&p=90277&hilit=motioneye#p90277 http://domoticz.com/forum/viewtopic.php?f=23&t=11908&p=85624&hilit=camera+zones#p85624

It's a todo I am planning on because I have in mind being able to do motion tracking with servos. I'm planning to have a real time status file or pipe of the motion event in progress updated with position, magnitude and direction of each detection as it happens. This will be something a motion begin script can monitor throughout a motion event and take action on as the event is in progress.

Right now all you can do is a post processing of the event because the file with the information may not be flushed until the event ends. You can get a csv file of the motion event by enabling motion_stats in pikrellcam.conf and the file will be written alongside the video in the videos directory. But this is something for a motion end script to look at so is probably not what you wanted.

Bill

ghost commented 8 years ago

That would be very very great! The position, magnitude and direction of each detection will be most helpful in fine-tuning walk direction! That would be awesome! But just a trigger when motion is triggered in a region (& starts recording) would be just fine.

Egregius commented 7 years ago

The new /run/pikrellcam/motion-events is awesome, thank you for that! I altered a bit your motion-send-alarm2 script and came up with this: region.txt

It can call a different http request for each region. I'm planning on working on this further to have it more integrated in my Domoticz and notification system.

edit: sorry, had to upload as txt. Don't know how to post code in a comment.