[HELP] Create an automation for switch Blue Iris profiles

Hi All,

Can someone please help me to create an automation that will switch between two Blue Iris profiles?
conditions:

  1. if I’m home and it’s between 8:00 AM to 23:30 PM - Stay on an inactive profile (so I won’t receive push alerts to my phone)
  2. if I’m away - switch to an active profile so alerts would be pushed to my phone.
  3. if I’m home and it’s 23:31PM to 7:59 AM - switch to the active profile so I would still be able to get alerts.

Currently, I get my push notifications via a Telegram bot (it works pretty great most of the time).
the issue is that I’m constantly getting them which is starting to be annoying :slight_smile:
I do have the BI integration in place and I’ve noticed that there is an entity that can do that, the problem is that I don’t know how to use it.
I have presence detection using the built-in HA and my companion app on my Android.

If there is a better / more efficient way to achieve that, I’m open to anything!
Thanks!!

Which integration is that? I don’t see a built-in integration like that.

FWIW, I switch BI profiles from HA, but I use REST commands. If I could take a look at the integration you’re using, I might be able to tell you how to use it to switch BI profiles. Otherwise, if you’re interested, I could give you some details about how I do in my system using REST commands.

Hi Phil, thanks for the quick response!
I was referring to this integration: GitHub - elad-bar/ha-blueiris: Integration with Blue Iris Video Security Software

I’ve noticed that I could do the REST method as well, wasn’t sure which one is better.
I also didn’t know how to tackle this use case as I mentioned above (when it comes to push alerts).
I don’t make any changes in terms of the way BI is recording or something like that, I would just like to have some sort of “quiet hours” that if I’m home for example few of the cameras won’t drive me crazy with alerts as my dog is constantly patrolling the perimeter.
Would love to hear any other suggestions or use cases. Thanks!

That integration seems like a lot if you only want to control profiles, especially since it says in big bold letters that it’s no longer supported. :wink:

As far as your scenario, there’s probably multiple ways to achieve the same thing. Also depends on if you’re trying to do other things you haven’t mentioned.

Going back to my setup as a reference point, in addition to controlling the BI profiles from HA, I also control enabling/disabling motion detection in each camera from HA as well, also via (different) REST commands.

Basically, I use profiles to decide which cameras should be “on” (i.e., streaming data), and what “mode” they’re in (e.g., night vs day, meaning color vs black & white, etc.) I actually have actions in BI that send REST commands (from BI) to the individual cameras when BI changes profiles. But that’s beyond this topic. lol

For enabling/disabling camera motion detection, HA sends BI a REST command, and then BI does “its thing” to effect that change, since the motion detection I’m referring to is done in BI (not in the camera.)

So, yeah, lots-o-ways of doing things.

Let me know if you’d like more details about how I use the rest_command integration in HA to control BI, and which in particular (i.e., changing profiles vs enabling/disabling BI motion detection.)

Yes I did noticed that it’s not supported anymore but didn’t really care much about it as long as it servers what I need at the moment :slight_smile: but you’re right, I think I don’t even need that integration anymore since I’m not using the streams on picture-card anymore (it just worked horribly… huge latency and bandwidth muncher).
Your setup is way more advanced from what I’m capable at this point to get out of my CCTV system :slight_smile:
with that said, I do want to have the cameras “on” all the time and just control the way I get the motion alerts (so right now, each camera sends the last processed image by Deepstack to my Telegram bot via CURL) I just want to prevent that extra traffic while I’m at home during the day and enable alerts if I’m home during night time, and away.
I’m pretty sure it can easily accomplished by I’m not that savvy with HA yet (and tbh, I got lost a bit with the logic in BI with Scheduling and Profiles when it comes to Alerts)

So, are you using BI’s motion detection, or the camera’s built-in motion detection?

If the former, then you should be able to fairly easily achieve what you want. Notice in BI, if you right-click on a camera’s image, a context menu pops up, and one of the items in the menu is for motion detection. If it’s checked, motion detect is enabled; if not checked, then it’s disabled. Well, you can do the same thing via BI’s REST (aka HTTP) API by using HA’s rest_command integration to send it a command to enable or disable a camera’s motion detection. That’s assuming, of course, the machine running HA can talk to the machine running BI.

E.g., here are some details from my setup:

rest_command:
  bi_cam_motion_ctl:
    url: "http://IP:PORT/admin?camera={{camera}}&motion={{enable}}"
    username: BI_USERNAME
    password: BI_PASSWORD

All the uppercase stuff is installation specific.

You use this via a service call:

- service: rest_command.bi_cam_motion_ctl
  data:
    camera: CAM
    enable: 1

CAM is how BI knows the camera. I’m not in front of BI right now, but IIRC there are two identifiers - a “long” name and a “tag” (or whatever it calls it) which is shorter, in my case, a single character. For the enable parameter, it’s a 1 to enable, or a 0 (zero) to disable.

1 Like

So I do use the motion detection (not the built in BI one, but the Deepstack? I don’t know if I’m referring it correctly). my next question is disabling / enabling motion detection doesn’t interfere with the recordings? like those “marks” on the recording “strip” at the bottom of the main cameras page? so it has those flags wherever a motion was detected? isn’t that mean that it disables that and this won’t longer be recorded? (documented in this “time search” at the bottom?)

My train of thought as that I can somehow just disable the alerts (from the “on alerts” in the “alerts” camera tab) so it would just not send the alert to Telegram but the alert would still be on the BI server

I’ve only used BI for a limited time and haven’t really dug into many of the more advanced features, so I’m probably not the one to bounce ideas off. I’d suggest bringing up the BI help and look for the HTTP API section to see what commands you can send BI. Use the above rest_command example as a reference of how you might send commands to BI. Sorry I can’t help much more than that.

I will go over the API command list. Thanks a lot for your time!