Sign inSign up

ssyl/nest-telegram-sync

By ssyl

•Updated 10 months ago

Sync video clips from your Google doorbell cameras to a Telegram channel

Image
Internet of things
0

1.7K

ssyl/nest-telegram-sync repository overview

⁠Google Nest Camera to Telegram Sync

Syncs Google Nest camera videos to Telegram with event types (person, package, animal, vehicle, motion, sound).

For personal or educational use only.

⁠Quick Start

⁠1. Get Google Master Token
docker run --rm -it breph/ha-google-home_get-token

Tip: Use an app-specific password from https://myaccount.google.com/apppasswords⁠

⁠2. Create .env File
# Required
GOOGLE_MASTER_TOKEN="aas_et/YOUR_TOKEN_HERE"
GOOGLE_USERNAME="[email protected]"
TELEGRAM_BOT_TOKEN="1234567890:ABCdefGHIjklMNOpqrsTUVwxyz"
TELEGRAM_CHANNEL_ID="-1001234567890"

# Optional
TIMEZONE=US/Central              # Auto-detected if not set
TIME_FORMAT=12h                  # Options: 24h, 12h, or custom strftime
REFRESH_INTERVAL_MINUTES=2       # How often to check for new events
DRY_RUN=false                    # Set true to test without sending
LOG_LEVEL=INFO                   # DEBUG, INFO, WARNING, ERROR
⁠3. Run with Docker Compose

docker-compose.yaml:

services:
  nest-sync:
    image: ssyl/nest-telegram-sync:latest
    container_name: nest-telegram-sync
    restart: unless-stopped
    environment:
      - GOOGLE_MASTER_TOKEN=${GOOGLE_MASTER_TOKEN}
      - GOOGLE_USERNAME=${GOOGLE_USERNAME}
      - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
      - TELEGRAM_CHANNEL_ID=${TELEGRAM_CHANNEL_ID}
      - TIMEZONE=${TIMEZONE:-UTC}
      - TIME_FORMAT=${TIME_FORMAT:-24h}
      - FORCE_RESEND_ALL=${FORCE_RESEND_ALL:-false}
      - DRY_RUN=${DRY_RUN:-false}
      - REFRESH_INTERVAL_MINUTES=${REFRESH_INTERVAL_MINUTES:-2}
      - LOG_LEVEL=${LOG_LEVEL:-INFO}
      - VERBOSE=${VERBOSE:-false}
    volumes:
      - sent-events:/app/data
    env_file:
      - .env

volumes:
  sent-events:
docker compose up -d
docker compose logs -f nest-sync
⁠4. Or Run Directly
docker run -d \
  --name nest-telegram-sync \
  --env-file .env \
  -v nest-events:/app/data \
  --restart unless-stopped \
  ssyl/nest-telegram-sync:latest

# View logs
docker logs -f nest-telegram-sync

⁠Features

  • Event type detection (person, package, animal, vehicle, motion, sound)
  • Configurable polling interval
  • Timezone and time format support
  • Deduplication tracking
  • Docker support

⁠Configuration Reference

VariableRequiredDefaultDescription
GOOGLE_MASTER_TOKEN✅-OAuth master token from Google
GOOGLE_USERNAME✅-Your Google account email
TELEGRAM_BOT_TOKEN✅-Bot token from @BotFather
TELEGRAM_CHANNEL_ID✅-Target channel ID (negative number)
TIMEZONE❌Auto-detectedIANA timezone (e.g., US/Eastern, Europe/London)
TIME_FORMAT❌System locale24h, 12h, or custom strftime format
REFRESH_INTERVAL_MINUTES❌2How often to poll for events (1-60 minutes)
FORCE_RESEND_ALL❌falseIgnore sent history (for testing)
DRY_RUN❌falseDownload videos but don't send to Telegram
LOG_LEVEL❌INFOLogging verbosity: DEBUG, INFO, WARNING, ERROR
VERBOSE❌falseExtra detailed logging (XML dumps, API responses)

⁠How It Works

  1. Polls every 2 minutes (configurable)
  2. Fetches events from Google Home API (last 3 hours)
  3. Downloads video clips from Nest API
  4. Sends to Telegram with event type and timestamp
  5. Tracks sent events to prevent duplicates

⁠Getting Credentials

Telegram Bot Token: Message @BotFather⁠, send /newbot

Telegram Channel ID: Forward a channel message to @userinfobot⁠

Google Master Token:

docker run --rm -it breph/ha-google-home_get-token

Tip: Use an app-specific password: https://myaccount.google.com/apppasswords⁠

⁠Troubleshooting

Check logs: docker compose logs -f nest-sync

  • No videos? Check that all 4 required env vars are set
  • Wrong timezone? Set TIMEZONE in .env
  • Testing? Set DRY_RUN=true and LOG_LEVEL=DEBUG

⁠Documentation

https://github.com/SSyl/google-nest-telegram-sync⁠

⁠Credits

Fork of TamirMa/google-nest-telegram-sync⁠

Thanks to:

⁠License

MIT License. For personal or educational use only.

Unofficial tool, not affiliated with Google or Telegram. Use at your own risk.

Tag summary

Content type

Image

Digest

sha256:e06a9cbb1…

Size

63.7 MB

Last updated

10 months ago

docker pull ssyl/nest-telegram-sync