一组python脚本,用于自动化覆盆子pi和telegram驱动的保姆cam。
nannypi的Python项目详细描述
南皮
这个项目是创建一个电报功能保姆摄像机使用树莓皮和USB摄像头。
项目安装
运行脚本
编辑/etc/default/motion文件: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
编辑运动配置文件:sudo vim /etc/motion/motion.conf
选项on_picture_save
被注释掉。删除注释并添加以下内容。
on_picture_save /opt/nannypi/venv/bin/send_telegram_media.py --delete --file %f
python脚本信息
这是一个更大的回购协议的一部分,创建了一个支持电报的保姆摄像头。有关完整信息,请参见主回购协议:nannypi。
安装python脚本
pip install nannypi
发送电报媒体.py
此脚本将使用cli参数将媒体发送到电报。
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