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_TOKENTWILIO_PHONE,MY_PHONE
webhook_server.py
Step 3: Start Monitoring
The webhook server automatically starts the job on startup. If you need to manually start:What Happens
- Trio validates the URL is a live stream
- Captures a frame every 30 seconds
- Pre-filter checks for motion (skips static frames)
- If motion detected, VLM analyzes the frame
- If snow is detected, webhook fires with
watch_triggered - Your server sends SMS via Twilio
- After duration limit or
max_triggerslimit, job stops and sendsjob_stopped - 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: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
- Rain detection
- Fog/visibility monitoring
- Traffic incident detection
- Crowd density monitoring
Full API Reference
Explore all live monitor endpoint options