{"id":14961243,"url":"https://github.com/p4irin/motion2telegram","last_synced_at":"2026-03-09T10:34:09.553Z","repository":{"id":239047375,"uuid":"797466697","full_name":"p4irin/motion2telegram","owner":"p4irin","description":"A CLI command to configure Motion and notify a Telegram user/group if motion is detected","archived":false,"fork":false,"pushed_at":"2024-07-12T08:08:04.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T18:37:31.367Z","etag":null,"topics":["home-automation","iot","motion","motion-detection","raspberry-pi","surveillance-camera","telegram","webcam"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p4irin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-07T22:25:48.000Z","updated_at":"2025-02-19T22:25:30.000Z","dependencies_parsed_at":"2024-05-09T17:49:01.514Z","dependency_job_id":"3bc39957-f08a-437b-9170-672e68921421","html_url":"https://github.com/p4irin/motion2telegram","commit_stats":null,"previous_names":["p4irin/motion2telegram"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/p4irin/motion2telegram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4irin%2Fmotion2telegram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4irin%2Fmotion2telegram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4irin%2Fmotion2telegram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4irin%2Fmotion2telegram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p4irin","download_url":"https://codeload.github.com/p4irin/motion2telegram/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4irin%2Fmotion2telegram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30291807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["home-automation","iot","motion","motion-detection","raspberry-pi","surveillance-camera","telegram","webcam"],"created_at":"2024-09-24T13:24:16.145Z","updated_at":"2026-03-09T10:34:09.494Z","avatar_url":"https://github.com/p4irin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![motion2telegram CI](https://github.com/p4irin/motion2telegram/actions/workflows/ci.yml/badge.svg)](https://github.com/p4irin/motion2telegram/actions/workflows/ci.yml)\n# motion2telegram\n\n\u003e Motion is a program that monitors the video signal from one or more cameras and is able to detect if a significant part of the picture has changed. I.e., it can detect motion.\n\nSetup a Raspberry Pi with motion2telegram to\n\n- send a picture to a Telegram user/group if motion is detected\n- activate/deactivate motion detection by scanning for the prescence of your mobile phone(s) using bluetooth\n\nUse motion2telegram to apply a pre-configured set of motion and systemd service configuration files and Python scripts to\nsetup your Raspberry Pi.\n\n## Stack\n\n- Raspberry Pi\n    - 1 B+\n    - 4 B\n    - Zero W V1.1\n- Raspberry Pi OS\n    - Lite (32-bit) (Port of Debian Bookworm)\n    - Lite (64-bit)\n- Python 3.11.2\n- Motion 4.5.1\n- Logitech C270 HD WEBCAM\n\n## Prerequisites\n\n- A Raspberry Pi setup with a working network configuration and connected to the internet\n- The Linux BlueZ Bluetooth stack\n    - Installed by default in the latest Raspberry Pi OS\n- [Motion](https://motion-project.github.io/motion_build.html) installed\n- A [Telegram](https://telegram.org/) account\n- A Telegram [bot token](https://core.telegram.org/bots/tutorial#obtain-your-bot-token)\n- The bluetooth MAC address(es) of your mobile phone(s)\n- Bluetooth enabled on your mobile phone(s)\n- A user on Raspberry Pi OS to run the motion service. motion2telegram installation and motion service configuration is done in the context of this user. The user MUST be a member of the groups _motion_ and _video_\n- A Python virtual environment\n\n## Install with pip\n\nLogin with the user created to run the motion service. Create a directory, e.g. motion2telegram, and cd into it. From here on, you'll work in this directory. Create and activate a Python virtual environment and then\n\n```bash\n(venv) $ pip install motion2telegram\n...\n# Verify by version\n(venv) $ motion2telegram -V\nx.y.z\n(venv) $\n```\n\n## Configuration\n\nCreate a `motion.env` file with the following command.\n\n```bash\n(venv) $ motion2telegram --init\n```\n\nThis file is used by\n\n- the motion service to retrieve\n    - the Telegram bot token and\n    - the recipient's chat id.\n- the mobile phone scanner to retrieve \n    - bluetooth MAC address(es) and\n    - the scan interval\n\nSpecify your Telegram chat id and bot token in the file `motion.env`\n\n```bash\n# motion.env\nTELEGRAM_BOT_TOKEN=\nTELEGRAM_CHAT_ID=\n```\n\nSpecify the bluetooth MAC address(es) and time between scans in `motion.env`\n\n```bash\nBLUETOOTH_ADDRESSES_PHONES=\nMOBILE_PHONE_SCAN_INTERVAL=300\n```\n\nConfigure motion with\n\n```bash\n(venv) $ motion2telegram --configure\n```\n\nThis will install preconfigured files using the environment variables set in `motion.env` and references to Python scripts to run.\n\n- `/etc/motion/motion.conf`\n- `/lib/systemd/system/motion.service.` and\n- `/lib/systemd/system/mobile_phone_scan.service`\n\nMotion is configured to write\n- logs into `log/motion.log` and\n- media files into `media/YYYYMMDD`\n\nrelative to the current directory. Media captured on the same date are grouped together in a `YYYYMMDD` directory.\n\nThe motion and mobile_phone_scan systemd services will reference the `motion.env` file in the current directory for the chat id, bot token, bluetooth MAC address(es) and scan interval. The command will stop, configure and bring the motion and mobile_phone_scan service back up. If you need it, motion's process-id is written to motion.pid in the directory you installed motion2telegram.\n\n## Reference\n\n- [Motion](https://motion-project.github.io/)\n- [Telegram](https://telegram.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp4irin%2Fmotion2telegram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp4irin%2Fmotion2telegram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp4irin%2Fmotion2telegram/lists"}