Skip to content

Thin wrapper around motion that connects it to a Telegram Bot

License

Notifications You must be signed in to change notification settings

mtantawy/MotionTelegramBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MotionTelegramBot

This is a thin wrapper around motion that connects it to a Telegram Bot

It works by configuring motion to call web endpoints when certain events are triggered, and also allows the bot to control motion by calling its web control endpoints

How to run on a RaspberryPi using docker

  1. run mvn package to generate a jar
  2. Create a dir MotionTelegramBot under /home/pi (or elsewhere but make sure to update the path in the docker run command)
  3. Run the following after replacing placeholders
docker run -d \
-v /home/pi/MotionTelegramBot/:/jar \
-w /jar \
--network="host" \
-e BOT_CHAT_ID=<chat id> \
-e BOT_USERNAME=<username> \
-e BOT_TOKEN=<token> \
-e MOTION_PORT=<port> \
-e MOTION_CAM_ID=<cam id> \
--rm arm32v7/eclipse-temurin:17 java \
-jar MotionTelegramBot.jar
  1. Optionally inspect logs to confirm no errors
  2. The bot sends a "Hello there!" message when it boots up

Todo

  • Explain how to get values for the placeholders
  • Explain changes needed to motion.conf
  • Explain why --network="host" is needed
  • Explain how to run directly with java without docker

About

Thin wrapper around motion that connects it to a Telegram Bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages