Go to documentation repository
The GetObjectState method returns the state of the object at the moment of method invocation.
Syntax for method invocation:
function GetObjectState(objtype : String, id : String) : String
Method arguments:
Example. When relay 1 is enabled (for example, on pressing the button connected to the relay 1), arm sensor 1. The next time the relay 1 is enabled, 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|DISARMED or ATTACHED|DISARMED|RECORDER_ON|RECORDING.