-
Notifications
You must be signed in to change notification settings - Fork 102
How to Run Your Own Script after Motion Tracking Activated
A template python script file called user_motion_code.py can be found in the pi-timolo folder. Code in this file is imported by pi-timolo.py and will be executed when motion tracking is triggered but after motion image or video is taken. Note Motion tracking option must be activated per config.py variable motionTrackOn = True
If the file cannot be found then run an upgrade from the menubox.sh script. The file will be downloaded with the latest curl pi-timolo-install.sh install. if user_motion_code.py does not exist it will be downloaded. An existing file will not be overwritten to avoid losing user customization.
You may add python code to the user_motion_code.py file. If specialized python libraries need to be loaded for your user motion routine, you can add them to the top of the user_motion_code.py file and then call them in the userMotionCode() function. The userMotionCode function is passed the filename path variable of the image or video file so it can be used for example in your code if desired. This can be useful if you need to add an attachment or process the motion track media file. You can also add other functions to user_motion_code.py as long as they are called directly or indirectly somewhere inside the userMotionCode function since that is the only function that is called within pi-timolo.py script if motion is detected.
- Wiki Home
- Introduction
- Prerequisites
- Install or Upgrade
- Run pi-timolo from a drive mnt
- Customize config.py
- Panoramic Images
- user_motion_code.py
- Align Camera Motion Area
- Schedule StartAt
- Basic Troubleshooting
- Tuning Variable Settings
- menubox.sh
- Web Server View Files
- Make Timelapse Video
- Join or Convert h264 to MP4
- Run on Boot
- Setup & Run shutdown.py
- Rclone Media Sync
- watch-app.sh Usage
- Plugins Usage
- Mount USB Storage
- Mount Network Share
- Auto SubFolder Creation
- Manage Disk Space
- Utilities Summary
- GitHub Repo
gdrive is no longer default.