Triggers

In the IOM, all triggers are derived from a common Trigger base class. This base contains all the shared components of triggers.

Trigger Base Class

All triggers will inherit properties from the Trigger base class - including plugin defined events. Note: plugin defined events will always return False for the upload property.

Like other high-level objects in Indigo, there are rules for modifying triggers. For Scripters and Plugin Developers:

  1. To create, duplicate, delete, and send commands to a trigger, use the command namespace as described below
  2. To modify an object's definition get a copy of the trigger, make the necessary changes, then call myTrigger.replaceOnServer(newPropsDict)

For Plugin Developers:

  1. To update a plugin's props on a trigger, call myTrigger.replacePluginPropsOnServer(newPropsDict) rather than try to update them on the local trigger

Unlike Devices, you can't call create() in the the trigger base class command namespace (indigo.trigger.*). Rather, each subclass has it's own create() method that takes the appropriate arguments for that trigger type.

Firing Plugin Defined Triggers

If you are a plugin developer and your plugin defines events, The process for executing your plugin's events is this:

  1. User creates a trigger of type plugin and selects one of your plugin events - configures it (if necessary) and saves.
  2. Indigo Server sends the new trigger object to your plugin via the various Trigger Specific Methods in plugin.py. The easiest one (parallel to the various device events) is triggerStartProcessing(self, trigger). This method is also called when the server first starts up your plugin - it will pass all triggers defined to your plugin, one at a time, through this method.
  3. Your trigger catches the trigger passed in that method and stores it so that it can watch for the conditions that define the event.
  4. When the conditions are met that would cause that trigger to fire (plugin implementation specific), you tell the server to execute the trigger using the indigo.trigger.execute(triggerRef) method. Note that the execute method will allow you to optionally bypass any conditions - you should NOT do this unless you're providing some kind of override/bypass. Users will clearly want conditions to be taken into account under normal circumstances (that's the default behavior).

You will also need to implement triggerStopProcessing(self,trigger) so that you can remove disabled/deleted triggers from your watch list. So, the Server isn't really involved at all with the trigger firing (except to execute the trigger when you tell it to) - it only notifies your plugin of events it's supposed to be watching for and your plugin does the rest.

Class Properties

Property Type Writable Description
actions list of Action Yes a list of Action objects (action steps in AS) that are executed for this trigger Not yet implemented
description string Yes description of the trigger
enabled boolean Yes true if this trigger is enabled
folderId integer No unique ID of the folder this trigger is in
globalProps dictionary No an indigo.Dict() representing all name/value pairs associated with this trigger - each plugin will have it's own dictionary (globalProps[pluginId]) - see About Plugin Properties below for details
id integer No a unique id of the trigger, assigned on creation by IndigoServer
name string Yes the unique name of the trigger - no two triggers can have the same name
pluginProps dictionary No an indigo.Dict() representing the name/value pairs defined by your plugin for the trigger - plugin developers should publish this information if you want other plugins/scripts to create triggers of this type - see About Plugin Properties below for details
sharedProps dictionary No API v2.3 : an indigo.Dict() representing the name/value pairs that are shared by all plugins. This is the property dictionary that you can edit via the Global Properties plugin, and your plugin may manage properties in this dictionary as well to add metadata to devices that your plugin can use for other purposes. Use trigger.replaceSharedPropsOnServer() to update them (as with pluginProps, you should get copy first, update the copy, then set them back to that copy so as to not accidentally remove some other plugin's props).
suppressLogging boolean Yes true if execution of this trigger will not be logged into the event log
upload boolean Yes true if IndigoServer should attempt to upload this trigger to the interface - will always be false for plugin triggers

About Plugin Properties

Triggers have properties - some are class properties, defined by the class itself. One of the biggest requests we've gotten in the past is some way to add arbitrary properties to an object - so that you could store your own data with the object in the database. And with plugin defined triggers, we needed a place to store the properties that you need to operate the trigger. That's what the pluginProps and globalProps represent - the additional properties that are not defined by the class. globalProps is a dictionary of every additional property defined for the trigger - each plugin has it's own dictionary of props in here which are readable by anyone. pluginProps is a shortcut to get to your plugin's props and are only writable by your plugin.

We mentioned before that triggers were read-only, and that's true, and that you'd need to use commands in a different command name space. That's mostly true. Here's another exception to that rule: to change a trigger's pluginProps (it must be “owned” by your plugin - that is, the pluginId must be set to your id), you use a method that's in the trigger's class: replacePluginPropsOnServer(). Here's an example:

trigger=indigo.triggers[123]
localPropsCopy = trigger.pluginProps
localPropsCopy["pollInterval"] = 10
trigger.replacePluginPropsOnServer(localPropsCopy)

You would use this technique if you wanted to just change some of the properties that are already defined. Because this method replaces ALL of the properties for your plugin in the trigger, you can just set them all in one call:

trigger=indigo.triggers[123]
trigger.replacePluginPropsOnServer({"prop1":10,"prop2":True})

Note, though, that if you have a <ConfigUI> defined for the event, those properties are also stored here - so in order to make sure your trigger works correctly you must include those properties as well. If you need to update several properties in your props dict, you can use the update() method:

trigger=indigo.triggers[123]
localPropsCopy = trigger.pluginProps
localPropsCopy.update({"prop1":10,"prop2":True})
trigger.replacePluginPropsOnServer(localPropsCopy)

The update() method will change the properties specified, and add the property if it doesn't exist. Now, you might be wondering - why do the extra localPropsCopy = trigger.pluginProps rather than just modify the props in place:

trigger=indigo.triggers[123]
trigger.pluginProps.update({"prop1":10,"prop2":True})
trigger.replacePluginPropsOnServer(trigger.pluginProps)

Because the trigger object is read-only - when you reference trigger.pluginProps, it returns a copy rather than returning a reference to the read-only object. So, in effect, you'd be modifying a copy. But, because you aren't saving a reference to that copy, it goes away since the next time you reference trigger.pluginProps another copy is made.

If you need to just dump all the properties for a trigger, you can just:

trigger=indigo.triggers[123]
trigger.replacePluginPropsOnServer(None)

That will completely remove your properties from the trigger.

Commands (indigo.trigger.*)

The commands in this section are common to all triggers regardless of type.

Delete

Delete the specified trigger regardless of it’s type.

Command Syntax Examples
indigo.trigger.delete(123)
Parameters
Parameter Required Type Description
direct parameter Yes integerid or instance of the trigger to delete

Duplicate

Duplicate the specified trigger regardless of the type. This method returns a copy of the new trigger.

Command Syntax Examples
indigo.trigger.duplicate(123, duplicateName="New Name")
Parameters
Parameter Required Type Description
direct parameter Yes integer id or instance of the trigger to duplicate
duplicateName No string name for the newly duplicated trigger

Enable/Disable Trigger

Disables or enables the trigger, optionally delaying for some period of time and optionally toggling back after the given period.

Command Syntax Examples
indigo.trigger.enable(12,value=False)
indigo.trigger.enable(12,value=True)
indigo.trigger.enable(12, value=True, duration=360, delay=60)
Parameters
Parameter Required Type Description
direct parameter Yes integer id or instance of the trigger
value Yes boolean True to enable, False to disable
delay No integer number of seconds to delay before disabling or enabling the trigger
duration No integer number of seconds before the trigger is switched back to it’s original state

Execute Trigger

Tell the IndigoServer to execute the actions associated with the trigger. If your plugin implements events, this is the method you'd call when the conditions for your specific event are met. If you're calling it this way, make sure you include the ignoreConditions=False parameter (or don't include the parameter since False is the default) so that any conditions associated with the trigger (by the user in the UI) are evaluated.

This method can also be called by scripters to immediately execute the actions associated with the trigger.

Command Syntax Examples
indigo.trigger.execute(123, ignoreConditions=False)
Parameters
Parameter Required Type Description
direct parameter Yes integer id or instance of the trigger
ignoreConditions No boolean will ignore any conditions associated with the trigger if True (default) and will evaluate conditions if False

Move To Folder

Use this command to move the trigger to a different folder. You can get a list of folder id’s by using indigo.triggers.folders, which will return a dictionary. The key to the dictionary is the ID, the value is the folder name.

Command Syntax Examples
indigo.trigger.moveToFolder(123, value=987)
Parameters
Parameter Required Type Description
direct parameter Yes integer id or instance of the trigger
value Yes integer id or instance of the folder to move the trigger to

Remove Delayed Actions

This command will remove delayed actions for the specified trigger.

Command Syntax Examples
indigo.trigger.removeDelayedActions(123)
Parameters
Parameter Required Type Description
direct parameter No integer id or instance of the trigger

Examples

FIXME add examples of updating a trigger's properties

DeviceStateChangeTrigger

The DeviceStateChangeTrigger class represents an event that is described by various changes to a device’s state. Built-in device types have fixed states, but plugins may define custom devices that define their own device states. Note: Controller device types can’t be used in device state change events since they have no state.

Class Properties

Property Type Writable Description
deviceId integer Yes the unique device id
stateChangeType kStateChange Yes the type of state change
stateSelector kStateSelector Yes can use either a string or one of the enumerations listed in the state selector enumeration
stateSelectorIndex integer Yes a 0-based integer value to specify which of multiple options to monitor - see the About State Selector section below for more information
stateValue string Yes the value the current state should be compared against - will be converted to the right type by the server

These events are rather complex for a variety of reasons, but the primary is that device states can be of multiple types which require a different set of controls. Indigo solves the problem by showing the right control options given the type. If your plugin is defining it’s own states, you’ll have to specify each state and it’s associated type so that Indigo will know what kind of controls to display to the user.

For instance, a temperature reported from a thermostat may be a floating point number. Possible events that you could trigger off of would be greater than, less than, equal, not equal, or has any change. However, becomes true or becomes false doesn’t make any sense. Conversely, an I/O device with binary inputs would really only need becomes true, becomes false, and has any change. The other options don’t make sense. To help you define the appropriate state changes, we’ve created the State Change Enumeration that lists all possible state changes.

However, that’s only one side of the issue. The other important concept is the state selector. In the example above, I mentioned a thermostat temperature and a binary input. I implied a single value for each, but in reality thermostats may in fact have multiple temperature sensors and I/O devices usually have multiple inputs and outputs. So, how do we specify which one?

State Change Type Enumeration
indigo.kStateChange
Value Description Valid for kStateSelector’s
BecomesEqualstateSelector becomes equal to stateValueActiveZone
AnalogInput
BrightnessLevel
HumidityInput
SensorInput
SetpointCool
SetpointHeat
TemperatureInput
BecomesFalsestateSelector becomes FalseBinaryInput
BinaryOutput
HvacCoolerIsOn
HvacFanIsOn
HvacFanModeIsAlwaysOn
HvacFanModeIsAuto
HvacHeaterIsOn
HvacOperationModeIsAuto
HvacOperationModeIsCool
HvacOperationModeIsHeat
HvacOperationModeIsOff
HvacOperationModeIsProgramAuto
HvacOperationModeIsProgramCool
HvacOperationModeIsProgramHeat
OnOffState
Zone
BecomesGreaterThanstateSelector becomes greater than stateValueAnalogInput
BrightnessLevel
HumidityInput
SensorInput
SetpointCool
SetpointHeat
TemperatureInput
BecomesLessThanstateSelector becomes less than stateValueAnalogInput
BrightnessLevel
HumidityInput
SensorInput
SetpointCool
SetpointHeat
TemperatureInput
BecomesNotEqualstateSelector becomes not equal to stateValueActiveZone
AnalogInput
BrightnessLevel
HumidityInput
SensorInput
SetpointCool
SetpointHeat
TemperatureInput
BecomesTruestateSelector becomes TrueBinaryInput
BinaryOutput
HvacCoolerIsOn
HvacFanIsOn
HvacFanModeIsAlwaysOn
HvacFanModeIsAuto
HvacHeaterIsOn
HvacOperationModeIsAuto
HvacOperationModeIsCool
HvacOperationModeIsHeat
HvacOperationModeIsOff
HvacOperationModeIsProgramAuto
HvacOperationModeIsProgramCool
HvacOperationModeIsProgramHeat
OnOffState
Zone
ChangesstateSelector has any changeActiveZone
AnalogInput
AnalogInputsAll
BinaryInput
BinaryInputsAll
BinaryOutput
BinaryOutputsAll
BrightnessLevel
HumidityInput
HumidityInputsAll
HvacCoolerIsOn
HvacFanIsOn
HvacFanMode
HvacFanModeIsAlwaysOn
HvacFanModeIsAuto
HvacHeaterIsOn
HvacOperationModeIsAuto
HvacOperationModeIsCool
HvacOperationModeIsHeat
HvacOperationModeIsOff
HvacOperationModeIsProgramAuto
HvacOperationModeIsProgramCool
HvacOperationModeIsProgramHeat
OnOffState
SensorInput
SensorInputsAll
SetpointCool
SetpointHeat
TemperatureInput
TemperatureInputsAll
Zone
State Selector Enumeration
indigo.kStateSelector
Value Description
ActiveZonemonitor the sprinkler’s activeZone to become =, !=, or any change
AnalogInputmonitor (one of) the analog input(s) available on the device for =, !=, <, >, or any change - stateSelectorIndex is required to be in the range of available inputs
AnalogInputsAllmonitors all of the analog inputs available on the device for any change
BinaryInputmonitor (one of) the binary input(s) to become true, false, or any change - stateSelectorIndex is required to be in the range of available inputs
BinaryInputsAllmonitors all of the binary inputs available on the device for any change
BinaryOutputmonitor (one of) the binary output(s) to become true, false, or any change - stateSelectorIndex is required to be in the range of available outputs
BinaryOutputsAll
BrightnessLevelmonitor the brightness level of a device for =, !=, <, >, and any change
HumidityInputmonitor (one of) the humdity sensor(s) available on the device for =, !=, <, >, and any change - stateSelectorIndex is required to be in the range of available inputs
HumidityInputsAllmonitors all of the humidity sensors available on the device for any change
HvacCoolerIsOnmonitor the thermostat for any time the air conditioning turns on, off, or has any change (coolIsOn is the current compressor state)
HvacFanIsOnmonitor the thermostat for any time the fan turns on, off, or has any change (fanIsOn is the current fan state)
HvacFanModemonitor the fanMode of the thermostat for any change
HvacFanModeIsAlwaysOnmonitor the fanMode of the thermostat for a change to/from kFanMode.AlwaysOn
HvacFanModeIsAutomonitor the fanMode of the thermostat for a change to/from kFanMode.AutoOn
HvacHeaterIsOnmonitor the thermostat for any time the heater turns on, off, or has any change (heatIsOn is the current heater state)
HvacOperationModemonitor the hvacMode of the thermostat for any change
HvacOperationModeIsAutomonitor the hvacMode of the thermostat for a change to/from kHvacMode.HeatCoolOn
HvacOperationModeIsCoolmonitor the hvacMode of the thermostat for a change to/from kHvacMode.CoolOn
HvacOperationModeIsHeatmonitor the hvacMode of the thermostat for a change to/from kHvacMode.HeatOn
HvacOperationModeIsOffmonitor the hvacMode of the thermostat for a change to/from kHvacMode.Off
HvacOperationModeIsProgramAutomonitor the hvacMode of the thermostat for a change to/from kHvacMode.ProgramAuto
HvacOperationModeIsProgramCoolmonitor the hvacMode of the thermostat for a change to/from kHvacMode.ProgramCool
HvacOperationModeIsProgramHeatmonitor the hvacMode of the thermostat for a change to/from kHvacMode.ProgramHeat
KeypadButtonLedFIXME
OnOffStatemonitor the device for a change to/from on/off
SensorInputmonitor (one of) the sensor input(s) available on the device for =, !=, <, >, or any change - stateSelectorIndex is required to be in the range of available inputs
SensorInputsAllmonitors all of the sensor inputs available on the device for any change
SetpointCoolmonitor the cool setpoint of the thermostat for =, !=, <, >, or any change
SetpointHeatmonitor the heat setpoint of the thermostat for =, !=, <, >, or any change
TemperatureInputmonitor (one of) the temperature sensor(s) available on the device for =, !=, <, >, and any change - stateSelectorIndex is required to be in the range of available inputs
TemperatureInputsAllmonitors all of the temperature sensors available on the device for any change
Zonemonitor (one of) the binary output(s) to become true, false, or any change - stateSelectorIndex is required to be in the range of available outputs

Commands (indigo.devStateChange.*)

Create

Create a DeviceStateChange trigger. This method returns a copy of the newly created trigger.

Command Syntax Examples
indigo.devStateChange.create(name="Trigger Name Here", 
    description="Description Here", 
    folder=1234)
Parameters
Parameter Required Type Description
description No string the description of the trigger
name Yes string the name of the trigger
folder No integer id or instance of the folder in which to put the newly created trigger

Examples

So, let’s look at a concrete example - a thermostat. A thermostat has several states which can be monitored, a couple of which may be lists. Specifically, a thermostat may have multiple temperature sensors and multiple humidity sensors.

Here is an example of creating a device state changed trigger that will execute when the first temperature of thermostat id 738 (named “Main Thermostat”) goes over 80 degrees in Python:

FIXME add additional constructor args when they're done

theTrigger=indigo.devStateChange.create(name="Temp exceeds 80 degrees")
theTrigger.deviceId = 738
theTrigger.stateChangeType = indigo.kStateChange.BecomesGreaterThan
theTrigger.stateSelector = indigo.kStateSelector.TemperatureInput
theTrigger.stateSelectorIndex = 1
theTrigger.stateValue = 80
theTrigger.replaceOnServer()

EmailReceivedTrigger

The EmailReceivedTrigger object represents the email scanning feature in Indigo. You can match on any email received or based on the match fields - subject and/or from email address.

Class Properties

Property Writable Type Description
emailFilter kEmailFilter Yes the type of email filter based on the kEmailFilter enumeration below
emailFrom string Yes if emailFilter is MatchEmailFields, the value to match against the sender’s address
emailSubject string Yes if emailFilter is MatchEmailFields, the value to match against the subject line
Email Filter Enumeration
indigo.kEmailFilter
Value Description
AnyEmailwhen any email is received
MatchEmailFieldswhen email subject/from fields match

Commands (indigo.emailRcvd.*)

Create

Create a EmailReceivedTrigger. This method returns a copy of the newly created trigger.

Command Syntax Examples
indigo.emailRcvd.create(name="Trigger Name Here", 
    description="Description Here", 
    folder=1234)
Parameters
Parameter Required Type Description
description No string the description of the trigger
name Yes string the name of the trigger
folder No integer id or instance of the folder in which to put the newly created trigger

Examples

FIXME add additional constructor args when they're done

theTrigger=indigo.emailRcvd.create(name="Emails from some@body.com")

theTrigger.emailFilter = indigo.kEmailFilter.MatchEmailFields
theTrigger.emailFrom = "some@body.com"
theTrigger.replaceOnServer()

InsteonCommandReceivedTrigger

The InsteonCommandReceivedTrigger object will match incoming INSTEON command events.

Class Properties

Property Type Writable Description
deviceId integer Yes the unique device id - only used if commandSourceType is DeviceId
command kInsteonCmd Yes the command to watch for
commandSourceType kDeviceSourceType Yes the source type - for INSTEON only DeviceId and AnyDevice apply - and deviceId above will only be used if set to DeviceId
buttonOrGroup integer Yes the button or group number from which the command is received - see About Button or Group Numbers below for details

About Button or Group Numbers in INSTEON Events

Various INSTEON devices support features that are implemented via extra group identifiers. For instance, a KeypadLinc will broadcast each of the commands below from each button on it, and each KeypadLinc may have either 6 or 8 buttons depending on configuration. Other devices, like the Motion Sensor and the TriggerLinc will broadcast out group numbers based on other events (battery low, motion detected, dusk/dawn sensor, etc.). Check the How-To Wiki for details about button and/or group numbers for the specific device type you’re interested in.

INSTEON Command Enumeration
indigo.kInsteonCmd
Value Description
AllBrightenwhen an all brighten command begins
AllDimwhen an all dim command begins
AllInstantOffwhen an all instant (fast) off is received
AllInstantOnwhen an all instant (fast) on is received
AllOffwhen an all off is received
AllOnwhen an all on is received
AnyCommandwhen any command is received
Brightenwhen a brighten command begins
Dimwhen a dim command begins
InstantOffwhen an Instant (Fast) off is received in response to a double-tap
InstantOnwhen an Instant (Fast) on is received in response to a double-tap
Offwhen an off command is received
Onwhen an on command is received
StatusChangedwhen a status change broadcast is received
Trigger Device Source Type Enumeration
indigo.kDeviceSourceType
Value Description
NoDevicewhen the source uses no device or address (only used for X10 RF A/V remotes)
Devicewhen the source is an existing device, the ID is specified
Addresswhen the source is a raw X10 address
AnyAddresswhen the source is any X10 address or INSTEON device

Commands (indigo.insteonCmdRcvd.*)

Create

Create a InsteonCommandReceivedTrigger. This method returns a copy of the newly created trigger.

Command Syntax Examples
indigo.insteonCmdRcvd.create(name="Trigger Name Here", 
    description="Description Here", 
    folder=1234)
Parameters
Parameter Required Type Description
description No string the description of the trigger
name Yes string the name of the trigger
folder No integer id or instance of the folder in which to put the newly created trigger

Examples

FIXME add additional constructor args when they're done

theTrigger= indigo.insteonCmdRcvd.create(name="KeypadLinc button 1 Any Change")
theTrigger.command = indigo.kInsteonCmd.AnyCommand
theTrigger.commandSourceType = indigo.kDeviceSourceType.Device
theTrigger.deviceId = 43829874
theTrigger.buttonOrGroup = 1
theTrigger.replaceOnServer()

InterfaceFailureTrigger

The InterfaceFailureTrigger object represents the trigger that’s executed when an interface fails for some reason.

Class Properties

The InterfaceFailed trigger has no additional properties.

Commands (indigo.interfaceFail.*)

Create

Create a InterfaceFailureTrigger. This method returns a copy of the newly created trigger.

Command Syntax Examples
indigo.interfaceFail.create(name="Trigger Name Here", 
    description="Description Here", 
    folder=1234)
Parameters
Parameter Required Type Description
description No string the description of the trigger
name Yes string the name of the trigger
folder No integer id or instance of the folder in which to put the newly created trigger

Examples

theTrigger= indigo.interfaceFail.create(name="Any Interface Failed")

InterfaceInitializedTrigger

The InterfaceInitializedTrigger object represents the trigger that’s executed when an interface initializes successfully.

Class Properties

InterfaceInitializedTrigger has no additional properties.

Commands (indigo.interfaceInit.*)

Create

Create a InterfaceInitializedTrigger. This method returns a copy of the newly created trigger.

Command Syntax Examples
indigo.interfaceInit.create(name="Trigger Name Here", 
    description="Description Here", 
    folder=1234)
Parameters
Parameter Required Type Description
description No string the description of the trigger
name Yes string the name of the trigger
folder No integer id or instance of the folder in which to put the newly created trigger

Examples

theTrigger= indigo.interfaceInit.create(name="Any Interface Initialized")

PluginEventTrigger

A plugin event is defined by a plugin.

Class Properties

Property Type Description
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 Events.xml (or it’s documentation)

Commands (indigo.pluginEvent.*)

Create

Create a trigger. You can create triggers using this method of any type except for events that are defined by your plugin (that class, PluginEventTrigger, has it's own create() method). This method returns a copy of the newly created trigger. Once a trigger of this type is created, the properties can change (via the pluginProps in the Trigger base class), but nothing else can be changed.

Command Syntax Examples
indigo.pluginEvent.create(name="Trigger Name Here", 
    description="Description Here", 
    folder=1234),
    pluginId="com.mycompany.myplugin",
    pluginTypeId="myEvent",
    props={"propA":"value","propB":"value"}
Parameters
Parameter Required Type Description
description No string the description of the trigger
name Yes string the name of the trigger
folder No integer id or instance of the folder in which to put the newly created trigger
pluginId No string the plugin id of the plugin that owns the device you're creating - if it's not present it defaults to your plugin's id
pluginTypeId Yes string this is the id of the <Event> as specified in the Events.xml or in the documentation for the plugin
props No dictionary this is the properties for the trigger - they will be inserted in to the pluginId's property space as supplied above. If you are creating a trigger of a type defined in a different plugin, it's that plugin's id and properties.

Examples

See the Command Syntax above for an example. See Firing Plugin Defined Triggers above for details on how your plugin should watch and fire triggers based on events defined in your Events.xml.

PowerFailureTrigger

The PowerFailureTrigger object represents a trigger that’s executed when an interface loses power (if applicable). Note - not all interfaces can detect a power failure - usually only those interfaces that are plugged directly into an electrical outlet.

Class Properties

PowerFailureTrigger has no additional properties.

Commands (indigo.powerFailure.*)

Create

Create a PowerFailureTrigger. This method returns a copy of the newly created trigger.

Command Syntax Examples
indigo.powerFailure.create(name="Trigger Name Here", 
    description="Description Here", 
    folder=1234)
Parameters
Parameter Required Type Description
description No string the description of the trigger
name Yes string the name of the trigger
folder No integer id or instance of the folder in which to put the newly created trigger

Examples

theTrigger= indigo.powerFailure.create(name="Any Interface Detected Power Failure")

ServerStartupTrigger

The ServerStartupTrigger class represents a trigger that’s executed when the IndigoServer process starts up. This is a special event in that it adds no additional parameters beyond what it inherits from Trigger.

Commands (indigo.serverStartup.*)

Create

Create a ServerStartupTrigger trigger. This method returns a copy of the newly created trigger.

Command Syntax Examples
indigo.serverStartup.create(name="Trigger Name Here", 
    description="Description Here", 
    folder=1234)
Parameters
Parameter Required Type Description
description No string the description of the trigger
name Yes string the name of the trigger
folder No integer id or instance of the folder in which to put the newly created trigger

Examples

theTrigger= indigo.serverStartup.create(name="Startup")

X10CommandReceivedTrigger

The X10CommandReceivedTrigger object will match incoming X10 command events.

Class Properties

Property Type Description
address string if commandSourceType = Address, the full X10 address to listen for or just the house code if command is All* or AnyCommand
avButton kX10AvButton if command = AvButtonPressed, the A/V button to monitor
deviceId integer if commandSourceType = Device, the unique device id
command kX10Cmd the X10 command to watch for
commandSourceType kDeviceSourceType the type of source specified for this trigger
X10 Command Enumeration
indigo.kX10Cmd
Value Description
AllOffwhen an all off is received
AllLightsOffwhen an all lights off is received
AllLightsOnwhen an all lights on is received
AvButtonPressedwhen an A/V button press is received
AnyCommandwhen any command is received
Brightenwhen a brighten command begins
Dimwhen a dim command begins
ExtendedDatawhen an extended data X10 command is received
Offwhen an off command is received
Onwhen an on command is received
PresetDimwhen a preset dim command is received
StatusOffResponsewhen a status off response is received
StatusOnResponsewhen a status on response is received
X10 A/V Button Enumeration
indigo.kX10AvButton
Value Value
0 Left
1 Menu
2 Mute
3 Pause
4 PC
5 Play
6 Power
7 Recall
8 Record
9 Return
AB Rewind
ChannelDown Right
ChannelUp Stop
Display Title
Down Up
Enter VolumeDown
Exit VolumeUp
Forward

Commands (indigo.x10CmdRcvd.*)

Create

Create an X10CommandReceivedTrigger. This method returns a copy of the newly created trigger.

Command Syntax Examples
indigo.x10CmdRcvd.create(name="Trigger Name Here", 
    description="Description Here", 
    folder=1234)
Parameters
Parameter Required Type Description
description No string the description of the trigger
name Yes string the name of the trigger
folder No integer id or instance of the folder in which to put the newly created trigger

Examples

myTrigger=indigo.x10CmdRcvd.create(name="Received any command from F7")
myTrigger.command = indigo.kX10Cmd.AnyCommand
myTrigger.commandSourceType = indigo.kDeviceSourceType.Address
myTrigger.address = "F7"
myTrigger.replaceOnServer()

VariableValueChangeTrigger

The VariableValueChangeTrigger object will match variable changes.

Class Properties

Property Type Description
variableChangeType kVarChange the type of variable change to monitor
variableId integer the unique variable id
variableValue string the value to compare against the variable’s value if variableChangeType is =, !=, >, <
Variable Change Type Enumeration
indigo.kVarChange
Value Description
BecomesEqualvariable value becomes equal to
BecomesFalsevariable value becomes false
BecomesGreaterThanvariable value becomes greater than
BecomesLessThanvariable value becomes less than
BecomesNotEqualvariable value becomes not equal to
BecomesTruevariable value becomes true
Changesvariable value has any change

Commands (indigo.varValueChange.*)

Create

Create an VariableChangeEvent. This method returns a copy of the newly created trigger.

Command Syntax Examples
indigo.varValueChange.create(name="Trigger Name Here", 
    description="Description Here", 
    folder=1234)
Parameters
Parameter Required Type Description
description No string the description of the trigger
name Yes string the name of the trigger
folder No integer id or instance of the folder in which to put the newly created trigger

Examples

FIXME add additional constructor args when they're done

theTrigger=indigo.varValueChange.create(name="Var Changed to True")

theTrigger.variableChangeType = indigo.kVarChange.BecomesEqual
theTrigger.variableId = 9283749872
theTrigger.variableValue = "True"
theTrigger.replaceOnServer()
indigo_2021.2_documentation/trigger_class.txt · Last modified: 2022/04/30 22:37 by mattb
 

© Perceptive Automation, LLC. · Privacy