Milestone Management Rules

The exact number of options depends on the type of rule you want to create and the number of devices available on your system. Rules offer a high degree of flexibility: you can combine event and time conditions, specify multiple actions in a single rule, and very often create rules that cover several or all devices on your system. Here are some examples of what you can do with rules: The following types of conditions can trigger rules: Depending on the needs of your organization, it often makes sense to create many simple rules instead of complex ones. Even though this means you have more rules in your system, it provides an easy way to keep track of what your rules are doing. If you keep your rules simple, you also have much more flexibility when it comes to disabling/enabling individual rule elements. With simple rules, you can disable/enable entire rules if necessary. You can make your rules as simple or complex as necessary. For example, you can create very simple time-based rules: the VideoOS folder is OEM compatible, so in many cases, plugins written for a Milestone product will also work for OEM products that come from Milestone OEM and are sold/supported by an OEM partner. Each plugin has its own subfolder in the MIPPlugins folders, and within this folder is a plugin.def file that defines the plugin`s entry point and the environment in which to load the plugin. For example, a plug-in for XProtect Smart Client is not normally loaded by the event server. When events occur on the monitoring system, such as when motion is detected or the system receives information from external sensors. This line uses PowerShell .exe (Windows PowerShell 5.1 x64) to create a file with the same name as the file.

BAT, but with the .PS1 extension, in the folder C:Program FilesVideoOSMIPPluginsBatActionPs1Files. Any arguments passed to the .BAT file are passed to the .ps1 file. If you enter specific time periods, for example: Events are essential to using the Rules Management Wizard. The wizard uses events primarily to trigger actions. For example, you can create a rule specifying that if motion is detected, the surveillance system should start recording video from a specific camera. The BatAction plug-in is a « background plug-in, » which means that it runs in the Milestone Event Server service. This is an example of a MIP plugin with the source code available on GitHub, and it shows how to create a file. NET developers can create a plug-in that exposes custom « rule actions. » In this case, custom actions execute a .BAT file located in the plugin`s BatFiles folder with optional arguments. Because PowerShell is such a rich scripting language, there is no end to the type of tasks you can perform by combining the BatAction plug-in with PowerShell. Some ideas we can think of are: The plugin is now installed and ready to use with a simple sample .bat file.

For tips on adding your own scripts, see the next section. If motion is detected on camera 1 (event condition), camera 2 should immediately start recording (action) and the siren connected to output 3 should sound immediately (action). Then, after 60 seconds, camera 2 should stop recording (Stop Action) and the siren connected to exit 3 should stop ringing (Stop Action). Follow these steps to add your own custom scripts that can be run with the BatAction plugin: Shutting down a device means that no video is transferred from the device to the system. In this case, you will not be able to view or record live videos. However, a device on which you stopped the stream can still communicate with the recording server, and you can automatically start the stream from the device through a rule, instead of manually disabling the device in the Management Client. Some rule content may require certain features to be enabled for these devices. For example, a rule that specifies that a camera should record will not work as expected if recording is not enabled for that camera.

Before creating a rule, Milestone recommends that you verify that the affected devices can function as expected. If motion is detected on camera 1 (event condition), camera 1 should immediately start recording (action) and then stop recording (stop action) after 10 seconds. When you specify an action to be performed on a detailed and recurring schedule. Under Rules and Events, you can use the following: Typically, this is the same computer as the Management Server service, but in some environments, Event Server is installed on an independent computer. Wherever your event server is installed, be sure to install MilestonePSTools. Read the installation guide if you haven`t already. Restart the Event Server service after making changes to the BatFiles folder. If you installed the BatAction plug-in using the Express Install script, you already have the following two files: The following Express installation script can be run in a PowerShell terminal on the event server computer and downloads a copy of the BatAction plug-in.

Place it in the C:Program FilesVideoOSMIPPlugins directory, place the CameraReport.bat and CameraReport.ps1 sample files in the appropriate BatFiles and Ps1Files subfolders, and then restart the Event Server service. If motion is detected on camera 1 (event condition) and the day of the week is Saturday or Sunday (happy condition), camera 1 and camera 2 should immediately start recording (action) and a notification should be sent to the security manager (action). Then, 5 seconds after the movement on camera 1 or camera 2 has no longer been detected, the 2 cameras should stop recording. The following script contains the complete contents of the CameraReport.ps1 file, which contains a function that you can use to parse BatAction arguments passed to the script and demonstrates a rudimentary method for adding logging to the script by using the Start-Transcript cmdlet. Milestone plugins are usually loaded from one of two folders: rules are a central part of your system. The rules specify very important settings, such as when to record cameras, when to patrol PTZ cameras, when to send notifications, etc. You may have other projects for the BatAction plugin that MilestonePSTools doesn`t get involved in. If so, feel free to skip to the next section.

Otherwise, the package must be installed on the same computer as your Milestone Event Server service. Rules specify the actions to be performed under certain conditions. Example: If motion is detected (state), a camera should start recording (action). For this reason.bat you will find the CameraReport which consists of the following line. And if you install the plugin manually, feel free to create your own BAT file with the following content. Example – a rule that specifies that a particular camera should start recording when it detects motion: This guide explains how you can use this existing, freely available plugin sample to add powerful new features to your VMS. We can do this by calling an external PowerShell script from a .BAT file, and in a PowerShell environment we have access to the MilestonePSTools module and countless built-in and third-party modules. If you used the quick installation script above, you can skip to the next section. If not, read on to see how to install the plugin manually. The time is based on the local time settings of the server on which the Management Client is installed.

On Monday, between 08:30 and 11:30 (conditional time), camera 1 and camera 2 must start recording (action) at the beginning of the period and stop recording (stop action) at the end of the period. On the surface, it looks like you can just put PS1 files in the BatFiles folder. The BatAction plugin doesn`t care about the file type – it finds all the files in the folder. In practice, however, it seems that the settings used with .NET ProcessStartInfo do not always allow you to successfully launch PowerShell scripts directly with the BatAction plug-in. Even if an event-based rule is enabled by an event on one device, you can choose to perform actions on one or more other devices. The plug-in definition file for BatAction looks like this: Three Milestone components look for plug-ins to load at startup: After installing the batAction plug-in and configuring it with at least the CameraReport samples.* above, follow these steps to trigger your script.