Skip to content

Actions

In the IOM, all actions are derived from a common Action base class. This base contains all the shared components of actions. Unlike the other major classes, however, there isn't a command namespace for Actions. Why is that, you say? Because Actions don't exist outside the object that contains them (Triggers, Schedules, Action Groups, etc.). So, when manipulating actions, you always work directly on the object, then assign that object to one of the container objects. Don't worry, we'll walk you through it.

Action Base Class

The Action class is a base class that provides the common functionality to its subclasses (to follow). You may specify a new Action class in your list of actions for a trigger, schedule, or action group, but the action type will be None - that is, it will delay and speak any text set in the object, but other than that it will do nothing. Most of the time you'll be using one of the subclasses so that you get the specific functionality you're looking for.

Class Properties

Property Type Description
delayAmount integer number of seconds to delay before executing the actions (0 for none)
replaceExisting boolean if true then any existing delayed action is replaced by this one
textToSpeak string this is the text to speak when the action is executed

Complementary Delays For some action types, the user (and you) may specify that the complementary action be taken after some number of seconds. The table below specifies what complementary actions are available with the various action types:

Complementary Actions
Action Complement
*DeviceAction*
*kDeviceAction.TurnOff*
*kDeviceAction.TurnOn*
*kDeviceAction.Toggle*
*kDeviceAction.Lock*
*kDeviceAction.Unlock*
*DeviceAction*
*kDeviceAction.TurnOn*
*kDeviceAction.TurnOff*
*kDeviceAction.Toggle*
*kDeviceAction.Unlock*
*kDeviceAction.Lock*
*DisableScheduleAction* *EnableScheduleAction*
*DisableTriggerAction* *EnableTriggerAction*
*EnableScheduleAction* *DisableScheduleAction*
*EnableTriggerAction* *DisableTriggerAction*

DeviceAction (API v2.0+ only)

API v2.0+ only: This class represents an action to control dimmers (lights), relay (appliances), and locks. Previously this class was named DimmerRelayAction -- it was renamed in API v2.0.

Class Properties

Property Type Description
complementDelay integer the number of seconds to delay before issuing the complementary action (0 for no action) - see Complementary Delays for details
deviceId integer the id of the device
deviceAction kDeviceAction this is the command to send to the device
actionValue integer or dict if *deviceAction* is in [Brighten, Dim, SetBrightness] then this is an integer value

Device Action Enumeration

indigo.kDeviceAction
Value Description
AllLightsOff turn off all dimmer (light) devices
AllLightsOn turn on all dimmer (light) devices
AllOff turn off all dimmer (light) and relay (appliance) devices
BrightenBy brighten a dimmer (light) device by the amount specified in the actionValue integer property
DimBy dim a dimmer (light) device by the amount specified in the actionValue integer property
SetBrightness set a dimmer (light) device to the brightness specified in the actionValue integer property
SetColorLevels set the color (RGB) and white levels to the values specified in the actionValue dict property
Toggle toggle the on/off state of a dimmer (light) or relay (appliance) device
TurnOff turn off a dimmer (light) or relay (appliance) device
TurnOn turn on a dimmer (light) or relay (appliance) device
Lock lock a deadbolt or door device
Unlock unlock a deadbolt or door device

DisableScheduleAction

This class represents an action to disable a schedule.

Class Properties

Property Type Description
complementDelay integer the number of seconds to delay before issuing the complementary action (0 for no action), in this case an EnableScheduleAction - see Complementary Delays for details
scheduleId integer the id of the schedule to disable

DisableTriggerAction

This class represents an action to disable a trigger.

Class Properties

Property Type Description
complementDelay integer the number of seconds to delay before issuing the complementary action (0 for no action), in this case an EnableTriggerAction - see Complementary Delays for details
triggerId integer the id of the trigger to disable

EmailAction

This class represents an action to send an email.

Class Properties

Property Type Description
emailBody string the body of the email to send
emailSubject string the subject of the email to send
emailTo string the (semicolon separated) list of email addresses

EnableScheduleAction

This class represents an action to enable a schedule.

Class Properties

Property Type Description
complementDelay integer the number of seconds to delay before issuing the complementary action (0 for no action), in this case an *DisableScheduleAction* - see Complementary Delays for details
scheduleId integer the id of the schedule to enable

EnableTriggerEventAction

This class represents an action to enable a trigger event.

Class Properties

Property Type Description
complementDelay integer the number of seconds to delay before issuing the complementary action (0 for no action), in this case an DisableTriggerAction - see Complementary Delays for details
eventId integer the id of the event to enable

ExecuteGroupAction

This class represents an action to execute an action group.

Class Properties

Property Type Description
groupId integer the id of the action group to execute

ExecuteScriptAction

This class represents an action to execute a script.

Class Properties

Property Type Description
scriptCode string this is the source code of the script to execute

Get Dependencies

Return an indigo.Dict with all the dependencies on this action group.

Command Syntax Examples
indigo.actionGroup.getDependencies(123)
Parameters
Parameter Required Type Description
direct parameter Yes integer id or instance of the action group to get the dependencies for.

The dictionary will look something like this:

>>> print indigo.actionGroup.getDependencies(91776575)
Data : (dict)
     actionGroups : (list)
     controlPages : (list)
     devices : (list)
     schedules : (list)
          Data : (dict)
               ID : 552463741 (integer)
               Name : Between condition test (string)
          Data : (dict)
               ID : 296710860 (integer)
               Name : Greater than condition test (string)
     triggers : (list)
     variables : (list)

So, the dictionary will have 6 top-level keys: "actionGroups", "controlPages", "devices", "schedules", "triggers", and "variables". Each one of those keys will return a list object. Inside that list object will be multiple dicts, one for each dependency (or an empty list if there are none). Each dependency dictionary has two keys: "ID" which is the unique id and "Name" which is the name of the object.

InputOutputAction

This class represents an action to control an input/output module.

Class Properties

Property Type Description
deviceId integer this is the ID of the I/O device
action kIOAction this I/O action to execute
index integer if *action* is *TurnOffOutput*, *TurnOnOutput*, the index of the input or output to control

Input/Output Action Enumeration

indigo.kIOAction
Value Description
TurnOffOutput turn off the output specified by index
TurnOffAllOutputs turn off all outputs
TurnOnOutput turn on the output specified by index
RequestStatusAll request status of all hardware input/outputs
RequestAnalogInputValues request all analog input values from the device
RequestBinaryInputsStatus request all binary input statuses
RequestBinaryOutputsStatus request all binary output statuses
RequestSensorInputValues request all sensor input values

ModifyVariableAction

This class represents an action to modify an Indigo variable.

Class Properties

Property Type Description
variableId integer the id of the variable
variableAction kVariableAction the type of variable action to execute
variableValue string the new variable value

Variable Action Enumeration

indigo.kVariableAction
Value Description
DecrementValue decrement the variable value by 1
IncrementValue increment the variable value by 1
SetValue set the variable to the *variableValue* property

PluginAction

A plugin action is defined by a plugin, and is similar in definition to a CustomPluginDevice.

Class Properties

Property Type Description
deviceId integer the id of the device
pluginId string the unique ID of the plugin, specified in the Info.plist for the plugin (or it’s documentation)
pluginTypeId string the id specified in the Actions.xml (or it’s documentation)
props dictionary an indigo.Dict() defining this action's parameters

SendInsteonGroupCommandAction

This class represents an action to send an Insteon group command.

Class Properties

Property Type Description
command kInstnGroupCommand this is the group command to send
group integer this is the group number to send *command* to

Insteon Send Group Command Enumeration

indigo.kIOAction
Value Description
InstantOff send the instant (fast) off command to group ignoring ramp rate
InstantOn send the instant (fast) on command to group ignoring ramp rate
Off send the off command to group
On send the on command to group

SprinklerAction

This class represents an action to control a sprinkler module.

Class Properties

Property Type Description
deviceId integer the id of the sprinkler device
multiplierVarId integer API v1.20+ only: optional elem ID for the variable multiplier (None if no multiplier is specified)
sprinklerAction kSprinklerAction this sprinkler action to execute
zoneDurations list of float list of floats that represent the durations in minutes for each zone to schedule - used when *sprinklerAction* is *RunNewSchedule*
zoneIndex integer the zone to turn on as a 1-based index -- used when *sprinklerAction* is *ZoneOn*

Sprinkler Action Enumeration

indigo.kSprinklerAction
Value Description
RunNewSchedule run a new sprinkler schedule
RunPreviousSchedule run the last executed sprinkler schedule
PauseSchedule pause the current sprinkler schedule
ResumeSchedule resume the current sprinkler schedule
StopSchedule stop the current sprinkler schedule
PreviousZone set sprinkler to the previous zone
NextZone set sprinkler to the next zone
ZoneOn turn on a single zone
AllZonesOff turn off all zones
RequestStatusAll request status of all valves

ResetInterfacesAction

This class represents an action to reset the built-in interfaces. There are no extra properties necessary for this action.

ThermostatAction

This class represents an action to control a thermostat.

Class Properties

Property Type Description
deviceId integer this is the ID of the thermostat
thermostatAction kThermostatAction this thermostat action to execute
actionMode kFanMode
OR
kHvacMode
if action is SetFanMode, then a kFanMode enumeration
if action is SetHvacMode, then a kHvacMode enumeration
actionValue float if action is *Decrease* or *Increase*, the amount to increase/decrease the setpoints
if action is *Set**, the temperature to set the setpoint to

Thermostat Action Enumeration

indigo.kThermostatAction
Value Description
DecreaseCoolSetpoint decrease setpoint by value
DecreaseHeatSetpoint decrease setpoint by value
IncreaseCoolSetpoint increase setpoint by value
IncreaseHeatSetpoint increase setpoint by value
SetCoolSetpoint set the setpoint to value
SetFanMode set the fan mode to mode
SetHeatSetpoint set the setpoint to value
SetHvacMode set the hvac mode to mode
RequestStatusAll request all current values from the thermostat
RequestMode request the current mode of the thermostat
RequestEquipmentState request the current operational state of the compressor, furnace, etc.
RequestTemperatures request all current temperatures from the thermostat
RequestHumidities request all current humidities from the thermostat
RequestDeadbands request the current deadband ranges from the thermostat
RequestSetpoints request all current setpoints from the thermostat

UniversalAction (API v2.0+ only)

API v2.0+ only: This class represents a universal action that can be used with devices of different classes. Previously this class was named GeneralDeviceAction -- it was renamed in API v2.0.

Class Properties

Property Type Description
deviceId integer the id of the device
deviceAction kUniversalAction this is the command to send to the device

General Device Action Enumeration

indigo.kUniversalAction
Value Description
Beep request that the device perform an audible beep or buzz
EnergyUpdate request that the energy meter send its most recent meter data
EnergyReset request that the energy meter reset its accumulative energy usage data
RequestStatus send a device a status request for a complete update