BI + Home Assistant

CamFan

Getting the hang of it
May 25, 2014
143
65
California
I want to use Home Assistant for notifications with still images from camera. I'm struggling to figure out the best way to setup Home Assistant.

I tried individual cameras, but I think I need to have Home assistant feed from Blue Iris. Not sure.

Any tips?
 
Here is a pertinent thread on Home Assistant community: Blue Iris motion alerts to notification with image in Home Assistant

Do a search on that site, there are many threads on this topic.

Essentially,
#1: Setup MQTT server like Mosquito (it's available as Home Assistant add-on)
#2: Point Blue Iris to MQTT and "On Alert" event, send a payload to MQTT
#3: In Home Assistant, create an automation to trigger on MQTT, the action is to send yourself a notification, most commonly, to your phone Home Assistant app.

If you are new to Home Assistant and BI5, this is probably daunting but there are many examples on HA community site to help you achieve success.
Once you have the above success, you may want to expand your automation with more complex conditions and add other actions like turning on lights/sirens, etc --- in addition to notifications.
 
Last edited:
  • Like
Reactions: aesterling
If you're familiar with HA blueprints here's an example that should help configure this.

 
@Vettester FYI Blueprint will help with #3. It doesn't help with steps #1 and #2, that still needs to be done separately.
 
I have motion detection with external sensors providing notifications from Home Assistant working right now.

Option 1 - Should I use Blue Iris to generate the notifications on my 3 x phones?

I've setup MQTT broker on HA, was able to connect Blue Iris to broker but missing the steps on how to connect MQTT to trigger alerts. Not interested in adding more hardware (sealevel device or an arduino). I don't need or want to do any in-camera image motion analysis.

Option 2 - Use a blueprint

- Do I pull images from Blue Iris or from the cameras? I can pull images from my Hiks using this URL: (shows up in a browser) but I can't seem to add a 'generic camera' to Home Assistant, I think it's because all the streams are consumed by Blue Iris?
 
Last edited:
@CamFan Based on your most recent post, I assume you have setup this in BI5 and the test button was successful?
BI MQTT setup.png

#2: Next, for a given camera, did you configure "On Alert..." to send MQTT when there is event?

On alert.pngMQTT msg.png

You will notice with my configuration, I like to send JSON payload like
{ "state":"ON", "cam":"&CAM", "memo":"&MEMO", "camera_name":"&NAME", "type":"&TYPE", "last_tripped_time":"&ALERT_TIME", "alert_db":"&ALERT_DB", "preset":"&PRESET"}

*** You can assemble the BI5 alert image URL from &ALERT_DB


#3: The HA automation is pretty simple. The trigger is to listen to MQTT as shown in screenshot. And the action is a notification.
automation.png
 
Last edited:
@CamFan Just in case you did not know, you should download MQTT Explorer. It's a great way to confirm that BI5 is connected to MQTT server and you can see each message on the right hand side.

If you can see MQTT messages appearing in MQTT server for each camera event, then the next step is to make sure your Home Assistant automation is picking up each msg.

If you are new to Home Assistant automation, you'll just need to take the plunge and try. You might make a mistake or get stuck but you'll figure it out.
MQTT explorer.png
 
So here is raw YAML for my notification action. It's highlighted in the red box below.

Within this highlighted red box, note the BI5 alert image URL, you can get more details from BI5 documentation.

In my case, I chose NOT to send the image itself to Home Assistant because I did not want to store same jpeg in Home Assistant.
Alert JPEG is already stored in BI5.
So I get to alert image via the URL when I open a notification on my phone. As you can see, the alert image URL uses &ALERT_DB value passed via MQTT msg.

BTW, I'm not saying that my example is the only way. Hence, why I suggested previously to look at some of the other threads on Home Assistant Community site.

Good luck!

P.S. The benefit of using BI5 alert image is that it can have AI detection burn-in so you can see what object is detected. You can obviously use a different image URL like directly from a camera. Your choice.

notification.png
 
Last edited:
Thank you @Vettester & @actran!

This is all very useful. I was able to get the HIKs added to HA as generic cameras for still images. (firewall issue, I had the HIKs locked down tight). I'll work on the blueprint now.

I'll also be sure to try out Blue Iris MQTT, I was able to test my server (Home Assistant Broker).

I'll try both, see which one works best & report back.
 
keep posting various HA + Blue Iris tips, tricks, automatiions ,etc. More and more people are getting into both.
I was slammed into the process and have it barely working for my security needs. I know there is much to polish up...and even more to expand upon with this wicked combo of HA+BI. One day...one day...
 
For Option 1 - using Blue Iris to do notifications - no joy.

Recall, I have a wimpy PC and don't want to do any image processing, AI or or in-camera. I just want my old-school alarm sensors triggering Blue Iris. I used to do this with Milestone (using Barionet), but that software is so bloated and expensive.

I was able to setup the MQTT server. Blue Iris tested connection fine. But not seeing anything in the manual how to trigger Blue Iris from HA.

It seems Blue Iris can send MQTT, not sure if it can listen to MQTT?

For Option 2 - using Home Assistant to do the notifications - works great, super happy.

The blueprint worked great. Images pop up quickly, no perceivable delay. Even my Milestone + Barionet setup had at least a second or two delay on images, so you miss fast action.

This blueprint is super simple to setup and works well pretty well. Send camera snapshot notification on motion. It could use some refinement (conditions for alerts, like when I'm not home or when alarm is set).

I setup the integration for each Hikvision camera, I mostly have older 2032 cameras for now. Bypassed any Blue Iris setup, it looks to be a bit more complex (install HACS or use the Blue Iris Blueprint - which I think adds latency).

For future folks looking to do the same, this works for me:
  • Add integration: "generic camera"
  • used the camera still image URL: http://192.168.00.000/Streaming/channels/1/picture
  • Stream source - I left blank, I think Blue Iris is consuming these streams and I just wanted image notification
  • set HTTP as the RTSP transport protocol
  • set basic authentication, add the username and password for your camera
  • no SSL
On the blueprint, be sure to set the delay to 0 seconds, it defaulted to no value for me and was causing errors.

This blueprint looks like it builds on the one I used, with some more features, like blocking Notification with camera snapshot with blocking condition and clickaction
 
Last edited:
@CamFan If you want to trigger BI5 from Home Assistant, here are some example configs you can setup in your HA configuration.yaml.

Once you've restarted HA, these actions will be available in automation. So when your alarm sensor trigger,do bi5_trigger action.

***Look at BI5 documentation for more details on these HTTP commands.
***Note that I did not have to specify user/password because in BI5, I added HA IP address as a server that doesn't need authentication.

configuration_yaml.png
 
  • Like
Reactions: Mike A. and CamFan
Actran and Camfan - thank you so much for starting this thread.

It was a lifesaver for someone who was starting from scratch.

Fortunately I also stumbled across this concise, articulate set of steps that probably saved me hours of debugging mistakes had I not been given a process to walk me through everything step-by-step.

I'm reposting in the hopes it will save others time as well.

Blue Iris Motion Detection in Home Assistant (MQTT)
Thank you "Reckless Rewards"!

The blog entry was written in 2024 so it's consistent with currently available integrations and application updates. There are a few places where I could have used extra wording in the steps to quickly identify where the configurations needed to be made, but overall, this allowed me to get everything up and running in 15-20 mins - from nothing ready, to testing my first camera alert.