Skip to main content

nannypi

This project is to create a telegram-enabled nanny cam using a raspberry pi and a usb webcam.

Project Installation

Run the script

Edit the /etc/default/motion file: sudo vim /etc/default/motion

# set to 'yes' to enable the motion daemon
start_motion_daemon=yes

TELEGRAM_BOT_TOKEN=<telegram_bot_token>
TELEGRAM_CHAT_ID=<telegram_chat_id>

export TELEGRAM_BOT_TOKEN
export TELEGRAM_CHAT_ID

Edit motion config file: sudo vim /etc/motion/motion.conf The option on_picture_save is commented out. Remove the comment and add the following.

on_picture_save /opt/nannypi/venv/bin/send_telegram_media.py --delete --file %f

Python Script info

This is part of a larger repo created to create a telegram-enabled nanny camera. See the main repo for full information: nannypi.

Install Python Scripts

pip install nannypi

send_telegram_media.py

This script will send media to telegram using cli arguments.

python send_telegram_media.py -h
usage: send_telegram_media.py [-h] [-f [FILE [FILE ...]]] [-t TOKEN]
                              [-c CHAT_ID] [-d]

Send media images to a Telegram Chat.

optional arguments:
  -h, --help            show this help message and exit
  -f [FILE [FILE ...]], --file [FILE [FILE ...]]
                        Files to send
  -t TOKEN, --token TOKEN
                        telegram token. Can also be specified with the env
                        variable TELEGRAM_BOT_TOKEN.
  -c CHAT_ID, --chat-id CHAT_ID
                        telegram chat id. Can also be specified with the env
                        variable TELEGRAM_CHAT_ID
  -d, --delete          delete file after sending

Metadata

Release files for nannypi 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nannypi 0.1.2
File Size Uploaded
nannypi-0.1.2.tar.gz 3.2 kB Details

Release files / nannypi-0.1.2.tar.gz

Download URL nannypi-0.1.2.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d55fa234a8ce0fbcc679352655e77f994ee3840a8b3f563f24698f93f98135ae
BLAKE2b-256 checksum
How to use checksums
a6f27db545a416e88e928a29e08e4a9c1df7ac0ff289d4997c0529822d8d2483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page