Skip to content

zhiftyDK/motiondetect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

motiondetect.js the webcam motion detector library

Get Started

Include the library in your .html file

<script src="https://zhiftydk.github.io/motiondetect/motiondetect.js"></script>

Start the bot

First of all you need to install the telegram app

Then in the app search for @TheMotionDetectorBot

Now open the bot and click start

Initialize motion detector

Example: Full setup with all possible varaibles

//The motion detector is using telegram to send messages!
const config = {
    token: "beta", //REQUIRED Right now the token is just "beta"
    chatId: "1234567890", //REQUIRED How to get telegram chatId https://www.alphr.com/find-chat-id-telegram/
    message: "Motion is detected!", //OPTIONAL Default message is "Motion is detected!"
    displayVideo: false, //OPTIONAL Boolean.. Default is false
    detectThreshold: 50, //OPTIONAL integer.. Default detectThreshold is 50
    botId: "5338504929:AAHZulboa7YpUPDjU3QgqPI9JUARlHuj5YI", //OPTIONAL This is the defualt telgram botId for TheMotionDetector bot
}
const md = new motionDetect(config); //Create new detection instance with the config

Example: Simple setup with fewest possible varaibles

//The motion detector is using telegram to send messages!
const config = {
    token: "beta", //REQUIRED Right now the token is just "beta"
    chatId: "1234567890", //REQUIRED How to get telegram chatId https://www.alphr.com/find-chat-id-telegram/
}
const md = new motionDetect(config); //Create new detection instance with the config

Start motion detector

md.start(); //Start the detection from the webcam

Stop motion detector

md.stop(); //Stop the detection from the webcam

Bot response example

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published