Include the library in your .html
file
<script src="https://zhiftydk.github.io/motiondetect/motiondetect.js"></script>
First of all you need to install the telegram app
Then in the app search for @TheMotionDetectorBot
Now open the bot and click start
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
md.start(); //Start the detection from the webcam
md.stop(); //Stop the detection from the webcam