Frigate events real-time notifications to Telegram.
1.3K
GitHub repository: https://github.com/lucad87/frigate-telegram
This project is a Telegram bot integration for Frigate, an open-source NVR (Network Video Recorder) software. It allows users to receive real-time alert notifications from their Frigate instance directly in Telegram.
The application is written in Node.js and polls the Frigate API to fetch new events. When a new event is detected, it is forwarded to Telegram, including event details, a clickable video link with 30 seconds padding, a static thumbnail, and an animated preview GIF.
This project aims to retrieve events from Frigate using its API without relying on external tools like Home Assistant. MQTT is not supported.
The application polls Frigate every 60 seconds -by default- to fetch new alerts. The GET request to the Frigate API retrieves events from the last 60 seconds, filtered by the parameters specified in the docker-compose file (label, camera, and zones). You can customize it with POLLING_INTERVAL: it will set the same value for both application polling interval and frigate after.
https://hub.docker.com/r/lucad87/frigate-telegram
/start or /help to see available commands, /enable_notifications to enable notifications, and /disable_notifications to disable them.To get the Frigate-Telegram bot up and running, follow these steps:
These variables are essential for the bot's operation and should be configured in your docker-compose.yml file:
FRIGATE_URL: The URL of your Frigate instance (e.g., http://192.168.1.7:5000).FRIGATE_MEDIA_URL: (Optional) The public URL of your Frigate media files (e.g., https://your-media-frigate-instance.com).FRIGATE_USERNAME: (Optional) Username for Frigate authentication. Required if your Frigate instance has authentication enabled.FRIGATE_PASSWORD: (Optional) Password for Frigate authentication. Required if your Frigate instance has authentication enabled.TELEGRAM_BOT_TOKEN: The token for your Telegram bot.TELEGRAM_CHAT_ID: The chat ID where notifications will be sent.CAMERA: The name of the frigate camera to monitor.ZONES: The frigate zones to monitor for object detection (e.g., front,back,street).LABEL: The frigate object label to monitor (e.g., person).TIMEZONE: Your time zone, Europe/Rome is the defaultLOCALES: Your locales language according the timezone, it-IT is the defaultPOLLING_INTERVAL: Interval in seconds to poll Frigate for new events (default: 60 seconds).DEBUG: (Optional) Set to true to enable debug logging../logs:/app/logs: Mounts the logs directory to persist log files.Below is an example docker-compose.yml configuration. Replace the placeholder values with your actual settings.
services:
app:
image: lucad87/frigate-telegram:latest
environment:
- FRIGATE_URL=<your-frigate-instance-url>
- FRIGATE_MEDIA_URL=<your-public-media-frigate-instance-url> # (optional) It fallbacks on FRIGATE_URL if not specified
- FRIGATE_USERNAME=<your-frigate-username> # (optional) Required if Frigate has authentication enabled
- FRIGATE_PASSWORD=<your-frigate-password> # (optional) Required if Frigate has authentication enabled
- TELEGRAM_BOT_TOKEN=<your-telegram-token>
- TELEGRAM_CHAT_ID=<your-telegram-chat-id>
- CAMERA=<frigate-camera>
- ZONES=<frigate-zones>
- LABEL=<frigate-label>
- TIMEZONE=<you_timezone> # (optional) Set to the timezone to use for the date and time in the messages, Europe/Rome is the default
- LOCALES=<locales> # (optional) Set to the locale to use for the date and time in the messages, it-IT is the default
- POLLING_INTERVAL=<seconds> # (optional) Set to the interval in seconds to poll Frigate for new events, 60 seconds is the default
- DEBUG=false # (optional) Set to true to enable debug logging
volumes:
- <your-logs-volume-path>:/app/logs
restart: unless-stopped
Pull the Docker image:
docker pull lucad87/frigate-telegram:latest
Run the container using Docker Compose:
Navigate to the directory containing your docker-compose.yml file and run:
docker compose up -d
Control the Bot via Telegram: Once the bot is running, you can interact with it by sending commands directly to your bot in Telegram:
/start or /help: Show available commands./enable_notifications: Enable event notifications./disable_notifications: Disable event notifications.To set up the project for local development:
Clone the repository:
git clone https://github.com/lucad87/frigate-telegram.git
cd frigate-telegram
Install dependencies:
npm install
Run the application:
You will need to set up environment variables (e.g., in a .env file or directly in your shell) as described in the Environment Variables section.
node app/index.js
This project is licensed as MIT.
Content type
Image
Digest
sha256:39c63bb42…
Size
56.6 MB
Last updated
about 2 months ago
docker pull lucad87/frigate-telegram