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 |
actionType = ControlLightOrAppliance deviceAction = TurnOff deviceAction = TurnOn deviceAction = Toggle | actionType = ControlLightOrAppliance deviceAction = TurnOn deviceAction = TurnOff deviceAction = Toggle |
actionType = ControlLightOrAppliance deviceAction = TurnOff deviceAction = TurnOn | actionType = ControlLightOrAppliance deviceAction = TurnOn deviceAction = TurnOff |
actionType = DisableSchedule | actionType = EnableSchedule |
actionType = DisableTrigger | actionType = EnableTrigger |
actionType = EnableSchedule | actionType = DisableSchedule |
actionType = EnableTrigger | actionType = DisableTrigger |
ControlDimmerRelayAction
This class represents an action to control a dimmer (light) or relay (appliance) module.
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 | kDimmerRelayAction | this is the command to send to the device |
actionValue | integer | if deviceAction is in [Brighten, Dim, SetBrightness] then this is the value - delta percentage for the first two, absolute percentage for the latter |
Dimmer Relay Action Enumeration
| indigo.kDimmerRelayAction | |
|---|---|
| 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 deviceValue property |
DimBy | dim a dimmer (light) device by the amount specified in the deviceValue property |
SetBrightness | set a dimmer (light) device to the brightness specified in the deviceValue 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 |
RequestStatus | send a device a status request |
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 |
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 |
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 runSchedule |
zoneIndex | integer | the zone to turn on - used when sprinklerAction is zoneOn |
Sprinkler Action Enumeration
| indigo.kSprinklerAction | |
|---|---|
| Value | Description |
NextZone | set sprinkler to the next zone |
PauseSchedule | pause a sprinkler schedule |
PreviousZone | set sprinkler to the previous zone |
ResumeSchedule | resume a sprinkler schedule |
RunSchedule | run a sprinkler schedule |
Stop | stop a sprinkler schedule and turn off all zones |
ZoneOn | turn on a single zone |
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 |