SmartCam Alerts handles the hard part of camera monitoring: AI-powered detection with natural language rules. But what if you want your smart home to react when something is detected? That is where webhooks and Home Assistant come in.
This guide walks you through connecting SmartCam Alerts to Home Assistant so that camera detections can automatically trigger lights, locks, notifications, and any other automation you can imagine.
What Are Webhooks?
A webhook is a simple HTTP request that one service sends to another when something happens. Think of it as a tap on the shoulder: SmartCam Alerts taps Home Assistant and says "hey, I just detected a person at the front door."
When SmartCam Alerts detects an event matching one of your rules, it sends a POST request to a URL you specify. That URL can be a Home Assistant webhook endpoint. Home Assistant receives the data and can trigger any automation in response.
The webhook payload from SmartCam Alerts includes structured data about the detection:
{
"event": "alert_triggered",
"timestamp": "2026-04-08T14:32:00.000Z",
"camera": {
"id": "cam_abc123",
"name": "Front Porch"
},
"rule": {
"id": "rule_xyz",
"prompt": "Is there a person at the front door?"
},
"alert": {
"id": "alert_456",
"confidence": 0.94,
"response": "Yes, there is a person standing at the front door holding a package."
},
"snapshot_url": "https://smart-cam-alerts.brandonwheeler70.workers.dev/snapshots/cam_abc123/1712345678.jpg"
}
This data gives Home Assistant everything it needs to make smart decisions about what to do next.
Step 1: Get Your Home Assistant Webhook URL
Home Assistant can receive webhooks natively. You need a webhook URL that Home Assistant listens on.
- Open Home Assistant and go to Settings → Automations & Scenes.
- Click + Create Automation and choose Start with an empty automation.
- Under Triggers, click Add Trigger and select Webhook.
- Home Assistant will generate a webhook ID (for example,
smartcam_alert). You can customize this ID. - Your webhook URL will be:
https://your-ha-instance.duckdns.org/api/webhook/smartcam_alert
Important: For webhooks from SmartCam Alerts (a cloud service) to reach Home Assistant, your HA instance must be accessible from the internet. If you use Nabu Casa, DuckDNS, or a reverse proxy, you are already set up. Make sure the webhook trigger has "Only accessible from the local network" turned off.
Step 2: Add the Webhook URL to SmartCam Alerts
There are two ways to configure webhook delivery in SmartCam Alerts:
Option A: Global Webhook (all alerts)
- Log into your SmartCam dashboard.
- Scroll to the Notifications section.
- Click + Add, select Webhook URL from the dropdown.
- Paste your Home Assistant webhook URL.
- Click Add. All alerts from all cameras will now trigger this webhook.
Option B: Per-Rule Webhook (specific detections only)
If you only want certain detections to trigger Home Assistant, you can set a webhook URL on individual alert rules. Open a camera, find the rule, and add the webhook URL in the rule settings. This is useful when you want different HA automations for different types of detections.
Step 3: Import the SmartCam Alerts Blueprint
To make setup even easier, we provide a Home Assistant blueprint that pre-configures the webhook trigger for you.
- Download the blueprint file: ha-blueprint.yaml
- In Home Assistant, go to Settings → Automations & Scenes → Blueprints.
- Click the three-dot menu in the top right and select Import Blueprint.
- Upload the YAML file or paste the URL:
https://smartcamalerts.com/ha-blueprint.yaml - Once imported, click Create Automation from the blueprint.
- Set your webhook ID (default is
smartcam_alert) and choose the action to run when an alert arrives.
The blueprint handles the webhook trigger configuration. You just need to define what happens when a detection comes in.
Example Automations
Here are practical examples of what you can automate when SmartCam Alerts detects something on your cameras.
Turn On Porch Lights When a Person Is Detected
SmartCam rule: "Is there a person at the front door?"
automation:
trigger:
- platform: webhook
webhook_id: smartcam_alert
condition:
- condition: template
value_template: "{{ trigger.json.rule.prompt | lower is search('person') }}"
action:
- service: light.turn_on
target:
entity_id: light.front_porch
data:
brightness_pct: 100
- delay: "00:05:00"
- service: light.turn_off
target:
entity_id: light.front_porch
Send a Phone Notification with Snapshot
automation:
trigger:
- platform: webhook
webhook_id: smartcam_alert
action:
- service: notify.mobile_app_your_phone
data:
title: "{{ trigger.json.camera.name }} Alert"
message: "{{ trigger.json.alert.response }}"
data:
image: "{{ trigger.json.snapshot_url }}"
actions:
- action: "OPEN_CAMERA"
title: "View Camera"
Lock the Front Door After Hours
SmartCam rule: "Is there a person approaching the door?" (with a schedule set to after-hours only)
automation:
trigger:
- platform: webhook
webhook_id: smartcam_alert
condition:
- condition: time
after: "22:00:00"
before: "06:00:00"
action:
- service: lock.lock
target:
entity_id: lock.front_door
- service: notify.mobile_app_your_phone
data:
title: "Security Alert"
message: "Person detected after hours. Front door locked. {{ trigger.json.alert.response }}"
Record a Clip When Motion Is Detected in the Backyard
SmartCam rule: "Is there a person or animal in the backyard?"
automation:
trigger:
- platform: webhook
webhook_id: smartcam_alert
condition:
- condition: template
value_template: "{{ trigger.json.camera.name == 'Backyard' }}"
action:
- service: camera.record
target:
entity_id: camera.backyard
data:
duration: 30
filename: "/config/www/clips/backyard_{{ now().strftime('%Y%m%d_%H%M%S') }}.mp4"
Tips for a Reliable Setup
- Use HTTPS. Always use an HTTPS URL for your Home Assistant webhook to keep the data encrypted in transit.
- Test with a simple automation first. Before building complex automations, create a test automation that just sends a notification. Confirm the webhook is being received before adding more logic.
- Use template conditions. The webhook payload includes the camera name, rule prompt, and confidence score. Use Jinja2 templates in HA conditions to filter which detections trigger which automations.
- Set confidence thresholds. You can add a condition like
{{ trigger.json.alert.confidence > 0.8 }}to only trigger automations for high-confidence detections. - Combine with SmartCam schedules. Use SmartCam's built-in rule scheduling to only send webhooks during specific time windows, reducing unnecessary automation triggers.
Troubleshooting
- Webhook not received: Make sure your HA instance is accessible from the internet. Check that "Only accessible from the local network" is turned off on the webhook trigger. Verify the URL in your SmartCam notification settings is correct.
- Automation not firing: Check the Home Assistant logs under Settings → System → Logs. Look for incoming webhook events. Verify that your conditions are not filtering out the event.
- No snapshot image in notification: The snapshot URL in the webhook payload requires that your phone can reach the SmartCam Alerts server. This should work on both WiFi and mobile data since snapshots are served from the cloud.
AI camera detection + Home Assistant automation
Let SmartCam handle the vision. Let Home Assistant handle the response. Set it up in under 15 minutes.
Get Started Free