Multiple html commands in sequence

truglo

Pulling my weight
Joined
Jun 28, 2017
Messages
275
Reaction score
103
I have been using BI event schedule and custom ptz commands to switch my dahua starlight cams between day/night mode, as well as refocus a few of them. On a normal day it's a great setup; just after civil sunrise day mode goes on, a few seconds later focus is done on the motorized lens cams (since switching day/night sometimes triggers in a bunk autofocus). Same thing except with night mode just before civil sunset.

However I noticed a problem with this "2 command" method to do my required "switch mode then refocus":

If I reboot any camera (power outage or other), when it goes back online BI does not send the 2 required 2 commands for a proper setup. BI only has a setting to send the "previous event", which in my case most of the time is just 'refocus'.

So in the case of last night (in night mode), where power went out for 6hrs and my ups battery died, when power was restored in the morning (should be day mode) the cameras remained in their previous setting (night mode) and BI only sent the refocus command when it reconnected to them.

To fix this, I believe I need to do something differently. Adding a feature to allow "previous x events" wouldn't work if reconnect happens just before a refocus. Hopefully there is a way to "wrap" 2 html get commands in one PTZ function. Any ideas?

I'm open to scripting (I play lots with lin/'duino/esp/mosquitto/etc...)... just need some reference material to read before I do that.
 
Last edited:

Darkflame808

Young grasshopper
Joined
Sep 27, 2017
Messages
51
Reaction score
22
Map ptz to bat file. Use curl to make get request. Or look into autoit and use _iecreate and sleep commands to send both commands. You can compile as exe when you are satisfied with results.
 

truglo

Pulling my weight
Joined
Jun 28, 2017
Messages
275
Reaction score
103
Thanks Darkflame! It's time I refresh my linux scripting skills and that sounds like a good way to do that. I will also look into autoit and _iecreate. The curl method might also be a good fit with a dedicated linux lpr box.

Kev
 

Darkflame808

Young grasshopper
Joined
Sep 27, 2017
Messages
51
Reaction score
22
Thanks Darkflame! It's time I refresh my linux scripting skills and that sounds like a good way to do that. I will also look into autoit and _iecreate. The curl method might also be a good fit with a dedicated linux lpr box.

Kev
Not a problem. If you need help let me know, I'm no autoit pro but I do love using it and would be glad to help get you on track.

If you don't mind me asking, what are the commands that you are sending via http?. If you post your two required commands, I can craft up a simple autoit script that you can then tinker to your liking. Please remember to remove the password and login credentials from the http string.
 
Top