How do I program Indigo’s Home Automation?

First, let’s define Programming…

Programming is telling a computer how to do certain things by giving it instructions.

In Indigo, you define devices, such as:

  • Door Alarm
  • Thermostat
  • Light 1 in the Rec Room
  • Garage Door Opener
  • etc
For basic operations, Indigo has its own Programming scheme, that uses Triggers.  A trigger is a status change on a device.  Here is the list of triggers that Indigo, has built-in.  This is not a complete list of Indigo’s triggers, since 3rd party programmers can add their own triggers…  But it gives you a basic understanding of what triggers are available:
Value Description
ActiveZone monitor the sprinkler’s activeZone to become =, !=, or any change
AnalogInput monitor (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
AnalogInputsAll monitors all of the analog inputs available on the device for any change
BinaryInput monitor (one of) the binary input(s) to become true, false, or any change – stateSelectorIndex is required to be in the range of available inputs
BinaryInputsAll monitors all of the binary inputs available on the device for any change
BinaryOutput monitor (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
BrightnessLevel monitor the brightness level of a device for =, !=, <, >, and any change
HumidityInput monitor (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
HumidityInputsAll monitors all of the humidity sensors available on the device for any change
HvacCoolerIsOn monitor the thermostat for any time the air conditioning turns on, off, or has any change (coolIsOn is the current compressor state)
HvacFanIsOn monitor the thermostat for any time the fan turns on, off, or has any change (fanIsOn is the current fan state)
HvacFanMode monitor the fanMode of the thermostat for any change
HvacFanModeIsAlwaysOn monitor the fanMode of the thermostat for a change to/from kFanMode.AlwaysOn
HvacFanModeIsAuto monitor the fanMode of the thermostat for a change to/from kFanMode.AutoOn
HvacHeaterIsOn monitor the thermostat for any time the heater turns on, off, or has any change (heatIsOn is the current heater state)
HvacOperationMode monitor the hvacMode of the thermostat for any change
HvacOperationModeIsAuto monitor the hvacMode of the thermostat for a change to/from kHvacMode.HeatCoolOn
HvacOperationModeIsCool monitor the hvacMode of the thermostat for a change to/from kHvacMode.CoolOn
HvacOperationModeIsHeat monitor the hvacMode of the thermostat for a change to/from kHvacMode.HeatOn
HvacOperationModeIsOff monitor the hvacMode of the thermostat for a change to/from kHvacMode.Off
HvacOperationModeIsProgramAuto monitor the hvacMode of the thermostat for a change to/from kHvacMode.ProgramAuto
HvacOperationModeIsProgramCool monitor the hvacMode of the thermostat for a change to/from kHvacMode.ProgramCool
HvacOperationModeIsProgramHeat monitor the hvacMode of the thermostat for a change to/from kHvacMode.ProgramHeat
KeypadButtonLed
OnOffState monitor the device for a change to/from on/off
SensorInput monitor (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
SensorInputsAll monitors all of the sensor inputs available on the device for any change
SetpointCool monitor the cool setpoint of the thermostat for =, !=, <, >, or any change
SetpointHeat monitor the heat setpoint of the thermostat for =, !=, <, >, or any change
TemperatureInput monitor (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
TemperatureInputsAll monitors all of the temperature sensors available on the device for any change
Zone monitor (one of) the binary output(s) to become true, false, or any change – stateSelectorIndex is required to be in the range of available outputs

For example, a basic trigger, could do:

  • If   Device (Thermostat)’s Zone 1 Temperature Becomes Greater than 75 then
    • Control Thermostat, Set Mode to Cool On
    • Control Thermostat, Set Cool Setpoint to 74 Degrees
The basic built-in Trigger system is a programming language.  The trigger system is quite impressive , and allows fantastic control over Indigo.
But what if you want to do more…?  More complex triggers and/or develop plugins for Indigo?  Indigo is designed for all levels of Home Automation users, the Beginner, Intermediate, and Expert / Power User.  Indigo supports two more programming languages,  Applescript and Python.
The Python Programming language is highly recommended, over Applescript…  But Applescript does offer some better ease of integrating with your Macintosh & Macintosh applications.
Here’s a secret, Indigo’s triggers even allow you to run embedded Applescript and Python scripts.  So in many cases, you don’t need to develop a plugin.  Just trigger a Python or Applescript, from a trigger action..
But learn Python before you sit down and try to write a Python script for the first time.

This is the Python v2.54 tutorial, which I highly recommend… I wouldn’t start with later versions, simply because v2.5x is the version Indigo currently uses.

http://docs.python.org/release/2.5.4/tut/tut.html

Get comfortable with Python, and then read the Indigo 5 Scripting Tutorial…

http://www.perceptiveautomation.com/wik … g_tutorial

That covers basic Python coding in the Interactive Script Window.

If you decide that you want to progress into developing your own plugins, the Indigo Plugin Developer’s Guide covers everything you have asked about… What are the XML files, and the structure of a plugin, etc…

http://www.perceptiveautomation.com/wik … ugin_guide

Leave a Reply

Your email address will not be published.

*