Blue Iris Integration Tutorial

Well if there’s any one else interested in this I figured it out. Or well I should say I found a workaround, still have no idea how to get Blue Iris’s MQTT TLS features to work. Instead I just let Stunnel handle the TLS part. I already had Stunnel set up for encrypted access to the webserver to I added the following client entry to it:

[mqtt]
accept      = 127.0.0.1:1883
connect     = <broker hostname/ip>:8883
client      = yes
verifyChain = yes
CAfile      = <CA file>
checkHost   = <hostname on broker certificate>
cert        = <client cert>
key         = <client key>

Or if you don’t use client certs then just this:

[mqtt]
accept      = 127.0.0.1:1883
connect     = <broker hostname/ip>:8883
client      = yes
verifyChain = yes
CAfile      = <CA file>
checkHost   = <hostname on broker certificate>

Upload the certs to Stunnel’s folder and fill in the blanks above. Then you can just put this as the MQTT config in Blue Iris:
Screen Shot 2022-07-21 at 4.42.04 PM

Lot simpler then trying to figure out what magic locations Blue Iris wants particular files in and which certs work and which don’t.

1 Like

I would also like to know this!

The bit about making sensors out of motion alerts still works. That’s basically what I did. I wasn’t really interested in pure motion ones so I tweaked it to make sensors for person, animal and sound alerts. But it’s all the same process:

  1. Add an “on alert” action in Blue Iris
  2. Tweak conditions at the top to your needs
  3. Send ON to a topic that contains your camera name (or just use the placeholder &CAM so you can copy and paste it all over)
  4. Add an on reset action to send OFF to the same topic
  5. Make an MQTT sensor out of it in HA

I have no idea if the “getting your cameras in a dashboard” bit works. I didn’t bother with that, I just view my cameras in Blue Iris since I like their interface and I want to be able to view timelines and clips too. Though if that part doesn’t work for you there is also this guide:

The other guide I found extremely useful was this one as these notifications with an image is what I really wanted:

I should also note that although the author shows it with Node RED that’s really not required. This post shows how to do it purely from HA by copying and pasting a few lines of YAML.

Any chance you can post the setup on blueiris camera and maybe how you are triggering an automation. I am not new to home automation but newer to MQTT and JSON and am trying to trigger an automation based on the person detection in certain cameras. I am really struggling with this. I can see the payloads when i listen to the topic but can’t seem to trigger any automations…

Hi ive got this as a sensor in my configuration

  binary_sensor:
    - device_class: motion
      name: 'Door Bell BI Motion'
      state_topic: 'BlueIris/DoorBell/Status'
      value_template: "{{ value_json.trigger }}"
      json_attributes_topic: "BlueIris/DoorBell/Status"
      json_attributes_template: >
        {
            "trigger": "{{ value_json.trigger }}",
            "image": "{{ value_json.image }}",
            "object": "{{ value_json.memo.split(":")[0] }}",
            "confidence": "{{ value_json.memo.split(":")[1].strip('%') | int }}",
            "type": "{{ value_json.type }}"
        }

in BI alerts tab for the camera On Alert

On Reset

this will tell me if there is motion in zone A, if you had a few different zones then it will say where the motion is.

I plan to use this as my payload for more info

{ "type": "&TYPE", "trigger": "ON", "memo": "&MEMO","data": &JSON, "path": "&ALERT_PATH"}

but I haven’t got round to doing it yet. i don’t have an automation set up yet but I hope this helps

2 Likes

Just an FYI. I live in Ohio and had a young IT student call me at home from Texas as he demonstrated that he was able to see all cameras and move my PTZ cameras. Bottom line is I simply eliminated any WAN access and setup a VPN on my router. This way the only access to BI remotely it to first login to the VPN which then the BI app works on your home local network. May not be for everyone but it was easy to add a good level of security. I do not use geofence but it will work with a phone if you at least have the VPN turned on your phone. Or at least it does for me.

1 Like

Hi I am trying to integrate Blue Iris, on my second Home Assistant server.

IO do receive the following error


Invalid administrator credentials

but the credentials are correct. What am I missing?

Hi All,

Has anyone found a solution to detecting in HA, when a BI camera is offline?

I see a ‘connectivity’ entity under each of my cameras, but BI has been reporting unable to connect to one of them for 2 weeks (EzViz’s dumb firmware update killed RTSP!) yet the HA entity shows ‘Connected’ throughout that time and no change today when I got the camera back online in BI.

BI can alert connectivity issues, but would do that when a camera drops out for a few seconds, which isn’t helpful. What I need, is a nice sensor in HA that I can test for ‘offline 5 minutes’ then alert or even trigger a power cycle of the camera.

Has anyone made this happen?

Thanks!

Hi @jefft4, I have this setup via the BI watchdog section, where I set a “detect signal loss” alert after a certain timeout and a certain number of retries. My BI cameras then send an alert on a http API which sets a virtual switch to on. Then I have a simple logic to alert me on the dashboard based on state.

I have the BI cameras integrated via Hubitat, but I am guessing something similar can be done directly in HA either via a http or mqtt.

Ah, that’s a thought, test it in BI and push the notification to HA. I’ll look into that, thanks :slight_smile:

I use a “ping” binary_sensor to detect network offline states.
Create an entity for each camera’s IP address (and one for the BI server).
I also created a dummy IP address for testing disconnected states.

binary_sensor:
  - platform: ping
    host: 192.168.1.149
    count: 2
    scan_interval: 30
    name: badIPtest

  - platform: ping
    host: 192.168.1.150
    count: 2
    scan_interval: 30
    name: Blue Iris

  - platform: ping
    host: 192.168.1.154
    count: 2
    scan_interval: 30
    name: IPCam-Front

Hi folks,

Does anyone know how to force the HA Blue Iris integration to use the sub-stream rather than the main stream from a camera? My dashboard is trying to pull 7 cameras, all >4MP @ 15fps and it’s not coping well. It’s only an 8" tablet, so the sub-streams (usually <1MP) would be perfectly adequate for the job. BI itself is using the sub-stream for motion detection etc and the main stream only for recordings.

Thanks!

For those of you wondering about enabling/disabling cameras, I modified magapp/blueiriscmd to include an enable/disable camera parameter. My fork is computersandstuff/blueiriscmd.
It still uses the JSON api and all the session management that was included in the original script.
I’m hoping to use this somehow on my own HA installation and maybe one of yall will find it useful.

You can also use MQTT, e.g.

Off:
{“topic”:“BlueIris/admin”,“payload”:“camera=camera_shortname&enable=0”}

On:
{“topic”:“BlueIris/admin”,“payload”:“camera=camera_shortname&enable=1”}

Sorry to piggyback on this threat, but I had Blue Iris & HA working with MQTT, but it’s now all screwed up and I’m not sure what I did (if anything).

For unrelated reasons, I did a system settings restore on BI. I also renamed a camera, so I went back in the HA BI integration to make sure the motion binary sensors were adopted, and now the only items with a menu are the BI “Profile switches” (i.e. Schedules, see screenshot).

I deleted the entire integration, rebooted, and started over, but no joy.
chrome_mP9blHEaEX

Hi Jeff,

Old post but did you find a solution? Thanks

I didn’t. I switched to using WebRTC for live streams directly from the cameras. It’s a bit flaky at times, but generally more timely than BI and I can specify the stream in the URL.

1 Like

I fixed my issue of not being able to adopt most of the Blue Iris entities, but not sure why it worked. I changed my Blue Iris login to the same credential as I have in HA for MQTT. The permissions were the same as the prior user, so who knows, but it’s working now.

Hi all, I’m trying to get a few sensors configured - Not for notifications, but just for a dashboard. We get notifications through the BI app.

I have a wall tablet that I’d love to display a couple of things on that have been captured by the AI, basically

Driveway camera - Motion triggered within Zone B and the AI Type confirmed (person, car, face, plate etc)

But I also want this to both show a current status (Clear after a certain amount of time) and Show a history (last driveway motion was)

I’ve got MQTT configured and working, but I’m struggling to create a sensor(s) to do what I want.

My MQTT payload is this
‘&CAM’ (&TYPE&MEMO) triggered at %X
and MQTT topic is BlueIris/driveway

Which is giving me an MQTT message of 'FNorth' (person) triggered at 4:36:55 PM
I also have another payload posting on reset, which is ‘&CAM’ clear which gives me an MQTT message of 'FNorth' clear

I want to put a card on my dashboard that both gives a current status sensor - so Clear when AI is not actively detecting something, but also different have a last detected sensor - Person was detected 15 mins ago

What should I be looking at to do this?

On BI5 side, for confirmed events, I send MQTT msg with this payload:

{ "state":"ON", "cam":"&CAM", "memo":"&MEMO", "camera_name":"&NAME", "type":"&TYPE", "last_tripped_time":"&ALERT_TIME", "alert_db":"&ALERT_DB"}

On HA side, I have a binary sensor defined for each cam, example:

mqtt:
  binary_sensor:
    - name: "Person near Garage"
      object_id: "person_near_garage"
      state_topic: "BlueIris/activity/Garage"
      value_template: "{{ value_json.state }}"
      json_attributes_topic: "BlueIris/activity/Garage"
      off_delay: 15
      device_class: motion