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…