Go to documentation repository
Page History
...
The GRAY object sends events presented in the table. Procedure is started when the corresponding event appears.
Format of events procedure for the sensor:
| Code Block |
|---|
OnEvent("GRAY","_id_","_event_") |
Event | Description |
"ALARM" | Alarm. This event is received while opening or closing the sensor (it depends on object settings) if sensor is armed. If sensor is disarmed then Sensor opened and Sensor closed events are received correspondingly. |
"ARM" | Sensor is armed. |
"CONFIRM" | Alarm received. |
"DISARM" | Sensor is disarmed. |
"NOT_VALID_STATE" | Zone is not ready. |
"OFF" | Sensor opened. This event is received while sensor opening if sensor is disarmed. |
"ON" | Sensor closed. This event is received while sensor closing if sensor is disarmed. |
"SIGNAL_LOST" | Connection with sensor is lost |
Operator format to describe actions with the sensor is:
| Code Block |
|---|
DoReact("GRAY","_id_","_command_"); |
List of commands and parameters for the the GRAY object is presented in the following table:
Command – command description | Parameters | Description |
"ARM" – arm sensor. | - | - |
"DISARM" – disarm sensor. | - | - |
“CONFIRM” – confirm alarm. | - | - |
“SETUP” – settings for sensor. | chan<> | Output number (0 – 15). |
flags<> | Flags. | |
name<> | Object name. | |
type<> | Type of sensor object (0 – on closing, 1 – on opening). |
Properties of the GRAY object are shown in the table.
Properties of the GRAY object | Description of properties |
ID<> | Object ID. |
PARENT_ID<> | Parent object ID. |
REGION_ID<> | Region ID. |
Check function of the GRAY object state:
...
The GRAY object can be in the following states:
State of the GRAY object | State description |
"ARMED" | Sensor is armed. |
"DISARME"” | Sensor is disarmed. |
"ALARMED" | Alarm. |
"CONFIRMED" | Alarm confirmed. |
"DISARMED_ALARM" | Not ready. |
"DETACHED_ARMED" | Connection lost. |
"DETACHED_DISARM" | Connection lost. |
“OFF” | Normal |
Examples of using events and reactions of the Sensor object:
...
It is required to switch over the second sensor to the second input if connection with the first sensor is lost.
| Code Block |
|---|
OnEvent("GRAY","1"," SIGNAL_LOST") //connection with first sensor is losst
{
DoReact("GRAY","2","SETUP","chan<2>"); //sensor is on the second input
} |
...
. |
...
| Code Block |
|---|
OnEvent("GRAY","1"," ON") //first sensor is closed
{
DoReact("GRAY","2","SETUP","type<1>"); //open the second sensor
DoReact("CAM","1","REC","rollback<1>");//perform rollback record from the first video camera
} |
...