Skip to main content
Let’s build a system that monitors a Pittsburgh webcam and sends you an SMS via Twilio when snow is detected.
Remember: Jobs are time-bounded (default 10 minutes) and can also stop when max_triggers is reached. For continuous monitoring, your webhook should restart the job.

How to use examples

Use this recipe as a template:
  • Replace the stream URL with your own live source.
  • Replace the condition with your domain-specific event.
  • Keep the webhook + restart pattern for long-running monitoring.

The Setup

We’ll use:
  • Trio to monitor a Pittsburgh traffic cam
  • Twilio to send SMS alerts
  • A simple webhook receiver that restarts jobs when they expire

Step 1: Find a Live Stream

Pittsburgh has several public traffic cams. Search YouTube for “pittsburgh live cam” or “traffic cam live”.
The URL must be an active live stream. Regular videos and past streams will be rejected with a 400 error.

Step 2: Create the Webhook Receiver

Set these environment variables in your host:
  • TRIO_API_KEY (from the Trio console)
  • WEBHOOK_HOST (your public base URL, e.g., https://your-webhook-server.com)
  • TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN
  • TWILIO_PHONE, MY_PHONE
webhook_server.py
Deploy this to Railway, Vercel, or any hosting provider.

Step 3: Start Monitoring

The webhook server automatically starts the job on startup. If you need to manually start:

What Happens

  1. Trio validates the URL is a live stream
  2. Captures a frame every 30 seconds
  3. Pre-filter checks for motion (skips static frames)
  4. If motion detected, VLM analyzes the frame
  5. If snow is detected, webhook fires with watch_triggered
  6. Your server sends SMS via Twilio
  7. After duration limit or max_triggers limit, job stops and sends job_stopped
  8. Your server restarts the job automatically for continuous coverage

Webhook Payloads

Watch Trigger

Job Auto-Stop (duration limit)

Cost Analysis

With 10-minute job cycles and 30-second intervals:
The pre-filter typically saves 50-70% on API costs by skipping static frames.

Monitoring Dashboard

Check your job status and metrics:

Wrapping Up

You now have a production-ready snow alerting system that:
  • Automatically restarts after 10-minute job limits
  • Sends SMS alerts via Twilio
  • Costs less than $0.15/day with pre-filtering
The same pattern works for:
  • Rain detection
  • Fog/visibility monitoring
  • Traffic incident detection
  • Crowd density monitoring

Full API Reference

Explore all live monitor endpoint options