Go to documentation repository
The GetObjectState method returns the state of the object at the moment of method call.
Method call syntax
function GetObjectState(objtype : String, id : String) : String
Method arguments:
Usage examples
Problem. When Relay 1 activates (for example, on pressing the button connected to Relay 1), arm Sensor 1. The next time Relay 1 activates, disarm Sensor 1.
if (Event.SourceType == "GRELE" && Event.SourceId == "1" && Event.Action == "ON")
{
if(GetObjectState("GRAY", "1")=="DISARM")
{
SetObjectState("GRAY", "1", "ARM");
}
else
{
SetObjectState("GRAY", "1", "DISARM");
}
}
Note
Some object types can have several states at the same time. For example: ATTACHED|DISSOLVED or ADDED|OFF|RECORDER_ON|RECORD