home / skills / openclaw / skills / frigate

This skill lets you securely access Frigate NVR cameras, retrieve live snapshots, motion events, and stream URLs for automation workflows.

npx playbooks add skill openclaw/skills --skill frigate

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
2.9 KB
---
name: frigate
description: Access Frigate NVR cameras with session-based authentication. Get live snapshots, retrieve motion events, and fetch stream URLs. Includes CLI helper script for doorbell, driveway, front, east, mailbox, and garage cameras.
---

# Frigate NVR Integration

Access Frigate NVR server at `FRIGATE_URL` with credentials from `FRIGATE_USER` and `FRIGATE_PASS` environment variables.

## Authentication

Frigate uses session-based authentication (not HTTP Basic Auth):

```python
import requests

session = requests.Session()
response = session.post(
    f"{FRIGATE_URL}/api/login",
    json={"user": FRIGATE_USER, "password": FRIGATE_PASS},
    verify=False  # For self-signed certificates
)
# session.cookies contains frigate_token for subsequent requests
```

## Common Operations

### Get Camera List
```python
response = session.get(f"{FRIGATE_URL}/api/config", verify=False)
config = response.json()
cameras = list(config.get('cameras', {}).keys())
# Returns: ['driveway', 'front', 'east', 'mailbox', 'garage', 'doorbell']
```

### Get Snapshot from Camera
```python
snapshot = session.get(
    f"{FRIGATE_URL}/api/{camera_name}/latest.jpg",
    verify=False
)
# Save: with open(f"/tmp/{camera_name}.jpg", "wb") as f: f.write(snapshot.content)
```

### Get Motion Events
```python
events = session.get(
    f"{FRIGATE_URL}/api/events?cameras={camera_name}&has_clip=1",
    verify=False
).json()
# Returns list of motion detection events with timestamps
```

### Get Camera Stream URL
```python
config = session.get(f"{FRIGATE_URL}/api/config", verify=False).json()
stream_config = config.get('go2rtc', {}).get('streams', {}).get(camera_name)
# Returns RTSP/WebRTC stream URLs
```

## Environment Variables

Required:
- `FRIGATE_URL` - Frigate server URL (e.g., `https://server.local:8971/`)
- `FRIGATE_USER` - Username for authentication
- `FRIGATE_PASS` - Password for authentication

Optional:
- None required beyond the above

## Example: Send Doorbell Snapshot to Telegram
```python
import requests

session = requests.Session()
session.post(f"{FRIGATE_URL}/api/login",
    json={"user": FRIGATE_USER, "password": FRIGATE_PASS}, verify=False)

# Get doorbell snapshot
snapshot = session.get(f"{FRIGATE_URL}/api/doorbell/latest.jpg", verify=False)

# Send to Telegram
from clawdbot import message
message(action="send", channel="telegram", target="3215551212",
        message="Doorbell snapshot", path="/tmp/doorbell_snapshot.jpg")
```

## Notes

- Always use `verify=False` for self-signed certificates on home networks
- Session tokens expire after 24 hours (configurable via `session_length`)
- The `/api/cameras` endpoint doesn't exist; use `/api/config` for camera info
- Frigate version 0.16+ uses this authentication model

## Bundled Resources

- **Scripts**: See [scripts/frigate.py](scripts/frigate.py) for CLI utility with commands: `list`, `snapshot`, `events`, `stream`
- **API Reference**: See [references/api.md](references/api.md) for complete API documentation

Overview

This skill provides a lightweight integration for Frigate NVR servers using session-based authentication. It exposes operations to list cameras, grab live snapshots, fetch motion events, and obtain stream URLs, plus a CLI helper for common camera names. It’s designed for home setups with self-signed certificates and short-lived session tokens.

How this skill works

The skill authenticates by posting credentials to Frigate’s /api/login and retaining the session cookie for subsequent requests. It reads camera configuration from /api/config to enumerate cameras and streams. Snapshots are retrieved from /api/{camera}/latest.jpg and motion events from /api/events with query filters for camera and has_clip. The included CLI wraps these calls for quick access to doorbell, driveway, front, east, mailbox, and garage cameras.

When to use it

  • Automate snapshots from Frigate cameras for notifications or backups.
  • Pull motion event metadata to feed alert rules or analytics pipelines.
  • Retrieve RTSP/WebRTC stream URLs for downstream viewers or recorders.
  • Run quick camera checks from the command line on a home network.
  • Integrate doorbell snapshots with messaging services (Telegram, etc.).

Best practices

  • Store FRIGATE_URL, FRIGATE_USER, and FRIGATE_PASS in environment variables and avoid hardcoding credentials.
  • Use session object reuse to preserve frigate_token cookie and minimize repeated logins.
  • Set verify=False when Frigate uses a self-signed certificate on a local network; enable certificate verification in production.
  • Handle session expiration: re-authenticate when requests return authentication errors or after 24 hours.
  • Query /api/config for camera and stream details; do not use the non-existent /api/cameras endpoint.

Example use cases

  • Send a doorbell snapshot to Telegram when motion is detected at the doorbell camera.
  • Periodic script that saves nightly snapshots of driveway and garage cameras for archival.
  • Fetch recent motion events for a given camera and create summarized alerts or activity logs.
  • Obtain an RTSP URL for a camera and hand it to a local recorder or viewing app.
  • CLI command to quickly list available cameras and test snapshot retrieval from any camera.

FAQ

Which environment variables are required?

Set FRIGATE_URL, FRIGATE_USER, and FRIGATE_PASS. No other variables are required by the integration.

How do I handle self-signed certificates?

Use verify=False on requests to accept self-signed certificates on trusted home networks; enable verification for public or production deployments.