Blue Iris motion alerts to notification with image in Home Assistant

@gmow1 I was close but could not get the encoding: b64 method of @TheHolyRoger to work. I kept getting a padding error from the MQTT JSON payload.

But I used some of his methods as well as @ronaldjeremy to finally get it to work on Android with success. I get the notification in the companion app. It saves to the www folder and I can click the notification image to actually view the clip.

Here is what I did:

In my configuration.yaml file, I added:

mqtt:
  camera:
    - topic: BI/porch/alert-image-b64
      name: Porch Alert
      unique_id: camera.porch_alert

In Blue Iris, I added the following topic and payload:

This is what my automation looks like:

- id: '1656252280379'
  alias: Blue Iris camera alert (New)
  variables:
   file_time: '{{ now().strftime(''%Y%m%d_%H%M%S'') }}'
  description: ''
  trigger:
  - platform: mqtt
    topic: BI/porch/alert-image-b64
  condition: []
  action:
  - service: camera.snapshot
    data:
      filename: /config/www/{{ file_time }}_frontporch_ha.jpg
    target:
      entity_id: camera.front_door_cam_sub
  - service: notify.mobile_app_scott_s_s21
    data:
      message: A person was detected on the {{trigger.payload_json.cam}} camera at
        {{trigger.payload_json.time}}.
      title: Person Detected on Front Porch
      data:
        ttl: 0
        priority: high
        clickAction: http://your_remote_link_to_BI:81/ui3.htm?maximize=1&tab=alerts&cam={{trigger.payload_json.cam}}
          &rec={{trigger.payload_json.db}}
        image: /local/{{ file_time }}_frontporch_ha.jpg
  mode: queued

The only thing I have left to do is use @TheHolyRoger method to delete the snapshot images from the www folder.

Hope this helps!

Scott

1 Like