Testing Presets

Ssayer

BIT Beta Team
Jan 5, 2016
19,734
71,536
SE Michigan USA
A number of my cams have undocumented presets. Example... White lights on or off, tracking on or off, etc. Is there a way, or has anyone come up with a way to test presets (probably 1 to 100) sequentially with some kind of a pause between each try in order to see what may have changed? AFAIK, the only way in BI is to manually change (up to) 20 presets at a time on each camera and test each one by one that way. Just looking to see if there is an easier way.
 
Can you not use the patrol on the cam or Auto-cycle patrol in BI that steps through each of the presets? My only PTZ is fairly limited so I don't know what that may enable other than simply moving the cam through whatever defined presets.
 
Yes, but AFAIK, you can only patrol through presets that you have already set up.
 
Set up a script to loop through each one using the API calls? I don't do much with that so I don't know the string off the top of my head.
 
  • Like
Reactions: Ssayer and Coldair
Have you tried logging in to the camera itself and reviewing the list of presets?

If seen some cams have the factory-set presets description with the respective action instead of the standard "preset 1", "preset 2", "preset 3", etc
 
  • Like
Reactions: Ssayer
I'm not sure how I'd come up with a script as I haven't done anything like that (it's why I asked if anyone else had).

None of my cams show factory-set presets with descriptions. I got a manual with my last one that showed all of it's presets which got me thinking about the others.
 
If you open UI3 and open the developer console (ctrl + shift + i), then on the console tab you can paste this script

JavaScript:
var delay = 3000;
function NextPreset(num) {
    if (num > 100) {
        console.log("ending preset iteration");
        return;
    }
    ExecJSON({"cmd":"ptz","camera":"ptzne","button":100 + num},
    function(response) {
        console.log("Preset " + num + " " + response.result);
        setTimeout(function() { NextPreset(num + 1); }, delay);
    },
    function() {
        console.log("Preset " + num + " could not be requested due to an error");
        setTimeout(function() { NextPreset(num + 1); }, delay);
    });
}
NextPreset(1);

Change "ptzne" to the short name of your ptz camera. You can modify the delay between commands (in milliseconds) at the top. On the third line where it says num > 100, that is the last preset number it will try. The very last line, where it has the 1, that is the first preset it will try.
 
  • Like
Reactions: Ssayer and Mike A.
And if you happen to be viewing a ptz camera in UI3, then this console command will simply go to whatever preset number you enter.

JavaScript:
ptzButtons.PTZ_goto_preset(1)
 
  • Like
Reactions: Ssayer and Mike A.