Documentation for Intellect 4.10.4. Documentation for other versions of Intellect is available too.

Previous page Next page


The SetObjectState method changes the state of objects.

Method call syntax

function  SetObjectState(objtype : String, id : String, state : String)

Method arguments:

  1. objtype - Required argument. The type of the object whose state is to be changed. It takes the following values:  Type – String, range – existing object types.
  2. id - Required argument. Identification number of the object of the type set in the objtype parameter. It takes the following values:  Type – String, range – existing object identification numbers of the specified type.
  3. state - Required argument. The state to switch the object to. It takes the following values:  Type – String, range – available states of the object.

Usage examples

Example. Check if Camera 1 is armed every hour. If Camera 1 is disarmed, arm it.

Note

The Timer object with identification number 1 should be created beforehand. Set the Minutes parameter of the Timer object to 30.The timer would go off every hour at half past the hour - 09:30, 10:30, 11:30, etc.

if (Event.SourceType == "TIMER" && Event.SourceId == "1" && Event.Action == "TRIGGER")
{
  if (GetObjectState("CAM", "1") == "DISARMED")
  {
    SetObjectState("CAM", "1", "ARMED");
  }
}