Everyone who is also trying to figure this out… stop here…
No need to decode a Base64 string.
No need to save off an image via screenshot to HA first.
Simple Notificaion with Options!!.
Based on the MQTT message… Send a notification with all the reference URLs back to BI!
Brilliant. This community is awesome.
My full Automation script:
alias: BI MQTT - Any Camera Trigger
description: The Blue Iris Notification Replacement
triggers:
- trigger: mqtt
topic: BlueIris/+/alert-image
variables:
camera_name: "{{ trigger.topic.split('/')[1] }}"
#This part is optional, but i only wanted alerts when the sun was out.
conditions:
- condition: sun
before: sunset
after: sunrise
enabled: false
actions:
- action: notify.james_devices
data:
message: >-
{{ trigger.payload_json.type }} was detected on the {{
trigger.payload_json.name }} camera.
data:
channel: BlueIris
ttl: 0
priority: high
clickAction: >-
http://<BI_EXTERNAL_IP>:81/ui3.htm?maximize=1&tab=alerts&cam={{trigger.payload_json.camera}}&rec={{trigger.payload_json.db}}
image: http://<BI_EXTERNAL_IP>:81/alerts/{{trigger.payload_json.id}}
actions:
- action: URI
title: Live View
uri: >-
http://<BI_EXTERNAL_IP>:81/ui3.htm?maximize=1&cam={{trigger.payload_json.camera}}
- action: URI
title: View Clip
uri: >-
http://<BI_EXTERNAL_IP>:81/ui3.htm?maximize=1&tab=alerts&cam={{trigger.payload_json.camera}}&rec={{trigger.payload_json.id}}
title: Blue Iris
- action: notify.des_devices
data:
message: >-
{{ trigger.payload_json.type }} was detected on the {{
trigger.payload_json.name }} camera.
data:
channel: BlueIris
ttl: 0
priority: high
clickAction: >-
http://<BI_EXTERNAL_IP>:81/ui3.htm?maximize=1&tab=alerts&cam={{trigger.payload_json.camera}}&rec={{trigger.payload_json.db}}
image: http://cams.1930networks.com:1930/alerts/{{ trigger.payload_json.id }}
actions:
- action: URI
title: Live View
uri: >-
http://<BI_EXTERNAL_IP>:81/ui3.htm?maximize=1&cam={{
trigger.payload_json.camera }}
- action: URI
title: View Clip
uri: >-
http://<BI_EXTERNAL_IP>:81/ui3.htm?maximize=1&tab=alerts&cam={{
trigger.payload_json.camera }}&rec={{ trigger.payload_json.id }}
title: Blue Iris
mode: queued
max: 10
Update: Its also worth noting that each device is limited to 500 pushes a day. So if you’re testing and notifications stop working – check on the companion app how many notificaitons you have left…
Great idea and nice it works but blueiris is not hardened for external access, it’s a security risk exposing your instance to the public, especially over plain http
My pfSense router is Proxying for me. However after finding out about the 500 daily message limitation i decided against this route and just use the Push notifications directly from BI – ive reached back out to Support over at BI to see what the Notification issue status was and reported some new ones of my own.
You sir are a KING! I was couldn’t get the alert screen shot to display when I read your comment about setting up BI to not require authentication from LAN, and BOOM, problem solved! Thank you!
I know this is for Home Assistant but going to offer this as an alternative as it doesn’t need Home Assistant or MQTT or even an app installed on your phone.
I know this is a bit of thread necromancy, but this seemed like the most appropriate place to ask. I am trying to convert over from NodeRed to just using HA automations since this is the only thing I have NodeRed running for.
Pertinent Info:
Is fully functioning with NodeRed hitting both my phone and my wife’s
alias: BI MQTT - Any Camera Trigger
description: The Blue Iris Notification Replacement
triggers:
- trigger: mqtt
topic: BI/+/alert-image-b64
variables:
camera_name: "{{ trigger.topic.split('/')[1] }}"
actions:
- action: notify.mobile_app_my_phone
data:
message: >-
{{ trigger.payload_json.type }} was detected on the {{
trigger.payload_json.name }} camera.
data:
channel: BI
ttl: 0
priority: high
clickAction: >-
http://xxx.xxx.xxx.xxx:81/ui3.htm?maximize=1&tab=alerts&cam={{trigger.payload_json.camera}}&rec={{trigger.payload_json.db}}
image:http://xxx.xxx.xxx.xxx:81/alerts/{{trigger.payload_json.id}}
actions:
- action: URI
title: Live View
uri: >-
http://xxx.xxx.xxx.xxx:81/ui3.htm?maximize=1&cam={{trigger.payload_json.camera}}
- action: URI
title: View Clip
uri: >-
http://xxx.xxx.xxx.xxx:81/ui3.htm?maximize=1&tab=alerts&cam={{trigger.payload_json.camera}}&rec={{trigger.payload_json.id}}
title: Blue Iris
- action: notify.mobile_app_my_phone
data:
message: >-
{{ trigger.payload_json.type }} was detected on the {{
trigger.payload_json.name }} camera.
data:
channel: BI
ttl: 0
priority: high
clickAction: >-
http://xxx.xxx.xxx.xxx:81/ui3.htm?maximize=1&tab=alerts&cam={{trigger.payload_json.camera}}&rec={{trigger.payload_json.db}}
image: http://xxx.xxx.xxx.xxx:81/alerts/{{ trigger.payload_json.id }}
actions:
- action: URI
title: Live View
uri: >-
http://xxx.xxx.xxx.xxx:81/ui3.htm?maximize=1&cam={{
trigger.payload_json.camera }}
- action: URI
title: View Clip
uri: >-
http://xxx.xxx.xxx.xxx:81/ui3.htm?maximize=1&tab=alerts&cam={{
trigger.payload_json.camera }}&rec={{ trigger.payload_json.id }}
title: Blue Iris
mode: queued
max: 10
The automation is triggering, but it’s not sending anything to my phone.
I am not sure if it’s because I have an old payload or if there’s something else I am missing.
I’m not going to be able to be a ton of help because I’ve switched from BlueIris to Frigate. But it sounds like you had things working well in Node Red for this.
Here’s a couple of things to try:
Try manually triggering a notification to your phone through Developer tools > Actions > Send a notification via mobile_app_my_phone. Send just a text message with no URL to start with.
You’re setting a variable camera_name, but I didn’t see that being used (I may have just missed it).
Change your automation to be just to send a text message and include all the items you are using such as {{trigger.payload_json.name }}
Post your working NodeRed action that gives the trigger. Maybe someone can help spot what’s wrong with your automation action.
In case anyone else struggles, here’s where I landed in a functional automation on the most recent HA and BI…This is a little redundant from my last post, but I wanted to put everything in a single spot for (hopefully) ease of recreation. This has a few things, one it makes sure there’s actually a detection from my alert, it checks that it hasn’t made an alert on that camera within the last minute, and it prevents clicking the main message from opening the Home Assistant app.
BI Configuration (this needs to be in the Alert Notification for each camera…you also have to have MQTT configured in the main settings