Blue Iris motion alerts to notification with image in Home Assistant

I’ll try to narrow this down more for others after much testing and debugging.

If I set my trigger to the following:

BI/+/alert-image-b64

Then my camera name in my scenario is set as “Driveway” since that is what my camera is named in BI.

Later on in the automation if I want to set these two parameter as such:

action:
  - service: notify.mobile_app_rotto_iphone
    data:
      message: Activity detected at {{ camera_name }}
      data:
        entity_id: camera.{{ camera_name }}_alert

Then the message becomes “Activity detected at Driveway”, BUT

The problem is that entity_ids are always lower case (I have tried many different ways to get a capital letter in there with no success-if anyone has a suggestion then I’d love to learn) SO

My entity id becomes camera.Driveway_alert BUT

The entity I created in my yaml is actually camera.driveway_alert (NOTE the lower case d)

For whatever reason on an iPhone if I hold the notification down then it still opens the picture fine, but the little tiny picture in the notification actually does not show up and is replaced with a default image.

My next test that I am going to try is to change the MQTT payload in BI to use “driveway” instead of the placeholder camera name and see if that changes it. (Which is still a pain as I could not copy all the settings from a previous camera when I setup a new one)

Looks like you’re only defining the variable in your trigger, you need to define it twice - one for trigger and one general. I think that’s all it is

Sorry I didn’t read the lowercase thing, try {{ camera_name|lower }}

2 Likes

You sir are a genius.

Thank you so much.

1 Like

It appears that you can’t use:

{{ trigger.payload_json.camera }}

in image: . Using the actual name seems to work (e.g. camera.office_alert) but any other {{ }} values don’t work in there.

has there been a chance since this post, or a different pay to pass it?

Hi guys need some help.

I get the image on my mobile. I want to add some text to the message.
Currently the message is:

        A {{ trigger.payload_json.object.split(":")[0].strip('%') }} was detected on the {{
        trigger.payload_json.name }} camera.

Which translates to

A person was detected on the Camera 7 camera.

I will like the new message to read

A person was detected with XX% confidence on the Camera 7 camera.

So I need to add the confidence but I have no idea how to strip the trigger.payload_json.object to leave only the % in there.

I’m trying to get a similar setup going. Did you have to allow the tailscale IP in BI in order to view the video? I am able to get the image but am stuck on the video.

This is amazing, just joined to say thank you for this, works so well.

1 Like

Is it possible to get a snippet of your code?

Thanks!

I wanted to start getting this setup…and I’m running into a problem well before the MQTT step.

I cannot get any motion alert from BI in HA at all. I get camera feeds just fine and I haven’t ever wanted to do more until today. Apparently, none of the sensors function for me. Anybody have any idea what is going on?

I’ve had this running perfectly for 3 years now but have encountered a problem. My android notifications are always showing the previous alert photo, not the current one. When I navigate to the app on my phone the MQTT camera entity shows the latest image correctly though. Anyone come across this?

I deleted my post above as I have something similar going on with IOS but seems to have resolved itself after a few missed alerts? I was getting blank notifications and the file wasnt saving, but after 2 triggers on the same camera they starting working again. I am thinking something to do with MQTT retain settings getting out of sync? It started this behavior going to core 2024.6.4 and previously I was on 2024.5.4

Helllo, i like to use Pushover. I only get the text but no image.
Can someone help me?

id: camera.HE_alert_po
  alias: Blue Iris camera alert
  trigger:
  - platform: mqtt
    topic: BI/+/alert-image-b64
    variables:
      camera_name: "{{ trigger.topic.split('/')[1] }}"
  condition: []
  action:
  - service: notify.pushover
    data:
      message: "Person detected: {{ camera_name }}"
      data:
        entity_id: camera.{{ camera_name }}_alert
  mode: queued

Does the {{ camera_name }} shown in your message exactly match the camera entity camera.{{ camera_name }}_alert

Spaces or upper/lower case differences may cause a problem.

The Name ist correct.

My MQTT payload looks like this:

{“id”:“&ALERT_DB”,“object”:“&MEMO”,“camera”:“&CAM”,“name”:“&NAME”}

“&MEMO” provides “person:84%” as a value.

So, with this string manipulation:

A {{ trigger.payload_json.object.split(“:”)[0] }} ({{ trigger.payload_json.object.split(“:”)[1] }} confidence) was detected on the {{ trigger.payload_json.name }} camera.

You can get a result of:

A Person (84% confidence) was detected on the Doorbell Camera

There are complete working examples literally few posts up, for one.

But the issue with your automation is the fact that you are:

  1. Not retrieving the image that you wish to send.
  2. Not including said image with the Pushover payload.

Since many people are using HA App notifications, let me share with you an example of an action you will need for Pushover.
Once you figure out the snapshot piece, you will be good to go.

- service: notify.pushover
  data:
    title: Person at the door
    message: Someone is at the door
    data:
      attachment: /config/www/snapshots/front_door.jpg
      sound: bugle
      priority: 0

Apologies if I should start a new thread, but the tutorial I followed linked back to this thread, so I thought I would try here first. I followed https://www.wundertech.net/blue-iris-motion-notifications-in-home-assistant/ to set up HA app notifications with images. I get the notifications as expected, but no image is included.

I have reviewed the raw message and validated path.path when appended to my base string should resolve to the correct URL, but still no dice. Any suggestions from anyone else that may have tried something similar?