motioneye-project / motioneye

A web frontend for the motion daemon.
GNU General Public License v3.0
3.97k stars 651 forks source link

Why no "on_event_stop" action? #132

Open Puzzlr opened 8 years ago

Puzzlr commented 8 years ago

I noticed that under "Motion Notification" you can add a command to be executed. However this is only added to the "on_event_start" directive in de thread-?.conf file. Luckily, if you manually add a "stop" command to "on_event_stop" directive it does not get overwritten.

I use the start / stop commands to flip a virtual motion detection device in Domoticz (a home automation system) whenever motion decides a motion event either starts or stops, so I can use my IP camera as a motiondetector as well.

Why no seperate options to add a mail / webhook / command option on event start and stop?

ukasiu commented 8 years ago

I'd also like on_event_stop action. And it's even been here https://github.com/ccrisan/motioneye/issues/56

Puzzlr commented 8 years ago

Mmmm, I just now discovered that my thread-1.conf did get overwritten erasing my added /usr/bin/curl -s "http://Domoticz_IP:port/json.htm?type=command&param=switchlight&idx=32&switchcmd=Off". The motion sensor now only receives "On" commands, rendering it rather useless. This behavior of motioneye seems to restrict the original behaviour of motion. Is that intentional?

ccrisan commented 8 years ago

The reason why on_event_stop is overwritten is that motionEye uses it internally to remove the "motion detected" red frame. Unfortunately there's no way to make it execute custom commands with the current version. I'll think of a way to allow executing extra commands when the event stops.

maxholgasson commented 8 years ago

That would be great! I also need it to start a counter and count time since last detection

chrisf4lc0n commented 7 years ago

Instead of adding it under Motion Notification define it in the Extra Motion Options. I have done it for the WiFiPlug, so if the feed gets lost it flicks the plug off and on. on_event_end