Using Presets to Call Web Requests

Joined
Nov 2, 2021
Messages
21
Reaction score
12
Location
Canada
Just wondering if this is possible.

I want to map the ptz presets to call HTTP URL's instead to trigger things such as the light built into the Foscam floodlight cam. The cam obviously isn't a ptz but I figured I can utilize the preset and have 1 turn it on and 2 turn it off by calling a url.

I edited the presets and named the first one "LightOn". Then in the "On Call" settings I added an action to do a web request. When I test the action it works. However, when I try to call preset 1 from the interface it doesn't execute the web request.

As extra. I tried this also on a PTZ camera add added web request action to a legit preset. The preset executes but not the web request.

Is what I'm trying to do not possible or is there a better way to do what I am trying to do?
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,844
Reaction score
6,424
I've not tried to issue web requests from the On call but I just tested it now quickly by setting up a push notification and it does work as expected.

Maybe try that to see if it works with whatever cam as you have it set up. Will confirm at least that the On call part works.

If so, then double check whatever you're doing with the web request and capture that in some way to make sure that it's right. Can you log the request at the receiving end in some way?

Edit to add: I tested as above both with a PTZ cam and a non-PTZ cam. Both work as expected to send push notifications.

I also realized that I had an existing working web request that I could use to test quickly (call to Voice Monkey to display a cam on an Alexa device when triggered) . That also works as expected on the non-PTZ cam. So it should work in the way that you want even with a non-PTZ cam.
 
Last edited:
Joined
Nov 2, 2021
Messages
21
Reaction score
12
Location
Canada
I've not tried to issue web requests from the On call but I just tested it now quickly by setting up a push notification and it does work as expected.

Maybe try that to see if it works with whatever cam as you have it set up. Will confirm at least that the On call part works.

If so, then double check whatever you're doing with the web request and capture that in some way to make sure that it's right. Can you log the request at the receiving end in some way?

Edit to add: I tested as above both with a PTZ cam and a non-PTZ cam. Both work as expected to send push notifications.

I also realized that I had an existing working web request that I could use to test quickly (call to Voice Monkey to display a cam on an Alexa device when triggered) . That also works as expected on the non-PTZ cam. So it should work in the way that you want even with a non-PTZ cam.
Thanks for checking. That is my problem. My web requests do work when I manually trigger it from the on call settings. I also have a bunch of web requests throughout BI that link it back to my Hubitat hub for automation and they all work. However, if from the BI interface I select the Preset to execute, its not running the web request.

For example on my PTZ camera, I can add a web request to also be called when "TopLeft" is executed. When I run it, TopLeft executes and the camera moves but the web request does not get sent.

Its just not making sense why this doesn't work. It should be working.
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,844
Reaction score
6,424
Ahhh... I misunderstood from where in the interface you were trying the call.

I just tested again... Same works fine for me both from the Call button on the page where you set up the On call and from the PTZ controls on the main BI console page.

Yeah, should work based on my quick tests. Not sure why yours isn't. I'm using BI v 5.5.2.5 and tried on a couple of different Dahua cams but don't think that the cam would matter.

I did see some weirdness about saving the changes to the name and action under the preset. Doesn't save unless you hit OK after naming the preset and then go back in. But I think you would have noticed that in your attempts to get things working.
 
Joined
Nov 2, 2021
Messages
21
Reaction score
12
Location
Canada
Ya. It doesn't make sense. I was going to downgrade my BI to test, I only see 5.5.3.5 not 5.5.2.5. But its worth a test as well.

Here are some screenshots of my preset as well. Maybe its something setup differently. If i manually run it from the action set command (the lightning bolt) it works. But running from the BI ios app, desktop app or web interface doesn't kick it off. Its so strange.

1639932262247.png
1639932281305.png
1639932464035.png
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,844
Reaction score
6,424
Don't see anything obviously different. The web request string is different of course but if that works otherwise then should be OK.

How about if you hit Call on the screen in your second image? Does that work?
 
Joined
Nov 2, 2021
Messages
21
Reaction score
12
Location
Canada
Call will send the request to the camera and skip the web request. So something is up.

I’m going to send support a email and also try to downgrade and see if it works.

But thanks for confirming for me. Getting this to work will be a nice work around to controlling other features on a camera through the BI interface.
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,844
Reaction score
6,424
What happens if you substitute something else for the web request. Push or sound? Something different vs the web request?
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,690
Reaction score
14,061
Location
USA
I use this exact functionality (with web requests attached to the PTZ presets) on a number of Dahua cameras with no problem. Nothing looks wrong to me, and the fact your "Test Action" button works really does suggest there may be an issue in Blue Iris.

As a possible workaround, you could try the "* CUSTOM HTTP *" option at the top of the dropdown list where you choose the PTZ type. This lights up the Edit button just to the right of the dropdown list.

1639938568778.png
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,389
Reaction score
49,463
Location
USA
From the help pdf...
Note that when testing, the action set runs in the console UI process. If you are running Blue
Iris as a service in the background, “real” action sets run in the service process, and this can
create discrepancies in what you experience


So it is totally possible that it will not work for that particular camera even though the test works.
 
Joined
Nov 2, 2021
Messages
21
Reaction score
12
Location
Canada
From the help pdf...
Note that when testing, the action set runs in the console UI process. If you are running Blue
Iris as a service in the background, “real” action sets run in the service process, and this can
create discrepancies in what you experience


So it is totally possible that it will not work for that particular camera even though the test works.
BAM. That was it. I run it as a service. Once I changed that to not run as a service the calls worked for the presets. Its strange that web requests work on other parts, just not this one as a swervice.

Thank you @wittaj for that. I usually search the manual first but missed that in my scanning.

Thanks everybody else for the other troubleshooting steps.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,690
Reaction score
14,061
Location
USA
That is really bizarre. There should be absolutely no difference in a web request made from the service process or the console process.

I run my Blue Iris as a service and do not have a problem with the web requests in PTZ presets.
 
Joined
Nov 2, 2021
Messages
21
Reaction score
12
Location
Canada
That is really bizarre. There should be absolutely no difference in a web request made from the service process or the console process.
I run my Blue Iris as a service and do not have a problem with the web requests in PTZ presets.
You are correct sir.

So after changing it to not run as a service it started working on the camera I was testing with but then I noticed the others didn't work still (I have 4 of them). So it led me down the rabbit hole a bit further.

On my setup I have the cameras all setup to do continuous recording. Then I have copies of each camera that handles all the detections and notifications. In this setup one camera becomes the "master" camera and the copy will just piggy back that stream.

Well I found out when the camera I configured with the preset was the "master" it worked. Otherwise it didnt.

So to fix it, I added the preset settings to all of the cameras so that no matter which the master was it worked. Now they all work. I even changed it back to a service and they all work.

Getting to this point took me a while but I got it sorted now.

Thanks again all for the help leading me down this path.
 

Mike A.

Known around here
Joined
May 6, 2017
Messages
3,844
Reaction score
6,424
Probably shouldn't for something like this?
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,690
Reaction score
14,061
Location
USA
Well I think it makes sense for PTZ controls to get forwarded to the master camera. Otherwise several features would be broken. But it isn't a great user experience when your settings don't have any effect and you have no idea why.
 
Joined
Nov 2, 2021
Messages
21
Reaction score
12
Location
Canada
Well I think it makes sense for PTZ controls to get forwarded to the master camera. Otherwise several features would be broken. But it isn't a great user experience when your settings don't have any effect and you have no idea why.
Correct. And even more confusing is that the role can jump around based on which of the cameras connected first I guess. As a user, I was just editing the copy and expecting it to work. As a quick fix maybe a note that the setting needs to be applied to all copies for it to work reliably would at least saved me the frustration until a final solution is implemented.

It does work beautifully now. I added a few custom commands and hijack the presets to implement them. So on the floodlights I have a light on, light off. Going to add alarm on, alarm off, dim up and dim down as well and I will no longer need the foscam app to do any of these.
 
Top