Blueiris camera's in HASS

I can’t speak for iSpy (never used it), but generally most discussion forums seem to point towards Blue Iris as a highly powerful and flexible surveillance software. It’s well supported and the developer regularly adds new features. It’s probably not worth it for a basic user, but definitely worthwhile for someone who wants a highly configurable surveillance system. Anything in between then save yourself the trouble and get a dedicated NVR.

If you are looking to buy, I bought through here recently as it was the cheapest option https://www.colormango.com/product/blue-iris_142648.html If you’re after multiple licenses, once you have your first licence then contact blue iris support and ask politely. They generally give additional licences to existing users at 50% off.

1 Like

Cheers for that, I will definitely look into it over the next couple of months as I add new cameras into my setup.

Since my last post I’ve decided to forgo using Blue Iris to do the sending of my emails. Instead I’d use HASS to do this because that way I’d be able to combine a HiRes photo from every surveillance camera in the on the one email. My code is as below:

notify:
  - name: Email_Notification
    platform: smtp
    server: smtp.gmail.com
    port: 587
    sender: [email protected]
    starttls: true
    username: [email protected]
    password: PASSS
    recipient: [email protected]

shell_command:
  trigger_blueiris_alert: curl 'http://192.168.86.61:81/admin?camera=LR&trigger&user=admin&pw=PASS'
# note: you have to run "CHMOD 777 /home/pi/blueiris/" to grant venv user 'homeassistant' access to write to the folder
  get_mbr_jpg: wget -O /home/pi/blueiris/MBR.jpg 'http://192.168.86.61:81/image/mbr?user=admin&pw=PASS'
  get_cbr_jpg: wget -O /home/pi/blueiris/CBR.jpg 'http://192.168.86.61:81/image/cbr?user=admin&pw=PASS'
  get_lr_jpg: wget -O /home/pi/blueiris/LR.jpg 'http://192.168.86.61:81/image/lr?user=admin&pw=PASS'

script:
  capture_all_cameras:
    sequence:
      - alias: MBR
        service: shell_command.get_mbr_jpg
      - alias: CBR
        service: shell_command.get_cbr_jpg
      - alias: LR
        service: shell_command.get_lr_jpg
      - alias: Send Email
        service: notify.Email_Notification
        data:
          title: 'HASS Kitchen Notification'
          message: 'Sent by Home Assistant'
          data:
              images:
                  - /home/pi/blueiris/MBR.jpg
                  - /home/pi/blueiris/CBR.jpg
                  - /home/pi/blueiris/LR.jpg

automation:
  - alias: Trigger Email Alert with LR Ecobee Sensor
    trigger:
      platform: state
      entity_id: binary_sensor.living_room_occupancy
      state: 'on'
    action:
      service: script.turn_on
      entity_id: script.capture_all_cameras
4 Likes

Any one knows is there any difference in version/license/updates of Blueiris software from these sellers?
In fact Amazon has least price $44.99?

Amazon: https://www.amazon.com/Amcrest-Blue-Professional-Version-mail/dp/B008YD80KC#Ask
Above mentioned link: https://www.colormango.com/product/blue-iris_142648.html
Blueiris website: http://blueirissoftware.com

Thanks

Can’t speak for the Amazon one but the ColorMango one (which I bought from) and the actual Blueiris one are exactly the same. If you follow the checkout process of both you’ll find they take you to the same website just prior to payment.

how do you use the trigger_blueiris_alert command? Can’t see it in the automation or script…

Also, can you explain how the pictures are getting from BI to the Pi

thanks

In the 2nd example I don’t bother triggering blue iris. I instead use Blueiris’s JPG URL to download the images I need and then these are attached to the notify email.

If you want to use blue iris alert, then refer to the example used in post #19 above.

I almost have this working. I’ve run the chmod command to give /home/user/blueiris rights to my venv user. When I switch to this user and activate the venv I can even run the wget commands, manually, one by one, and each image gets created. I’m also able to delete the files from command and re-run.

But when I trigger the script, the email is sent with no attachments. HaSS logs say attachment doesn’t exist.

(If I don’t delete the files after manually running the command, then the images do get attached!)

So the problem is when the shell command is being run. Any ideas on where I can look next?

Looks like the script in your config is wrong or you still don’t have rights. Did you run this command with a superuser account. You don’t need to do this whilst in the venv.

Sudo CHMOD 777 /home/pi/blueiris/

Hi sebdoan, thanks for replying. I managed to figure out the problem a few days ago.

I did assign the permissions to the download folder (/home/pi/blueiris) and knew I did this correctly because I could switch to hass user in virtual env, activate source, and manually run those commands. The image downloaded too!

So like I said, so close!

In the end I needed to adjust the shell command in HaSS and include path to wget!

Here is my working shell_command:

capture_back_image: /usr/bin/wget -O /downloads/back.jpg “http://blue_iris_ip:81/image/back?user=admin&pw=password”

Glad it’s working for you. If you’re interested I’ve now added a day, time and date stamp to each email, as below.

  - alias: Send Email
    service: notify.Email_Notification
    data:
      title: 'Front Gate Opened '
      message: 'Sent by Home Assistant, {{now().strftime("%H:%M:%S %A %d-%m-%Y")}}'

For anyone like me who gets a heap of errors in their “home-assistant.log” file after adding Blue Iris Cameras into their setup I’ve found the below addition to “configuration.yaml” file to hide all the warnings when the camera http fails to parse.

# Disable WARNINGS in log for Cameras. Refer here: https://home-assistant.io/components/logger/
logger:
  default: warn #The default level & above to be logged
  logs:
    requests.packages.urllib3.connectionpool: error #for this item anything below error will not be logged

Have you found a way to give this binary sensor a friendly name? I have a page on my front end that displays the status of all my motion sensors but adding a friendly name in the customize section doesn’t seem to work since the sensor isn’t loading until after HASS boots up. It would be great to find a way to make that work.

I just tested this. Not sure if its the best way but you can send the Friendly name in the post command

so for one of my cameras the post looks like this.

{"attributes": {"friendly_name": "Driveway Camera"}, "state": "on"}

you also need to update the post data as well otherwise it will erase the friendly name attribute

{"attributes": {"friendly_name": "Driveway Camera"}, "state": "off"}

2 Likes

Thanks, I’ll try that. Cheers!

Just posted a request that might be of interest. Hope someone might know how to do this.

I’m trying to setup iOS notifications on motion events that will embed a jpg of the event. Motion events successfully trigger a notification to the iOS app, however, I can’t figure out the best way to deal with getting the relevant jpg file into a state where HASS can grab it and use it for the notification. Blue Iris is creating jpgs with the default file format (&CAM.%Y%m%d_%H%M%S) on each event trigger and storing them to the NEW folder.

What would be the best method of getting these to HASS and allowing it to use the file in the notification? I’m concerned that with the current file naming, HASS would need to know the exact second the file was created to link to the file and it would fail often. Any input?

Recently I had some people around my house trying to break in. All caught nicely with Blue Iris.

This made me think; what happens with these video’s when they would actually be succesfull, break in and steal my server…

To overcome this I now have a shell command that triggers a backup of BI video’s to Google drive when alarm is triggered. Basic steps can be found here. If more people interested I can write down how I did it in HASS in more detail.

1 Like

I’m certainly interested if you have the time to share.

1 Like

I’ll give it a try:

  1. On the PC running BI you need to install Eventghost
  2. When you now do stuff on your PC you will actually see most of that logged in the window on the left
  3. Now install Autoremote plugin into Eventghost. We need this plugin to catch the calls from HASS. The plugin is actually made for linking with mobile phones but you can ignore that. As far as I remember there was no need to setup a phone in the autoremote plugin. If you have to just put in a dummy.
  4. It might be that you need to open your windows firewall to the ports mentioned in the plugin
  5. Now you need to test if Eventghost received the calls! Go to your PI you are running HASS on, login via putty and make a call to your BI servers. For instance "curl -m 1 "http://IP_of_BIserver:port/?message=test"
  6. you should receive that in the logging window of eventghost. Don’t progress before you have this working. If it works all the basics are in order!
  7. Create a batch file on your windows machine. I only have one line in that: xcopy "F:\BlueIris\New" "F:\Google Drive\BackupBIVideo" /c /d /e /h /i /k /q /r /s /y /j /z . keep the parameters the same but of course change the locations to the ones you have/want to use.
  8. Now setup the macro in Eventghost. Pls also check the post here for that. It should catch your ‘alarm’ message and then execute a batch script (the one from the step above). There are many manuals to be found how to do this so will nor repeat here.
  9. Now add to your configuration.yaml in hass a shell command (the forum does now allow me to format correctly , so the ** are spaces):
    shell_command:
    **backup_bivideo: curl -m 1 http://192.168.1.40:1818/?message=alarm
  10. Then in your automation that detects alarm add under actions:
    service: shell_command.backup_bivideo

And that is it.

2 Likes