I have installed motioneye on a raspberry pi and it's working perfectly (images and videos are recording which I can access through FTP). Motion detection is enabled with a mask.

I have written a .py script that will open a new web browser displaying the streamed video so colleagues around the office can see at a glance who has entered the building (the script works perfectly when exectued in PyCharm)

I have placed the executbale .py file in /home/data/browse.py

However, it doesn't seem to execute when motion has been detected and captured/recorded.

Can anyone help please?

1 Answer 1


it sounds like your script either needs to be running constantly and monitoring the motion process or you could try the motion notification options. There's a setting in there to run a command at the completion of an event i.e. when it's detected motion. So if you used that to run your script then each time motion is detected it should run you script and bring up the web browser. I'm not sure whether it will run the command after the event though so it may run the script after its finished detecting motion i.e in your case when the person has left reception. So another possibility is under the file settings where there is also an option to run a command on creation of a file so if your camera photographs or starts recording when someone enters then as soon as that file is created it should run your script. Hopefully that helps :)

  • Thanks a lot - I have set my python script to run on motion detected. as provided by the settings. So: 'Command' = /data/browse.py. The issue is that the script appears to run but the web browser is not opening. So the Motion Notifications do not appear to be working correctly or I have placed the .py in the worng folder?
    – Deadulus
    Jan 25, 2019 at 16:55
  • Looks like it should be working to me. The only thing I can think of is if maybe it wants you to specify python in the command so Command = python(python3 -whichever you've used) /data/browse.py
    – rohtua
    Jan 25, 2019 at 16:58
  • Yes - tried that too, still nothing is activated. All images and mp4 files are being captured. The .py works in py charm so I am not sure why its not working.
    – Deadulus
    Jan 25, 2019 at 17:02
  • It wouldn't fix it in the ideal way but if you had another pi or server you could set that to monitor the output folder where the media files are stored and then run your script locally on that server when there's a new file added to the folder..... I've ended up doing that this week to sort out one of the scripts I'm running on motioneye. I think with motioneye there's a few bugs that don't get picked up unless you're trying to doing something script related or outside the web interface.
    – rohtua
    Jan 25, 2019 at 17:26
  • Just looking at my motioneye pi it does let me access and edit the crontab file. Maybe if you added the script in there to run every minute but check the data folder for new files as a test before running the main script it would serve as a work round.
    – rohtua
    Jan 25, 2019 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.