Giter Club home page Giter Club logo

raspberry_pi_home_security_system's Introduction

Home security system with Raspberry Pi and sending notifications with a Telegram bot

Linter

Tutorial to build a home security system with Raspberry Pi and sending notifications with a Telegram bot.

How it works

  • When a movement is detected, the application records a video that is sent to your phone by the Telegram bot.
  • Once installed, the surveillance system is managed from your smartphone with bot commands from the Telegram app.
  • The system is started by a systemd service activated at boot time

Prerequisites.

Connect the PIR sensor

image

Setup

  • Open the config.py file 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'

Installing

The installation requires root rights:

A reboot will be done at the end of the installation to activate the camera hardware

sudo make install

Bot's commands

  • /start : start the home surveillance
  • /stop : stop the home surveillance
  • /status : show the status of home surveillance
  • /photo : take a picture
  • /video time= : records a video, by default delay is 60s
  • /clean : remove all files in video folder
  • /help : show help

Details

  • 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 config.py

  • It's possible to add other commands to the bot in app.py

Testing

make test

Uninstall

sudo make uninstall

A reboot will be done at the end to deactivate the camera hardware

Built With

Hardware:

  • Raspberry Pi Zero WH
  • Infrared Camera v2 8MP
  • HC-SR501 PIR Motion Sensor Module

Libraries:

raspberry_pi_home_security_system's People

Contributors

dependabot[bot] avatar m0by314 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

raspberry_pi_home_security_system's Issues

Failure test

Hi thanks for your great app.
recently I had to reinstall the app but now I have this error mesage from the test. Iand I had no detection after /start the bot
Thnks in advance

FAIL: test_motion_detected (testsuite.pir_test.TestPir)
Test function movement_detected()

Traceback (most recent call last):
File "/home/pi/raspberry_pi_home_security_system/testsuite/pir_test.py", line 16, in test_motion_detected
self.assertFalse(motion, F"Function motion_detected() must be return False i nstead of {motion}")
AssertionError: True is not false : Function motion_detected() must be return Fa lse instead of True


Ran 11 tests in 13.286s

FAILED (failures=1)

Take a picture ontop of a recording

hey. good app and it works for me pretty good. one thing i would wish to have is that when motion detected that it sends a snapshot or maybe multiple snapshots instantly. would that be possible?

requirement is not longer available

I just downloaded your files and tried to install it.

Following failure occurred:
--- Requirements installation ---
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting request==2019.4.13 (from -r requirements.txt (line 1))
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/request/

see also discussion:
https://stackoverflow.com/questions/62927162/no-matching-distribution-found-for-multiple-packages

The bot itself works, when I comment out "#request==2019.4.13" but it seem the PIR doesn't work anymore or what are the dependencies to this package?

Regards
Strike

The program Hangs

After several hours the application stop sending vidéos to Télégarm when motion is detected even if taking a photo or a video is still working.
ps : I'm using a Raspberry pi Zero 2W.

only accept commands from specified telegram clients

Sorry, I saw no other way to contact you.

To have a minimum security level it should be possible that the bot only accepts commands from specified telegram client ids.
Otherwise others could easily use your device to break your privacy.
It think some kind of id list as a textfile or something would be enough!

Thanks a lot and good work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.