Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Where:
  • Condition (parentheses):
    • SENSORID - unique identifier of the sensor, the condition for changing the state of which is described;
    • OLDSTATE-NEWSTATE - the status codes of the element, condition is met by switching to this state (the values ​​of both parameters must be the same);
    • OPERATOR - the code of the operator using which the result of the compound condition is calculated;
  • Action (braces):
    • SENSORID1 - unique identifier of the sensor, the state of which must be changed when the conditions of the logic circuit are fulfilled;
    • TIMEOUT - timeout for the action;
    • REPEAT - repetition of execution of the condition (optional parameter) or video duration for cameras (in seconds);
    • NEWSTATE2 - the status code to which the element is to be translated;
    • OPERATOR2 - the character '+', is used to create a compound action.

State codes:

  • 'normal': 1;
  • 'low alarm': 2;
  • 'high warning' and 'warning': 3;
  • 'high alarm' and 'alarm': 4;
  • 'on': 5;
  • 'off': 6;
  • 'not connected': 7;
  • 'pulse': 8;
  • 'low warning': 9;
  • 'idle': 10.

Operator Codes:

  • 'and': the '+' character;
  • 'or': the '|' character.

Logic scheme management


For management of logic schemes, the following types of requests are used (passed in the querytype field):


addlogic - add / change logic. Extra options are:

  • k - user session ID;
  • id - identifier of the logical scheme (this is not the identifier of the element), in case the identifier absent, a new logical scheme is created, otherwise the existing one is modified;
  • logic - the description of logic (the format of the description is described above);
  • name - the name of the logical scheme.

If the new logic scheme is successfully created, the response contains the identifier of the created element (field id) and the identifier of the logical scheme (field num), and looks like:

<error type="no error" id="503001" num="3" />

When creating a new logical scheme (id is not specified), all the listed parameters are mandatory. When changing, only modifiable parameters can be specified. Empty parameters are not allowed.


getelement - reading of the element is associated with the logic scheme. Required parameters:

  • k - user session ID;
  • id - Element ID.

The answer contains information about the element:

<element id="503001" module="2001" num="1" clas="devirt" type="logic" name="logik1" state="normal" desc="(100 4-4){301001:0 5}" timeout="0" disabled="0" />

It contains the following fields:

  • num - identifier of the logical scheme used to access getlogic;
  • desc - a description of the logic scheme, compiled according to the rules above;
  • timeout - total time of locking the logic in seconds, 0 - if the circuit is not locked;
  • disabled - the remaining, at the moment, time of blocking the logic in seconds.


getlogic - get information about the logical scheme. Extra options are:

  • k - user session ID;
  • id - identifier of the requested logic scheme (this is not the identifier of the element), in the absence of which, user receives a list of all logical schemes available for reading to this user.


Example of a response to a query of a logic scheme with the identifier '3':

...