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
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 Complemetary 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
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 deviceValue property
DimBydim a dimmer (light) device by the amount specified in the deviceValue property
SetBrightnessset a dimmer (light) device to the brightness specified in the deviceValue 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
RequestStatussend 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
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
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
NextZoneset sprinkler to the next zone
PauseSchedulepause a sprinkler schedule
PreviousZoneset sprinkler to the previous zone
ResumeScheduleresume a sprinkler schedule
RunSchedulerun a sprinkler schedule
Stopstop a sprinkler schedule and turn off all zones
ZoneOnturn on a single zone
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
indigo_5_documentation/action_class.txt · Last modified: 2019/01/26 00:10 (external edit)
 

© Perceptive Automation, LLC. · Privacy