This guide shows how to:
- Send Blue Iris Motion and AI alerts to Home Assistant via MQTT
- Send Android notifications from Home Assistant with:
- A dynamic message
- An alert image preview (via Home Assistant camera proxy)
- Tap alert to open image from the Home Assistant stored image.
- A dynamic message
-
Home Assistant MQTT configured
- MQTT broker running (Mosquitto add-on or external)
- Home Assistant connected (Settings → Devices & services → MQTT)
-
Blue Iris publishing MQTT topics
Typical topics used in this setup:
-
- Name:
MQTT - On Alert - MQTT Topic:
BlueIris/&CAM/Status - Payload:
{ "type": "&TYPE", "trigger": "ON" }
- Name:
-
- Name:
MQTT - On Alert - JSON Payload - MQTT Topic:
BlueIris/<CameraName>/alert-image - Payload:
{ "state":"ON", "camera":"&CAM", "object":"&MEMO", , "name":"&NAME", "type":"&TYPE", "time":"&ALERT_TIME", "id":"&ALERT_DB", "path":"&ALERT_PATH" }
- Name:
-
- Name:
MQTT - On Alert - B64(the Raw Base64 Image) - MQTT Topic:
BlueIris/<CameraName>/alert-image-b64 - Payload:
&ALERT_JPEG
- Name:
-
- Name:
MQTT - On Reset - MQTT Topic:
BlueIris/&CAM/Status - Payload:
{ "type": "&TYPE", "trigger": "OFF" }
- Name:
-
A Home Assistant Camera entity per alert image Example entities:
camera.cam203_alertcamera.cam201_alert
Make a
mqtt.yamlfile and reference it in yourconfiguration.yaml:mqtt: !include mqtt.yaml
mqtt.yaml; customize this for your camera names and needs
############################################################################### # BI & MQTT ############################################################################### #mqtt: camera: - topic: BlueIris/Cam200/alert-image-b64 name: Cam200_Alert unique_id: camera.Cam200_alert image_encoding: b64 - topic: BlueIris/Cam201/alert-image-b64 name: Cam201_Alert unique_id: camera.Cam201_alert image_encoding: b64 - topic: BlueIris/Cam202/alert-image-b64 name: Cam202_Alert unique_id: camera.Cam202_alert image_encoding: b64 - topic: BlueIris/Cam203/alert-image-b64 name: Cam203_Alert unique_id: camera.Cam203_alert image_encoding: b64 - topic: BlueIris/Cam205/alert-image-b64 name: Cam205_Alert unique_id: camera.Cam205_alert image_encoding: b64 binary_sensor: - state_topic: BlueIris/Cam200/alert-image name: Cam200 Alert Details default_entity_id: Cam200_Alert_Details value_template: "{{ value_json.state }}" json_attributes_topic: BlueIris/Cam200/alert-image off_delay: 15 device_class: motion - state_topic: BlueIris/Cam201/alert-image name: Cam201 Alert Details default_entity_id: Cam201_Alert_Details value_template: "{{ value_json.state }}" json_attributes_topic: BlueIris/Cam201/alert-image0 off_delay: 15 device_class: motion - state_topic: BlueIris/Cam202/alert-image name: Cam202 Alert Details default_entity_id: Cam202_Alert_Details value_template: "{{ value_json.state }}" json_attributes_topic: BlueIris/Cam202/alert-image off_delay: 15 device_class: motion - state_topic: BlueIris/Cam203/alert-image name: Cam203 Alert Details #object_id: Cam203_Alert_Details default_entity_id: Cam203_Alert_Details value_template: "{{ value_json.state }}" json_attributes_topic: BlueIris/Cam203/alert-image off_delay: 15 device_class: motion - state_topic: BlueIris/Cam205/alert-image name: Cam205 Alert Details default_entity_id: Cam204_Alert_Details value_template: "{{ value_json.state }}" json_attributes_topic: BlueIris/Cam205/alert-image off_delay: 15 device_class: motion
These must exist and display an image in Home Assistant.
-
A Home Assistant URL reachable by your phone Example:
https://home.example.com:8123
In Home Assistant:
- Developer Tools → MQTT → Listen to a topic like:
BlueIris/Cam203/alert-image
You can also use MQTT Explorer to capture real time payloads for troubleshooting.
Example payload:
{ "state":"ON", "camera":"Cam203", "object":"person:60%", "name":"Front_Door_203", "type":"Motion_AC", "time":"2026-02-21T22:40:02.763Z", "id":"@...", "path":"Cam203....jpg" }Some Blue Iris MQTT formats can accidentally produce invalid JSON (for example an extra comma):
{ "object":"dog:85%", , "name":"Front_Door_203" }If the payload is malformed, trigger.payload_json will fail. This guide uses a safe parse method that “cleans” the known , , pattern and then parses JSON.
Create a new automation in Home Assistant and switch to YAML mode.
Note: Home Assistant may show
triggers:/actions:in the UI YAML editor. That format is valid for recent HA versions.
Paste and customize this automation:
alias: BI MQTT - Camera Trigger
description: Blue Iris MQTT notifications with zone decoding + image (Android)
mode: queued
max: 10
triggers:
- trigger: mqtt
topic: "BlueIris/+/alert-image"
variables:
# Extract camera from topic: BlueIris/Cam203/alert-image -> Cam203
camera_name: "{{ trigger.topic.split('/')[1] }}"
# Parse payload JSON, with cleanup for the known malformed pattern ", ,"
bi_payload: >-
{{ trigger.payload | replace(', ,', ',') | from_json }}
# Map BI payload camera (e.g. "Cam203") to HA camera entity (e.g. camera.cam203_alert)
cam_entity: >-
{{ 'camera.' ~ (bi_payload.camera | lower) ~ '_alert' }}
# Use a still image endpoint for better Android preview reliability and grabing the token value stored in Home Assistant for access to the image; this gets refreshed with every store of a new image.
cam_image_url: >-
https://home.example.com:8123/api/camera_proxy/{{ cam_entity }}?token={{ state_attr(cam_entity, 'access_token') }}
actions:
- action: notify.user_devices
data:
title: "Blue Iris"
message: >-
{{ bi_payload.object }} detected on {{ bi_payload.name }}.
Zones: {{ zone_text }}
data:
channel: "BlueIris"
ttl: 0
priority: high
image: "{{ cam_image_url }}"
clickAction: "{{ cam_image_url }}"- Notify target:
- Replace
notify.user_deviceswith your Android device notify service (or a notify group).
- Replace
- Home Assistant URL:
- Replace
https://home.example.com:8123with your HA URL.
- Replace
- Camera entity naming:
- This template assumes
camera.cam203_alertstyle entities. If your entity IDs differ, adjust thecam_entityvariable.
- This template assumes
The template assumes:
- Blue Iris sends:
"camera":"Cam203" - Home Assistant entity is:
camera.cam203_alert
If your entity is named differently, either adjust cam_entity or create a manual mapping.
In Developer Tools → Templates, test:
{% set cam_entity = 'camera.cam203_alert' %}
https://home.example.com:8123/api/camera_proxy/{{ cam_entity }}?token={{ state_attr(cam_entity, 'access_token') }}Open the rendered URL on your phone. If it loads, Android should be able to show a preview image in the notification.
Common causes:
- The automation isn’t actually triggered (templates referencing
triggerwon’t work when you press “Run” manually). - The automation YAML is invalid.
Fix:
- Trigger it by publishing an MQTT message (real event).
- Keep
bi_payloadas a block template (>-), not a quoted string.
Common causes:
- Using
camera_proxy_stream(streaming) instead ofcamera_proxy(still image). - The phone cannot reach your HA URL (LAN vs mobile data).
- TLS/cert trust issues.
Fix:
- Prefer
/api/camera_proxy/forimage:. - Verify the image URL loads on the phone at alert time.