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 of 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

PropertyTypeDescription
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 Complemetary 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
AllLightsOffturn off all dimmer (light) devices
AllLightsOnturn on all dimmer (light) devices
AllOffturn off all dimmer (light) and relay (appliance) devices
BrightenBybrighten a dimmer (light) device by the amount specified in the actionValue integer property
DimBydim a dimmer (light) device by the amount specified in the actionValue integer property
SetBrightnessset a dimmer (light) device to the brightness specified in the actionValue integer property
SetColorLevelsset the color (RGB) and white levels to the values specified in the actionValue dict property
Toggletoggle the on/off state of a dimmer (light) or relay (appliance) device
TurnOffturn off a dimmer (light) or relay (appliance) device
TurnOnturn on a dimmer (light) or relay (appliance) device
Locklock a deadbolt or door device
Unlockunlock 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

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
TurnOffOutputturn off the output specified by index
TurnOffAllOutputsturn off all outputs
TurnOnOutputturn on the output specified by index
RequestStatusAllrequest status of all hardware input/outputs
RequestAnalogInputValuesrequest all analog input values from the device
RequestBinaryInputsStatusrequest all binary input statuses
RequestBinaryOutputsStatusrequest all binary output statuses
RequestSensorInputValuesrequest 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
DecrementValuedecrement the variable value by 1
IncrementValueincrement the variable value by 1
SetValueset 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
ValueDescription
InstantOffsend the instant (fast) off command to group ignoring ramp rate
InstantOnsend the instant (fast) on command to group ignoring ramp rate
Offsend the off command to group
Onsend 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
RunNewSchedulerun a new sprinkler schedule
RunPreviousSchedulerun the last executed sprinkler schedule
PauseSchedulepause the current sprinkler schedule
ResumeScheduleresume the current sprinkler schedule
StopSchedulestop the current sprinkler schedule
PreviousZoneset sprinkler to the previous zone
NextZoneset sprinkler to the next zone
ZoneOnturn on a single zone
AllZonesOffturn off all zones
RequestStatusAllrequest 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
DecreaseCoolSetpointdecrease setpoint by value
DecreaseHeatSetpointdecrease setpoint by value
IncreaseCoolSetpointincrease setpoint by value
IncreaseHeatSetpointincrease setpoint by value
SetCoolSetpointset the setpoint to value
SetFanModeset the fan mode to mode
SetHeatSetpointset the setpoint to value
SetHvacModeset the hvac mode to mode
RequestStatusAllrequest all current values from the thermostat
RequestModerequest the current mode of the thermostat
RequestEquipmentStaterequest the current operational state of the compressor, furnace, etc.
RequestTemperaturesrequest all current temperatures from the thermostat
RequestHumiditiesrequest all current humidities from the thermostat
RequestDeadbandsrequest the current deadband ranges from the thermostat
RequestSetpointsrequest all current setpoints from the thermostat

UniversalAction (API v2.0+ only)

API v2.0+ only: This class represents a univeral 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
Beeprequest that the device perform an audible beep or buzz
EnergyUpdaterequest that the energy meter send its most recent meter data
EnergyResetrequest that the energy meter reset its accumulative energy usage data
RequestStatussend a device a status request for a complete update
indigo_7_documentation/action_class.txt · Last modified: 2019/01/25 22:53 (external edit)
 

© Perceptive Automation, LLC. · Privacy