Discrete Sensors

Article content:

Types of sensors

Sensors with a discrete output can be of the following types:

  • dry - dry contact (as part of the device or "VT16 / Dry contacts board", "VT32 / Dry contacts board", etc.);
  • door - open door sensor (VT530 Access sensor);
  • airflow - airflow sensor (LCF013 Airflow sensor);
  • motion - motion sensor (VT570 PIR sensor);
  • vibration - vibration sensor (in the "VT470 / PIR, vibration and temperature sensor", etc.);
  • smoke - smoke detector (VT560 Smoke detector);
  • water - water leakage sensor (VT590 Leak sensor, etc.);
  • overload - a sign of current overload, it is used in devices with the function of measuring the energy parameters of the load;
  • snmpget - virtual SNMP GET sensor.

Reading Parameters

Reading is done with the getelement command, with the following parameters:

  • k - user session ID;
  • id - the identifier of the element;
  • period - the time interval of the accumulated data, the following values ​​are possible: "100seconds", "100minutes", "100hours", "100days",
  • mode - the output mode of the data, must be "xml".


Examples of responses to a query of the "discrete" class element:

<element id="101001" module="2008" clas="discrete" type="dry" name="Dry-1" state="normal" hwport="1" value="0" utype=" " reverse="0"></element>
<element id="105001" module="2014" clas="discrete" type="vibration" name="vt470-0217-vibration" state="normal" hwport="2" value="0" reset="60" high="50" vmin="0" vmax="100"></element>
<element id="109005" module="2015" clas="discrete" type="overload" name="Outlet-5-OVERLOAD" state="normal" value="0" reverse="0" um="none" descr="Current overload"></element>

Where:

  • id - unique identifier of the element;
  • module - the identifier of the module to which the element belongs;
  • clas - the class of the element;
  • type - describes the type of the element within the class;
  • name - the name of the element;
  • state - the state of the element;
  • hwport - hardware port, determines the location of the connector on the body of the device;
  • value - a numerical value corresponding to the measured value;
  • utype - a user-defined type;
  • reverse - inverse flag of sensor output (0 or 1), inverts sensor state;
  • reset - timeout value of sensor reset or power off (negative value - auto reset disabled; 0 - immediate auto reset);
  • high - the upper threshold of the sensor in % (1-200 for the type "airflow", 1-100 for the remaining sensors);
  • low - the lower threshold of the sensor in % (1-200 for the type "airflow", 1-100 for the remaining sensors).

If one of the attributes is not specified in the response, then the value of this attribute is not determined in the course of work and its installation does not affect the operation of the element.

When reading the element, a temporary log of the sensor values ​​is also output, in the form:

<time t="1455541503" last="0">
    <d v="0" t="1455541003"> </d>
    <d v="1" t="1455541484"> </d>
    <d v="0" t="1455541485"> </d>
    <d v="0" t="1455541503"> </d>
</time>

Sensor readings (field 'v') are indicated with a time stamp (field 't').


Modification of parameters

It is executed by the updateelement command:

  • k - user session ID;
  • id - the identifier of the element;

With additional parameters available for modification:

  • name - the name of the element;
  • utype - user-defined type;
  • reverse - inversion flag of the sensor values ​​(0 or 1);
  • reset - timeout value of sensor reset or power off (negative value - auto reset disabled, 0 - immediate auto reset);
  • high - the upper threshold of the sensor in % (1-200 for the type "airflow", 1-100 for the remaining sensors);
  • low - the lower threshold of the sensor in % (1-200 for the type "airflow", 1-100 for the remaining sensors).