Blue Iris motion alerts to notification with image in Home Assistant

I also had this issue and could not get it to work. Also my clips browser didn’t show anything nor the timeline.
For me the settings on where the database is beeing stored was the issue.
It was set to D:\BlueIris - my server don’t have a d drive…

I’m prettey sure I haven’t changed this setting but you can never be sure… took me a year or so to fix this. Posting here because no one have ever reported what fixed this for them so hopefully this can help others with same problem.

I am looking to give this a click action to an entity. What I have been trying doesn’t work and the only examples I find are to a URL. Is what I am trying possible?

action:
  - service: notify.mobile_app_chads_iphone
    data:
      message: "Person detected: {{ camera_name }}"
      data:
        entity_id: camera.{{ camera_name }}_alert
      clickAction:
        entity_id: camera.cts_home_{{ camera_name }}

I have latest version of BI integrated into HA. Lots of good intel in this post. Has anyone seen a recent tutorial/blog that shows how to setup the push notifications to my phone via HA companion app. Image is fine as cameras not exposed to internet.

If you haven’t figured this out yet, I thought I would add my info in case anyone else runs into this issue:

I just moved systems and installed what I thought was the same version of BlueIris that I had been using (that my license is good for) and ran back into this NO RECORD issue. It took me some time to figure out that was the reason that the image wasn’t showing up and I wracked my brains trying to remember what I had done to fix this. Turns out, in Blue Iris settings, clicking on the “Check for News and Updates” won’t let me update to the latest update due to my license being expired but it will let me update to “Another available previous update” which for me was 5.5.9.6 (8/1/2022). Doing this fixed the NO RECORD problem.

1 Like

When trying to add the cameras into my configuration.yaml, I get a “Property image_encoding is not allowed”

What am I doing wrong here?
Also tried with encoding: b64 but same result

I have saved the file regardless, and see the camera as an entity, but adding it as a card and no image is shown:

I can see that the responses are flowing into HA using MQTT Explorer:

Hoping to skip out on saving to an image file and having to clear out images with shell script if I can.

Home Assistant 2023.4.4
Supervisor 2023.04.0
Operating System 9.5

Don’t see any changes to mqtt in the latest hass version that would break this… Were you on an older version before updating? Seems like something hasn’t updated properly in your hass

Installed codeproject.ai and started setting things up only a couple weeks back and keep my home assistant up to date with the latest releases so the inclusion of support for encoding for a virtual camera was included a good month or so before I jumped into the configuration.yaml.

Anything else I can easily check?

I’ve just checked my config and realised that I have the same error, but didn’t see it before because I have my config split into separate files so vscode doesn’t flag it I guess

the correct config is definitely image_encoding: b64 - ignore the vscode error, somebody obviously needs to fix something in the parser

From what I can see in your MQTT explorer though it doesn’t seem like your topic is correct in the config

I’m not sure how to read that screenshot but looks like maybe BlueIris/image/frontporch is your topic… Check your BlueIris config and copy and paste it

Thanks, glad its not my install.

Some fresh settings, but still not working in HA. Just get the blank image

  • BlueIris on one camera with alerts triggered by CodeProjectAI (working well within BI)

  • Settings in config yaml:

mqtt:
  camera:
    - topic: BlueIris/image/frontporch
      name: Alert Front Porch
      unique_id: frontporch_alert
      image_encoding: b64

Latest MQTT Explorer readings:

Still got an empty camera entity when I add it as a new card:
image

Happy to put this on the backburner, but if there is something clearly wrong, please let me know. Thanks for all the help.

That all looks correct now. So when you add the camera/hass reboots/integration reloads etc etc it will initially show blank until an alert is triggered.

Are you definitely getting no image even after a trigger?

You could try making an automation which just sends a message to logbook when that topic is triggered, to make sure hass sees the mqtt topic at least

It’s working! Have an image appearing in the entity on a dashboard. Next step is to see if I can push that image over to HA companion app on iOS. Thanks for your help.

1 Like

No worries :slight_smile:

I’m hoping someone can help me. I tried to set this up and I’m having the “NO RECORD” payload issue. I am having no problem getting notifications but no image seems to come across. I saw @royle and @TheHolyRoger having this discussion here where it looks like @royle solve this but a solution wasn’t shared. Any insight would be greatly appreciated!

I’m on BlueIris version 5.6.4.2

My MQTT BlueIris alert setup is as follows:

MQTT Explorer shows “Garage = NO RECORD” under BI/alerts/Garage

From what I remember this is a bug with specific BlueIris versions, should be fixed with an upgrade

I just tried upgrading from 5.6.4.2 to 5.7.5.6, restarted the PC just in case, and tested and the “NO RECORD” value still comes across in the payload. Any other suggestions would be greatly appreciated! :slight_smile:

When using the following Blue Iris MQTT Post/payload:

{ "camera":"&CAM", "time":"%Y%m%d_%H%M%S", "dbid":"&ALERT_DB", "clipid":"&ALERT_CLIP", "memo":"&MEMO", "alertjpg":"&ALERT_JPEG"}

My MQTT explorer output is:

Hmm try repairing/rebuilding your database maybe? Could be that…

Are your alerts working fine in blueiris/the web interface at the moment?

If it’s not your database, try sending a payload with only &ALERT_JPEG as I think it could have issues if it’s not sent on it’s own

Okay, found the issue. Appreciate your help @TheHolyRoger.

When testing alerts in the BlueIris “On alert…” screen using the “Test” button, I always receive a “NO RECORD” payload. Yesterday, when I was on version 5.6.4.2 I tested alerts both in the UI and physically going outside and triggering the camera and both yielded a “NO RECORD” payload.

After upgrading to 5.7.5.6 and physically triggering the camera by going outside in front of the camera I am receiving data in the payload using “&ALERT_JPEG”.

Great stuff no worries :+1:

Following up with an updated Node-RED solution to help any future lurkers who prefer Node-RED. I am on BlueIris version 5.7.5.6. To test if the image is properly coming across in the notification you must physically trigger the camera by moving in front of it; using the BlueIris UI Alerts Test button to trigger the camera will generate a notification but will not include the image in the notification.

Step 1: Set up two MQTT Alerts in Blue Iris for each camera
The prerequisite is that you have to have MQTT setup in the main BlueIris settings tab under the “Digital IO and IoT” tab.
I require both mine to have either a person or car or both as required AI objects.

MQTT topic1:

BI/&CAM/alert

Post/payload1:

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

MQTT topic2:

BI/&CAM/alert-image

Post/payload2:

&ALERT_JPEG

Step2: Setup a mqtt camera for each camera in your HomeAssistant’s configuration.yaml file

mqtt:
  camera:
    - unique_id: camera.garage_alert
      name: garage_alert
      topic: BI/garage/alert-image
      image_encoding: b64

Step3: Setup Node-RED Automation
Copy the Node-RED automation below and import from clipboard in the Node-RED hamburger menu. Update nodes to reflect your HA instance and your BlueIris URLs. My automation only allows each individual camera to trigger a notification every 45 seconds at most. Any triggers that occur less than 45 seconds after a prior notification are dropped per camera. My backyard cameras are only send notifications if triggered between 11PM and 6:30AM at my preference. I am formatting the camera names in a function to have proper case in the notifications.

[{"id":"f755e494b8aeaaaa","type":"api-call-service","z":"f72992d4736dc75b","name":"BI Notifications","server":"cb755160.a7d29","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_k_phone_ha_app","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":msg.payload.objectFormatted & \" @ \" & msg.payload.cameraFormatted,\t \"data\": { \t            \"channel\" : \"BlueIris\",\t            \"ttl\": 0,        \t            \"priority\": \"high\",        \t            \"clickAction\": \"https://YourBlueIrisURL-RemoveHTTPSIfNeeded/ui3.htm?maximize=1&tab=alerts&cam=\" & msg.payload.camera & \"&rec=\" & msg.payload.id,\t            \"url\": \"https://YourBlueIrisURL-RemoveHTTPSIfNeeded/ui3.htm?maximize=1&tab=alerts&cam=\" & msg.payload.camera & \"&rec=\" & msg.payload.id,\t            \"image\": \"/api/camera_proxy/camera.\" & msg.payload.camera & \"_alert\",\t            \"actions\":  [\t                            {\t                                \"action\": \"URI\",\t                                \"title\": \"Live View\",\t                                \"uri\": \"https://YourBlueIrisURL-RemoveHTTPSIfNeeded/ui3.htm?maximize=1&cam=\" & msg.payload.camera\t                            },\t                            {\t                                \"action\": \"URI\",\t                                \"title\": \"View Clip\",\t                                \"uri\": \"https://YourBlueIrisURL-RemoveHTTPSIfNeeded/ui3.htm?maximize=1&tab=alerts&cam=\" & msg.payload.camera & \"&rec=\" & msg.payload.id\t                            }\t                        ]\t                    }\t            }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1320,"y":120,"wires":[[]]},{"id":"29af64bd25d6636b","type":"mqtt in","z":"f72992d4736dc75b","name":"","topic":"BI/+/alert","qos":"0","datatype":"auto-detect","broker":"cd7af798304ca36c","nl":false,"rap":true,"rh":0,"inputs":0,"x":160,"y":100,"wires":[["927c62ca2dd76e99"]]},{"id":"1a98360942525e7e","type":"function","z":"f72992d4736dc75b","name":"format variables","func":"var vObject = msg.payload.object.charAt(0).toUpperCase() + msg.payload.object.slice(1);\nvar vCamera = msg.payload.camera.charAt(0).toUpperCase() + msg.payload.camera.slice(1);\n\nmsg.payload.objectFormatted = vObject\nmsg.payload.cameraFormatted = vCamera\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1120,"y":120,"wires":[["f755e494b8aeaaaa"]]},{"id":"73ca775ee0ce6f41","type":"api-current-state","z":"f72992d4736dc75b","name":"Garage Door Not Open","server":"cb755160.a7d29","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"binary_sensor.pingpong_table_area_input","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":890,"y":80,"wires":[["1a98360942525e7e"],[]]},{"id":"927c62ca2dd76e99","type":"switch","z":"f72992d4736dc75b","name":"camera switch","property":"payload.camera","propertyType":"msg","rules":[{"t":"eq","v":"doorbell","vt":"str"},{"t":"eq","v":"garage","vt":"str"},{"t":"eq","v":"backdoor","vt":"str"},{"t":"eq","v":"cococam","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":400,"y":100,"wires":[["c03afd6f965b7b44"],["9727c2e490af24a4"],["3a7759ef08dce07d"],["ca064ba86a377434"]]},{"id":"7350033368a6c12c","type":"time-range-switch","z":"f72992d4736dc75b","name":"Time Range","lat":"38.65969","lon":"-121.77244","startTime":"23:00","endTime":"06:30","startOffset":0,"endOffset":0,"x":930,"y":160,"wires":[["1a98360942525e7e"],[]]},{"id":"c03afd6f965b7b44","type":"delay","z":"f72992d4736dc75b","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"45","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":640,"y":60,"wires":[["73ca775ee0ce6f41"]]},{"id":"9727c2e490af24a4","type":"delay","z":"f72992d4736dc75b","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"45","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":640,"y":100,"wires":[["73ca775ee0ce6f41"]]},{"id":"ca064ba86a377434","type":"delay","z":"f72992d4736dc75b","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"45","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":640,"y":180,"wires":[["7350033368a6c12c"]]},{"id":"3a7759ef08dce07d","type":"delay","z":"f72992d4736dc75b","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"45","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":640,"y":140,"wires":[["7350033368a6c12c"]]},{"id":"cb755160.a7d29","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"cd7af798304ca36c","type":"mqtt-broker","name":"","broker":"http://192.168.1.57","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]
1 Like