Blue Iris Integration Tutorial

I’m trying to get this all setup, so I can turn the sprinklers on when dogs go on my lawn :wink:

I’m getting the trigger for person reliably firing but the reset trigger is intermittently not

**Might have just resolved it, removed the ‘Required AI objects’ from the ‘On Reset’ action, so will monitor
Thought it was still worth the post, incase anyone else is having the issue

Edit.
Still does not always send the OFF mqtt message :frowning:

The missing OFF mqtt alert is blueiris fault ( I guess it can be considered a bug). It only happens when unsing deepstack AI.
My workaround solution is to use Homeassistant itself to fix it, by posting a MQTT message with the OFF on the same topic.
Using an Automation to monitor the Sensor state, if the motion stays ON for too long, it triggers.

alias: Reset BI Stuck Motion Sensor
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.blueiris_amcrest122_motion
    to: 'on'
    for:
      hours: 0
      minutes: 1
      seconds: 0
  - platform: state
    entity_id: binary_sensor.blueiris_amcrest122_motion
    to: 'on'
    for:
      hours: 0
      minutes: 5
      seconds: 0
condition: []
action:
  - service: mqtt.publish
    data:
      topic: BlueIris/AmcrestFrontDoor/Status
      payload: '{ "type": "MOTION_HA_RESET" , "trigger": "OFF" }'
mode: single

I did my mqtt sensors from out of my head, not based on this thread, so adjust your topic accordingly.

edit: some extra info, since I’m using elad_bar/blue_iris custom component, I noticed the component looks for the word MOTION on the payload to parse the status of the binary_sensor, so that is why I chose MOTION_HA_RESET, it could be anything really as long it contains the word MOTION

edit: more info, when using deep_stack alerts , if the mqtt payload is set to { "type": "&TYPE" , "trigger": "ON" } , the deep_stack alert will output the alert as type EXTERNAL , which the blue_iris custom component will not parse into the binary motion sensor, it will trigger a separate binary external sensor.
So in my case, to simplify my ha sensors, I hardcoded the word MOTION on the blueiris mqtt alert topic, like this:

1 Like

Thanks, ill give this a shot

I am trying a new thing now for reset but from within blueiris. I added a delay and then an alert that will send an OFF instead of an ON.



Instead of creating a topic per object. Wouldn’t it be better to post a json payload containing the &MEMO variable?

See my sensor for example:
{ “type”:"&TYPE", “trigger”:“ON”, “memo”:"&MEMO", “json”:"&JSON", “path”:"&ALERT_PATH"}
turns into
{ “type”:“MOTION_A”, “trigger”:“ON”, “memo”:“car:80%”, “json”:"[{“api”:“objects”,“found”:{“success”:true,“predictions”:[{“confidence”:0.79541016,“label”:“car”,“y_min”:629,“x_min”:1323,“y_max”:774,“x_max”:1575}],“duration”:0}}]", “path”:"@4226890"}

I’ve installed the blue iris HACS add on and whilst motion detection events are still working the cameras within HA keeping going unavailable and I have to restart HA to get them to work again.
Has anyone got any ideas on what is going on? Logs show this error

Error from stream worker: Stream ended; no additional packets
Error from stream worker: Error opening stream (HTTP_FORBIDDEN, Server returned 403 Forbidden (access denied)) http://IPAddress/h264/CarPark/temp.m3u8?session=0d7807474bb21fd62e027ee27ddf5c4a

So i seem to have got this working now without any issues, poss BlueIris server settling down.
The next question though is that when i access these camera up to Google Home via HA and stream them to a google cast there is a lag of about 30 seconds! Any idea how to get rid of this

I’ve been having this issue for a while now. I’ll poke at it, get nowhere, and give up. So - I’m poking at it again - maybe someone can help.

So from yesterday morning (part of my ongoing issue) the Blue Iris Motion Binary Sensor in Home Assistant has been showing “detected motion”.

Today at 2:05:47pm, a truck pulled into the driveway.

At 2:06:14pm, the Home Assistant motion state changed to CLEARED.

At 2:08:35pm, the truck left.

At 2:08:44pm, the Home Assistant motion state changed to DETECTED MOTION.

At 5:27:08pm, a truck pulled into the driveway.

At 5:27:34, the Home Assistant motion state changed to CLEARED.

At 5:29:53pm, the truck left.

At 5:30:00pm, the Home Assistant motion state changed to DETECTED MOTION.

At 5:30:16pm, the Home Assistant motion state changed to CLEARED.

I’m in a rural area, so I can go a day or two with no activity. I use this motion sensor for a two minute automation trigger for my driveway lights, and to send my android a notification and have my Google device play a recording. But with the state staying in DETECTED MOTION - I have come home at night and no lights come on, or if someone comes in the driveway I don’t know it.

If anyone has some suggestions or assistance - I’d greatly appreciate it. I’m on current versions of everything.

I’ve been having this same issue for a while now (not the 403 error though). My logs are always getting spammed with stream ended errors, forcing me to restart HA to get the feeds back.

Is anyone seeing significantly higher BlueIris CPU usage since Home Assistant 2022.2.x? Anytime the integration is enabled (after a HA restart) BI CPU consumption goes from a normal ~3% to a whoping ~35%. Once I shut the integration down (after a HA restart) BI CPU consumption returns to ~3%.

1 Like

I’m glad I’m not the only one frustrated with BI Deepstack mqtt alerts not turning off. Is BlueIris correctly resetting the alert in it’s internal state, and just forgetting to send to MQTT?

Are there any BI forums/github where I can track the bug?

I’ve got the same issue as well. Not quite sure what is causing it

Have you checked to see if BI is sending the message via http://mqtt-explorer.com/?

I have watched the MQTT messages to confirm BlueIris is not sending the OFF message

Thanks. There is an official forum for BlueIris (personally I’d avoid the unofficial one like the plague) that would be your best bet. You could email Blue Iris Support but hard to say if you’ll get a response or not.

I’m trying to cast a Blue Iris camera to a media player. I have the camera set up in the Blue Iris integration and I set up an automation but I get this in the log:

Media type image/jpeg is not supported with format None (mime: image/jpeg)

I also created a MJPEG IP Camera entity with http://192.168.xxx.yyy:84/mjpg/camera/video.mjpeg

That shows the camera on Lovelace, but I get the same Media type error as above.

How do I debug this?

Cheers, Richard

Yep, if BI is running and HA is off CPU usage is around 6%. Once HA starts up the BI CPU usage jumps to 40-50%

1 Like
1 Like

I just deleted the integration and re-added it, but the CPU usage is still going up to 100%.

Is the HA integration user cycling through all the camera’s in BI, every ~2 seconds?