Tutorial to build a home security system with Raspberry Pi and sending notifications with a Telegram botHow it works
When a movement is detected, the application records a video that is sent to your phone by the bot.
Once installed, the monitoring system is managed from your smartphone with the bot's commands.
The system is started by a systemd service activated at boot time
- Raspberry Pi Camera Module
- PIR motion sensor module
- 3 female-to-female jumper wires
- Tutorial for create your Telegram Bot
- After starting the bot on your smartphone, you must retrieve your chat_id at the following address :https://api.telegram.org/bot<token_id>/getUpdates
Setting up the camera hardware
sudo raspi-config nonint do_camera 0
After this action reboot the raspberrySetup
- Open the
config.pyfile and configure the TOKEN_ID and CHAT_ID variables with your token_id and your chat_id
# Variable to configure
TOKEN_ID = 'Your token_id'
CHAT_ID = 'Your chat_id'
Before installing set your token_id then:
sudo make install
- /start : start the home monitoring system
- /stop : stop the home monitoring system
- /status : show the status of the monitoring system
- /photo : take a picture
- /video <delay> : records a video, by default delay is 60s
- /clean : remove all files in video folder
- /help : show help
- By default, the duration of the video is set to 60s. If you want change this, you need to modify the VIDEO_TIME constant in
- It's possible to add other commands to the bot in
app.pywith the decorator @bot.handler()
return bot.send_message("Hello World")
sudo make uninstall