A tiny DIY home video security tool for Raspberry Pi. Written in Python using OpenCV and Telegram API (for notifications).
It is quite dark near my apartment entrance door, so in addition to a motion light sensor I have written this small script which tracks
any motion when light turns on and sends me a GIF animation in a private telegram group. See raspguard/settings.py
to configure telegram.
1. Clone the raspguard repo
git clone [email protected]:aogz/raspguard.git
2. Install requirements
cd raspguard
mkvirtualenv -p python3 raspguard # Or virtualenv -p python3 venv && source venv/bin/activate
pip install -r requirements.txt
Install OpenCV on Raspberry Pi
3. Create bot and channel and make bot admin
How to create a bot and How to create a channel
4. Then make your bot channel administrator
- Open Channel info (in app title)
- Choose Administrators
- Add Administrator
- There will be no bots in contact list, so you need to search for it. Enter your bot's username
- Clicking on it you make it as administrator.
5. Set bot api key and channel in settings
Lifehack: If you want to use a private channel, use one of these solutions:
How to obtain the chat id of a private telegram channel
6. Play with settings.SENSITIVITY and settings.MIN_CONTOUR to get better results
7. Connect a camera to your awesome Raspberry Pi
python start.py
crontab -e
Add this at the end of the file:
@reboot python3 /home/pi/raspguard/start.py # replace with your own path