How to change BI profile using HomeAssistant?

whoami ™

Pulling my weight
Aug 4, 2019
233
228
South Florida
Going to need some help here please...

I'm trying to change BlueIris profile when I "Arm/Disarm" my security system using HomeAssistant.

I was doing this using RESTful api in different software which I have decommissioned.

I'm not stuck on RESTful api if it is easier for someone to help me using MQTT. I just need some examples cause everything I've tried isn't work.

YAML:
rest_command:
  bi_profile_ctl:
    url: "https://192.168.10.13:443/admin?profile={{profile}}&lock={{lock}}"
    username: USERNAME
    password: PASSWORD

My wife is going to kill me soon if I spend too more time on this.
 
  • Like
Reactions: dmcIPCAM
I found a curl command that you can issue from HA but it was from a 4 year old reddit thread - not sure if it still works:

Code:
Yup, you can. Here's an example shell command:

bi_away: curl http://192.168.53.55:81/admin?profile=4
Add your Home Assistant IP address as a trusted device in BlueIris
 
  • Like
Reactions: dmcIPCAM
I made a noob mistake and forgot I was trying to pass traffic across VLANs. Creating a firewall rule in pfSense to allow HomeAssistant to BlueIris solved my issue, but not before pissing my wife off and burning close to 8hrs of a Saturday.
 
Last edited:
  • Like
Reactions: dmcIPCAM
Just incase anyone else comes across this in the future I'll give you what I got to get it working at the moment. Its as simple as you can get for a RESTful api so don't judge me. I'm pretty sure I'll write something more secure over the next couple days.

YAML:
# RESTful api
rest_command:
  bi_profile_away:
    url: http://192.168.10.13:8181/admin?profile=2&lock=2&user=USER&pw=PASSWORD
  bi_profile_home:
    url: http://192.168.10.13:8181/admin?profile=-1&user=USER&pw=PASSWORD
 
The BI integration for HA creates switches for schedules and profile that will do what you want to do.

I've been contemplating on installing it and taking it for a test drive but was set off by that it was no longer maintained. How's your experience with it been so far?
 
How's your experience with it been so far?
I've been using it for awhile now and it works well. If you're using cameras in HA it's a lot faster than the OEM integration.

Even though the original creator moved on kramttocs is working to maintain it. I forked a copy of it on github just so I would have the original files.
 
I also use the BI integration for HA and it's been rock solid for the past ~12 months. I don't bring in camera feeds using it, but use the motion sensors it creates along with profile switching.
 
  • Like
Reactions: Vettester
Below is a link on how to do the exact same thing with ‘HomeSeer’ and Blue Iris.
I use simple HTTP/JSON calls to keep the two applications in sync. So when the profile changes in Blue Iris, HomeSeer is notified. This of course changes the behavior of HomeSeer and how it reacts.
But it also works the other way around, I can change the profile of Blue Iris via HomeSeer. Due to my home automation I need to know far more than just the status of BI, so controlling BI from HS allows me to only open a single app in order to quickly assess the status of my house and/or control BI.

One example of having HS control the profile of BI is: I open the back door and the profile of BI automatically changes from 1 to 2. This way, when I step into my backyard, I do not get an alert. But when I go back inside, the profile changes back to 1 and then, if anyone enters the backyard I do get alerts. Very handy as before the integration I had to manually change the profile in order to avoid alerts of myself walking on my own property (or just suffer through a bunch of alerts as I walked around - which does get annoying).

I have an extensive home automation setup and integrating the two software packages was critical to providing seamless automation and camera behavior.
I keep it straightforward and do not implement subnets, queues or vlans. I do that at work and prefer to keep it simple at home.

Just under 3 years and it has been 100% reliable (no scripting required!):
 
Another fun thing I do with my HS/BI integration is cycle my outside cameras through 3 different profiles each based on the actual LUX value.
I used to change 2 camera profiles on a time based schedule, but clouds and storms changes the amount of available light often.

So I bought this LUX meter, and integrated it into HomeSeer. So now, when it gets darker or lighter, HS calls BI on a per camera basis and tells BI to change the cameras profile to the appropriate setting for the amount of light being encountered. The camera profiles are now controlled by the amount of light, not a schedule.

Its brilliant! Now if we get an afternoon storm and the skies get really dark (happens frequently in the spring) the cameras auto adjust. Same for winter, we get a heavy snow storm in the afternoon and the cameras slow down the shutter speed as needed.

It should be noted that I run my cameras with the fastest shutter speed possible for any given amount of light. I don’t like images that are blurry. Kind of defeats the BI install. Of course, you can avoid the complexity of the scenarios above by simply slowing shutter speeds all across the board. But boy the blurry images do come into play.

Also, I cycle through 3 camera profiles, not 2. Most people are using day/night. I use day/night/general. Day/night are self explanatory, I use general for dusk/dawn. This is not a required level of refinement, but once you introduce home automation, its just so easy to control your cameras so accurately!

I did use a VB script for this solution. Mostly just to avoid entering additional events and to see how easy it might be to use scripts in HS (Scripts are rarely needed in HS)
 
As an Amazon Associate IPCamTalk earns from qualifying purchases.
Check this out! I use this gesture pad to control my living room TV.
The gesture pad sends commands to HS which then communicates to my Sony Bravia TV via IP protocol generated by a plugin available for HS

So, I can’t stand the TV when commercials are running. I did buy additional universal remotes, but they cannot always be found. So I taped the gesture pad to the back side of a cabinet door. The blue painters tape has been holding for 2 years so far.

Anyway, the pad has something like 5 gestures. So I can:
Mute/unmute
volume up/down
turn tv on

This pic shows how I installed it (USB powered):
IMG_0185.jpeg

This pic shows how I hold my hand to provide a gesture to increase volume (you have to move your hand up for higher volume or down for lower):
IMG_0183.jpeg

I love it since I am often in the kitchen and want to mute the TV. Having a spare remote in the kitchen is not reliable, but this gesture pad is always in the same place.

The gesture pad is not as consistent as I would like. I often have to repeat the gesture 2 or 3 times. But that is partially due to the thickness of the cabinet door and the gesture pad itself. On very rare occasions, one of us will walk by the cabinet a little to closely and it will mute/unmute the TV.
 
Last edited:
As an Amazon Associate IPCamTalk earns from qualifying purchases.
I've been contemplating on installing it and taking it for a test drive but was set off by that it was no longer maintained. How's your experience with it been so far?

Also - it is still maintained just not by the original programmer
 
Another fun thing I do with my HS/BI integration is cycle my outside cameras through 3 different profiles each based on the actual LUX value.
I'm doing something similar with Hubitat except that I'm using a Tempest weather station to provide the lux values. My automations also change the cameras focus and zoom as well.
 
Last edited:
  • Like
Reactions: DanDenver
My automations also change the cameras focus and zoom as well.
Fun! If someone opens my back gate, I have 2 of my PTZ's aim and zoom in on it, then after 30 seconds pull back out. The opening of the gate also powers a small siren upstairs for 3 seconds (best alert for when I am asleep).

I find the marriage of HS (or specifically home automation) and BI to be so useful.
 
Great thread with lots of good information!

I often work in my front yard and walk between various front areas and the garage. That triggers motion, potentially, on
three 5442's, two doorbells, a T180, and an K42A in the garage. Among the immediate actions I have in Blue Iris for
several of those cameras is to send a text message to my phone and to play a tone throughout the house on MPD players.
If I am simply walking back and forth outside, that generates a lot of unnecessary texts and tones, and it can be a little tedious
in Blue Iris or UI3 to toggle motion detection for all those cameras. There are lots of ways to skin this cat, but one simple
way I use the Blue Iris REST API and Home Assistant is to create "Scripts" to toggle motion detection. This what it looks
like in the Home Assistant interface, and I also have a small Zooz Z-wave remote that I keep in the garage to toggle motion
detection.
1684429514746.png
I don't use the Blue Iris Integration in Home Assistant, but as @whoami pointed out, Home Assistant supports something called a RESTful Command.

Add the Blue Iris HTTP API calls (relevant to motion detection, in this case) to your Configuration.yaml file.
And by doing that you are exposing a "service" that Home Assistant can call in Scripts and Automations.
1684430684181.png
(the service name, bi_drvleft_md_on, is highlighted to match the next screenshot)

Then create a Script and add as many of the RESTful Commands in the "Sequence" part of the Script as you need:
1684430271873.png

You may be wondering... All those cameras are part of Blue Iris "Group" called "Front", but the Blue Iris API call for
toggling motion detection only seems to work for individual cameras (there is probably a logical reason if I thought
about it). Therefore, my Home Assistant Script has to have motion detection calls for all the cameras involved.

Again, thanks everyone for the great info!
 
  • Like
Reactions: tinman10101
I don't use the Blue Iris Integration in Home Assistant
I'm basically doing the same thing using the BI integration. I added a "pause cameras" profile in BI and then use the profile switch entity created by the integration to turn the profile on and off from a wall mounted dashboard. For the cameras I don't want triggered I simply disable motion in the pause cameras profile. I have the icon on the dashboard change colors so that I know whether or not that it is on or off.

Screen Shot 2023-05-18 at 3.59.00 PM.png
 
Last edited:
  • Like
Reactions: dmcIPCAM
Since this is still getting some action....

I tried experimenting with the Blue Iris integration for HomeAssistant but I've ran into a couple issues maybe someone could help me with.

1. When creating my own cards using a picture entity card I can only get 6 cams streaming in HA until it breaks something. I set up a BI user named HomeAssistant and I allow it more connections from BI than it would ever need but still... 6 cams and things break. Now if I create a new dashboard and let it import all my integrations automatically all of my cams plus groups of cams play in HA no problem. Why?

2. When switching profiles using the BI HA integration it changes the profile for the amount of temp time set in BI, but I cant figure out how to lock it, or unlock it so that it will fall back to what ever profile is scheduled for that time of day. With the RESTful command I set it to Away profile and lock it which turns on all my indoor cams, until I come home and unlock the profile letting it fall back to its regular scheduled profile for either day or night settings. Any way around this?
 
I'm basically doing the same thing using the BI integration. I added a "pause cameras" profile in BI and then use the profile switch entity created by the integration to turn the profile on and off from a wall mounted dashboard. For the cameras I don't want triggered I simply disable motion in the pause cameras profile. I have the icon on the dashboard change colors so that I know whether or not that it is on or off.

View attachment 163456
After thinking about overnight, I think your method is better and I think your icons present much better information.
I often do quick and dirty hacks to remedy something that is bugging me and then procrastinate on a better solution.
I'm often a satisficer and not an optimizer.:blankstare:
 
  • Like
Reactions: Vettester
I cant figure out how to lock it, or unlock it so that it will fall back to what ever profile is scheduled for that time of day.

If you add the following to your configuration,yaml file it will create two switches that you can use to change the blue Iris active profile and lock button.

switch:
- platform: command_line
switches:
blueiris_motion:
command_on: 'curl -X GET ""'
command_off: 'curl -X GET ""'
friendly_name: Activate Motion
blueiris_disable_motion:
command_on: 'curl -X GET ""'
command_off: 'curl -X GET ""'
friendly_name: Deactivate Motion
blueiris_disable_lock:
command_off: 'curl -X GET ""'
friendly_name: Deactivate Lock
 
  • Like
Reactions: dmcIPCAM