Go to documentation repository
The GetObjectState method returns the state of the object at the moment of method callinvocation.Method call syntax
Syntax for method invocation:
| Code Block | ||
|---|---|---|
| ||
function GetObjectState(objtype : String, id : String) : String |
Method arguments:
Usage examples
ProblemExample. When Relay relay 1 activates is enabled (for example, on pressing the button connected to Relay the relay 1), arm Sensor sensor 1. The next time Relay the relay 1 activatesis enabled, disarm Sensor sensor 1.
| Code Block | ||
|---|---|---|
| ||
if (Event.SourceType == "GRELE" && Event.SourceId == "1" && Event.Action == "ON")
{
if(GetObjectState("GRAY", "1")=="DISARM")
{
SetObjectState("GRAY", "1", "ARM");
}
else
{
SetObjectState("GRAY", "1", "DISARM");
}
} |
| Info | ||
|---|---|---|
| ||
Some object Some object types can have several states at the same time. For example: ATTACHED|DISSOLVED DISARMED or ADDEDATTACHED|OFFDISARMED|RECORDER_ON|RECORDRECORDING. |