To get this script, please contact your Manager or Technical specialist in TRASSIR

Main features

Warning. The script is running on server.

The script is designed to respond to license plate number recognition events. It also adds license plate number recognition error avoidance for built-in lists and lists in text files.

When recognizing a license plate the script can:

  • Perform simple reactions - display text, play sound, save screenshot
  • Open the barrier by closing the alarm input
  • Access Control operations
  • Send email messages with screenshot
  • Display cameras with alarm
  • Open the archive at the moment of alarm

Sort alarms by:

  • Movement direction
  • Lists (Black, White, Informational)

The script also has the ability to display multiple cameras with simultaneous license plate recognition and operation by schedule.

The script can work in conjunction with Alarm Monitor to receive notifications.

Please note that the object names must be unique.


Add script in Automation → Create new script... → Load example... → From file...

After the loading, press "Save and Run", uncheck "Enable script" flag and configure the script.

Script setting

  1. Select channels on which license plates are recognized.
  2. Select list to which the further reaction will be, or “any car number”.
  3. Specify a list name (comma separated names) - For example, the number is in three information lists, and you need reaction to the list named Test1 only. If the field is empty, the filter by name is not applied.
  4. Select the delay before next detection of same license plate number.
  5. Select the direction of movement on the frame (the car moves to the camera - Down, from the camera – Up).
  6. If license plate number recognizer on camera (hardware detector) is used, the checkbox "Hardware detector" should be checked.
  7. The work with the accuracy takes place at the base software level.

The “Reactions on events” section lets you select the type of action which should be performed upon license plate recognition from the specified list.

Some reaction types require the additional settings in the sections below.

The “Additional” section lets you configure additional parameters.

Screenshot time correction (before event). Sometimes it is necessary to save a screenshot some time before the event occurs, for example during the "Sabotage" event. It is necessary to understand that such a screenshot can be made only from the archive record. Therefore, if the archive was not recorded at that moment, a screenshot of the nearest moment, for which the recording was made, is going to be obtained.
Screenshot from camera stream. Select this item if the archive is not recorded to the device disks, but you need to save screenshots of events.

Screenshots with figures. You can get a screenshot with figures only if the archive is recorded to the sever disks. This option can't be used with screenshot from camera stream.

If "Save a screenshot is selected in the "“Reactions on events" section, the script saves screenshots to the screenshot directory. If this parameter is greater than zero, the script will delete the screenshots with the lifetime longer than the specified parameter.

Schedule (optional). If a schedule is set, the script will work when the specified schedule is in the specified zone.

Actions with alarm outputs

It is possible to perform closing, opening or a sequence of these actions with the alarm outputs. You can specify several alarm outputs.

Delay before paired operations. This is the period of time between two consecutive actions, i.e. if close-open operation type is selected with 5 seconds delay, upon alarm event the alarm output will close and than open in 5 seconds.

Algorithm of  barrier with a queue. This is the way the script will work when the vehicles go one after another. For more details, check the examples below:

Example 1. type_1

Given parameters: a barrier operation algorithm with type_1 queue, operation type 'close-open', the delay before subsequent operation with alarm output is 10 sec.

12:00:00 A car #1 the license plate number of which is in the given list arrives. The alarm output closes and the barrier opens.

12:00:05 In 5 seconds, a car #2 arrives after the car #1, the number of which is also in the given list.  The time period of the open state of the barrier increases by 10 seconds.

12:00:20 The barrier closes.

Example 2. type_2

Given parameters: a barrier operation algorithm with type_2 queue, operation type 'close-open', the delay before subsequent operation with alarm output is 10 sec.

12:00:00 A car #1 the license plate number of which is in the given list arrives. The alarm output closes and the barrier opens.

12:00:05 In 5 seconds, a car #2 arrives after the car #1, the number of which is also in the given list.

12:00:10 The alarm output closes and then opens, that is the barrier closes and re-opens to let the car#2 in.

12:00:20 The barrier closes.

Thus, the difference is that when you select type_1, the open time time period of the barrier is extended, and when type_2, the barrier opens-closes for each car in the queue.

Example 3. type_3

The principle of operation with the alarm output is similar to type_2: the barrier opens-closes for each car.

The difference is:

You can adjust not only the open time period of the barrier, but also the delay time before each iteration open/closed.

For example, three cars have approached the checkpoint barrier. The open state of the barrier for each car is set to 7 sec. And the parameter 'Timeout before processing next auto for type_3' is set to 10 seconds.

The barrier will opens for 7 seconds for the first car, then it will close for 10 seconds and open again for the next car. Furthermore, in case three cars drove by and a fourth car arrived after them, the barrier also opens no sooner than in 10 seconds from the moment when the barrier closed after the third car.

Sending notifications/snapshots to e-mail

If you need to send a simple text notification to e-mail, select "Send a notification by e-mail". If you need such a notification with a screenshot attached, select "Send a screenshot by e-mail".

Specify the predefined sender and recipient accounts, separated by commas without spaces in the “E-mail settings” section.

In order to work with this item ,you need to create E-mail account.

Sending snapshots to Telegram

Specify Telegram Ids of all users you'd like to grant server access using the bot in the “Telegram” section.

In order to find out your id, send the command /tbot to @trassirbot and you will receive a message, containing your id:

Channel display

This reaction type is used to display channels on which the required event has already occurred.

Specify the alarm template name in the “Alarm monitor” section. The template should be previously created. You can use any template layout since the script uses standard layouts, depending on the number of displaying channels. If you need the script to switch to a basic template after the alarm channels have been displayed,  specify the name of this template in the "Default template" field.

When you select "Open a moment in archive" action type after the event occurs, the archived video of the event moment opens after \~5 sec. This setting lets you display no more than one channel on the alarm monitor. If the video stream has not been recorded to the hard disk within 5 seconds, the playback does not start.

Displaying list name

This reaction type is intended to display the name of the list in which the recognized license plate number is included.

Set the font color of the list in hex format. You can set various font colors for white, black and informational lists.

Before using this reaction, you should enable the display of figures and subtitles from scripts on the channels the script will work with. Click here for details.

The list name is displayed only if the font color for the list is set in the script settings. Example:

  • The script works only with license numbers from the white list and the color is not set for this list - in this case the list name will not be displayed.
  • The script works with any lists, but the font color is set only for the black list and the information list - in this case, the names of the white lists will not be displayed.

The "Display time (sec)" parameter is responsible for the time during which the list name will be displayed after recognizing the license number,. It is set in seconds. This field can take value 0, in this case the list name will be displayed until the next event (if the license number is found in the list and the script works with this type of lists), or until the script is reloaded.

Database connection settings

In case the numbers are stored in the built-in lists (i.e. in DB), there is no need to enter any additional parameters. The script will automatically get access to the database used by Trassir.

If you have multiple servers, you can use the database of one server, provided that access to the central database is specified in Database settings.

To get this script, please contact your Manager or Technical specialist in TRASSIR

  • No labels