Device Subclasses
DimmerDevice
Dimmer devices are dimmable light modules. They can be turned on and off and their brightness may be set. Your script may manipulate any dimmer device. You may specify that devices defined by your plugin are of this type. The standard dimmer UI in the various clients will be presented to users attempting to control your device.
Class Properties
| Property |
Type |
Writable |
Description |
brightness |
integer |
No |
an integer from 0-100 indicating the brightness of the device - plugin developers may decide if their device may be on but have a brightness of 0 (non-standard) - set using commands below |
ledStates |
list |
No |
this is a list of booleans that represent the state of LEDs on the device. So, to check to see if LED 3 is on you'd check dev.ledStates[2] (Python arrays are 0-based so the first element is element 0). Currently, only KeypadLinc devices use this array - however, future devices may use it as well so you should probably check the length first to make sure that the LED you're looking for is actually there. Use the len(dev.ledStates) method to see how many entries there are before you access a specific index. |
onState |
boolean |
No |
indicates whether the device is on - shortcut for dev.states['onOffState'] |
Device States
These are the states provided by this device type and accessible through the dev.states dictionary. They are read-only, but if you're a plugin developer you can use the updateStateOnServer() class method to update the value for devices owned by your plugin.
| State ID |
Type |
Property Name |
Notes |
brightnessLevel |
integer |
brightness |
brightness of the device - value is in the range of 0 to 100. Can be accessed by dev.brightness |
onOffState |
boolean |
onState |
indicates whether the device is on - can be accessed by dev.onState. |
Commands (indigo.dimmer.*)
All Lights Off
Turns off all lights for all protocols unless a direct parameter is specified. The direct parameter, if specified, will determine which lights will be turned off. Lights are defined as all dimmable devices. This command doesn’t work for plugin defined devices regardless of type.
| Command Syntax Examples |
indigo.dimmer.allLightsOff() |
indigo.dimmer.allLightsOff(indigo.kAllDeviceSel.HouseCodeA) |
indigo.dimmer.allLightsOff(indigo.kAllDeviceSel.Insteon) |
| Parameters |
|
|
|
|
|
| Parameter |
Required |
Type |
Description |
|
|
| direct parameter |
No |
kAllDeviceSel |
enumerated value to indicate which devices to turn off, all if no parameter is passed - see the kAllDeviceSel enumeration for a full description |
|
|
All Lights On
Turns on all lights for all protocols unless a direct parameter is specified. The direct parameter, if specified, will determine which lights will be turned on. Lights are defined as all dimmable devices. This command doesn’t work for plugin defined devices regardless of type.
| Command Syntax Examples |
indigo.dimmer.allLightsOn() |
indigo.dimmer.allLightsOn(indigo.kAllDeviceSel.HouseCodeA) |
indigo.dimmer.allLightsOn(indigo.kAllDeviceSel.Insteon) |
| Parameters |
|
|
|
|
|
| Parameter |
Required |
Type |
Description |
|
|
| direct parameter |
No |
kAllDeviceSel |
enumerated value to indicate which lights to turn on, all if no parameter is passed - see the kAllDeviceSel enumeration for a full description |
|
|
Brighten
Changes the brightness of the specified light relative to the current brightness.
| Command Syntax Examples |
indigo.dimmer.brighten(123) |
indigo.dimmer.brighten('Office Lamp', by=50, delay=4) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*by* |
No |
integer |
relative amount to brighten by where brightness is 0-100 |
*delay* |
No |
integer |
number of seconds to delay before executing the brighten command |
Dim
Dim the brightness of the specified light by some amount relative to the current brightness.
| Command Syntax Examples |
indigo.dimmer.dim(123) |
indigo.dimmer.dim('Office Lamp', by=50, delay=4) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*by* |
No |
integer |
relative amount to dim by where dimness is 0-100 |
*delay* |
No |
integer |
number of seconds to delay before executing the dim command |
Set Brightness
Changes the brightness of the specified light to a specific value.
| Command Syntax Examples |
indigo.dimmer.setBrightness(123, value=75) |
indigo.dimmer.setBrightness(123, value=75, delay=360) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*value* |
Yes |
integer |
absolute value to set the brightness to on a scale of 0-100 |
*delay* |
No |
integer |
number of seconds to delay before executing the dim command |
Set LED State
Turns on/off the specified LED. Useful for KeypadLinc (and similar) devices. Note: you can't use this method to control the LED of the button(s) that control the direct load - use Turn ON/Turn OFF for those.
| Command Syntax Examples |
indigo.dimmer.setLedState(123, index=0, value=True) |
indigo.dimmer.setLedState(123, index=0, value=True, suppressLogging=True) |
indigo.dimmer.setLedState(123, index=0, value=True, updateStatesOnly=True) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*index* |
Yes |
integer |
the index of the button. Recall that Python-based arrays are 0-based, so the index is also 0-based. That is, the first object in an array is object 0. |
*value* |
Yes |
boolean |
True to turn on the LED, False to turn it off |
*suppressLogging* |
No |
boolean |
True to suppress logging (defaults to False) |
*updateStatesOnly* |
No |
boolean |
True to only update Indigo's internal state - no command will be sent to the KPL (defaults to False) |
Set Color Levels
Sets the color levels for the dimmer device. The levels are the same as brightness, so 0 to 100, except for whiteTemperature which ranges from 1200-15000. Real number precision is allowed and the actions UI will display precision up to the hundredths digit, allowing for relatively good precision if a plugin needs to convert between RGB and HSB.
Some RGBW devices (Aeotec bulb) support 2 different white channels with unique white temperatures: warm and cool. In those cases both whiteLevel and whiteLevel2 can be used. Other white color devices allow for a specific temperature value to be specified (in Kelvin). For those devices you would use both the whiteLevel parameter in combination with the whiteTemperature parameter. Note for specifying white color temperature devices should support either the 2 white level technique, or the single white level + white temperature technique. That is, if the whiteLevel2 parameter is used then whiteTemperature will be ignored.
| Command Syntax Examples |
| --- |
| python
indigo.dimmer.setColorLevels(device,
redLevel,
greenLevel,
blueLevel,
whiteLevel,
whiteLevel2,
whiteTemperature,
delay,
suppressLogging,
updateStatesOnly
) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*redLevel* |
No |
integer |
0 - 100 |
*greenLevel* |
No |
integer |
0 - 100 |
*blueLevel* |
No |
integer |
0 - 100 |
*whiteLevel* |
No |
integer |
0 - 100 |
*whiteLevel2* |
No |
integer |
0 - 100 |
*whiteTemperature* |
No |
integer |
1200 - 15000 |
*delay* |
No |
integer |
Defaults to 0. |
*suppressLogging* |
No |
boolean |
Defaults to *False* |
*updateStatesOnly* |
No |
boolean |
is an argument that exists on several device instance APIs that has Indigo update its device state/UI but does not have the corresponding action sent out to physical module. The use cases for this are pretty few, but sometimes you just want the internal state to update and can skip the actual command to the module. Defaults to *False* |
A note about setting color levels: RGB values are expressed as values from 0 to 255, however, Indigo stores those values from 0 to 100. This requires the RGB values to be converted which is very easy.
# RGB value / 255 * 100
redLevel = 128
newRedLevel = redLevel / 255 * 100
Set On State
Use the Turn On, Turn Off, and Toggle methods to turn on/off a dimmer device.
Examples
Here are examples of device properties:
# Getting a device
myDevice = indigo.devices[123]
# Set a device’s brightness to 75 if it’s currently
# less than that, but only if it’s turned on
myDevice = indigo.devices[123]
if ((myDevice.brightness < 75) and
(myDevice.onState)):
indigo.dimmer.setBrightness(myDevice, 75)
# Brighten a light by 25% after 10 minutes
indigo.dimmer.brighten(123, by=25, delay=600)
# Logging a message if it’s showing in Indigo Touch
myDevice = indigo.devices[123]
if (myDevice.remoteDisplay):
indigo.server.log("device is showing in Indigo Touch")
# Getting the folder ID that the device is in
myDevice = indigo.devices[123]
myDevice.folderId
# OR
indigo.devices[123].folderId # see comments below
You might look at the second example above, and wonder why we didn’t do something like this:
# Set a device’s brightness to 75 if it’s currently
# less than that, but only if it’s turned on
myDevice = indigo.devices[123]
if ((indigo.devices[123].brightness < 75) and
(indigo.devices[123].onState)):
indigo.dimmer.setBrightness(indigo.devices[123], 75)
That code works correctly, but is very inefficient. The Python to C++ bridge will cause a copy of the object to be made every time indigo.devices[123] is used since the devices list is a C++ object, but the object returned from it using the id subscript is bridged to a Python object, and all bridged objects are copies. So, the code directly above will create 3 copies of the device object - very inefficient. The code in the example above gets a single copy of the object and uses that in all the rest of the code. A good rule of thumb is to get an explicit copy of an object if you need to use it more than once.
MultiIODevice
I/O devices have a wide variety of capabilities that we’ve tried to boil down to some specifics. The I/O devices that Indigo supports generally have some combination of three types of inputs: analog, binary, and sensor. They may also support some number of binary outputs.
Class Properties
All outputs are modified using commands below.
| Property |
Type |
Writable |
Description |
analogInputs |
list of integer |
No |
a list of the current analog input values, one per input, in a python list - can be accessed individually using the states below |
analogInputCount |
integer |
No |
number of analog inputs this device supports |
binaryInputs |
list of boolean |
No |
a list of the current binary input values, one per input - can be accessed individually using the states below |
binaryInputCount |
integer |
No |
number of binary inputs this device supports |
binaryOutputs |
list of boolean |
No |
a list of the current binary output values, on per output (max 12 total outputs) - can be accessed individually using the states below |
binaryOutputCount |
integer |
No |
number of binary outputs this device supports |
sensorInputCount |
integer |
No |
number of sensor inputs this device supports |
sensorInputs |
list of integer |
No |
a list of the current sensor input values, one per input - can be accessed individually using the states below |
Device States
These are the states provided by this device type and accessible through the dev.states dictionary. They are read-only.
| State ID |
Type |
Property Name |
Notes |
analogInput# |
integer |
N/A |
value of input number represented by the # sign (input 1 would be analogInput1) - there will only be dev.analogInputCount inputs available |
analogInputsAll |
string |
N/A |
a comma separated list of all analog input values. Can be accessed as a Python list of integers by using dev.analogInputs. |
binaryInput# |
boolean |
N/A |
value of input number represented by the # sign (input 1 would be binaryInput1) - there will only be dev.binaryInputCount inputs available |
binaryInputsAll |
string |
N/A |
a comma separated list of all binary input values. Can be accessed as a Python list of booleans by using dev.binaryInputs. |
binaryOutput# |
boolean |
N/A |
value of output number represented by the # sign (output 1 would be binaryOutput1) - there will only be dev.binaryOutputCount outputs available |
binaryOutputsAll |
string |
N/A |
a comma separated list of all binary output values. Can be accessed as a Python list of booleans by using dev.binaryOutputs. |
sensorInput# |
integer |
N/A |
value of input number represented by the # sign (input 1 would be sensorInput1) - there will only be dev.sensorInputCount inputs available |
sensorInputsAll |
string |
N/A |
a comma separated list of all binary input values. Can be accessed as a Python list of booleans by using dev.sensorInputs. |
Commands (indigo.iodevice.*)
Set Binary Output
Set the state of the specified binary output.
| Command Syntax Examples |
indigo.iodevice.setBinaryOutput(123, index=2, value=True) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*index* |
Yes |
integer |
0-based index of the output to change - should be less than the *binaryOutputCount* property of the device |
*value* |
Yes |
boolean |
True to turn the output on, False to turn it off |
Examples
# If binary input 3 is true, set binary output 1
# to false (python arrays are 0-based)
myIODevice = indigo.devices[123]
if (!myIODevice.binaryInputs[2]):
indigo.iodevice.setBinaryOutput(myIODevice,
index=1,
value=False)
SensorDevice
Some sensor devices, like motion sensors, are treated differently in Indigo. They don’t generally maintain state - so there’s no concept of a sensor being on/off: in the case of a motion sensor, detecting motion and not detecting motion.
They generally send a command of some type when they detect some condition and send another command when they stop detecting it. However, dealing with them in Indigo as if they maintain state is much more useful in many cases. So, Indigo will attempt to maintain a virtual state for each motion sensor if configured that way. Currently, the following devices fall under this category:
- X10 Motion Sensors
- the Wireless Insteon Motion / Occupancy Sensor (2420M) from SmartLabs
- the TriggerLinc from SmartLabs
- the SynchroLinc from SmartLabs
Class Properties
| Property |
Type |
Writable |
Min API |
Description |
allowOnStateChange |
boolean |
No |
1.6 |
True if UI controls should be shown or enabled to change the onState |
allowSensorValueChange |
boolean |
No |
1.6 |
True if UI controls should be shown or enabled to change the sensorValue |
onState |
boolean |
No |
1.0 |
indicates that the device is currently in a triggered or ON state (None if sensor doesn't support ON/OFF) |
sensorValue |
integer or float |
No |
1.6 |
the numerical value of a sensor, such as temperature (None if sensor doesn't support sensor values) |
Commands (indigo.sensor.*)
Set On State
Set the sensor onState property. Normally this is unnecessary since Indigo will maintain it for you so this method is provided mainly for testing and error recovery.
| Command Syntax Examples |
indigo.sensor.setOnState(123, value=True) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
| value |
Yes |
boolean |
True to set Indigo’s state to on, False to set it to off |
Examples
-- none --
RelayDevice
Relay devices are very simple devices, often times called appliance modules. They can be turned on and off only. Your script may manipulate any relay device. Your plugin may specify devices that are of this type and the standard relay UI in the various clients will be presented to users when controlling it.
Class Properties
| Property |
Type |
Description |
|
ledStates |
list |
No |
this is a list of booleans that represent the state of LEDs on the device. So, to check to see if LED 3 is on you'd check dev.ledStates[2] (Python arrays are 0-based so the first element is element 0). Currently, only KeypadLinc devices use this array - however, future devices may use it as well so you should probably check the length first to make sure that the LED you're looking for is actually there. Use the len(dev.ledStates) method to see how many entries there are before you access a specific index. |
*onState* |
boolean |
No |
indicates whether the device is on - shortcut to dev.states['onOffState'] |
Device States
These are the states provided by this device type and accessible through the dev.states dictionary. They are read-only, but if you're a plugin developer you can use the updateStateOnServer() class method to update the value for devices owned by your plugin.
| State ID |
Type |
Property Name |
Notes |
onOffState |
boolean |
onState |
indicates whether the device is on - use dev.onState property as a shortcut |
Commands (indigo.relay.*)
Use the Turn On, Turn Off, and Toggle methods in the indigo.device.* namespace to turn on/off a relay device.
Set LED State
Turns on/off the specified LED. Useful for KeypadLinc (and similar) devices. Note: you can't use this method to control the LED of the button(s) that control the direct load - use Turn ON/Turn OFF for those.
| Command Syntax Examples |
indigo.relay.setLedState(123, index=0, value=True) |
indigo.relay.setLedState(123, index=0, value=True, suppressLogging=True) |
indigo.relay.setLedState(123, index=0, value=True, updateStatesOnly=True) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*index* |
Yes |
integer |
the index of the button. Recall that Python-based arrays are 0-based, so the index is also 0-based. That is, the first object in an array is object 0. |
*value* |
Yes |
boolean |
True to turn on the LED, False to turn it off |
*suppressLogging* |
No |
boolean |
True to suppress logging (defaults to False) |
*updateStatesOnly* |
No |
boolean |
True to only update Indigo's internal state - no command will be sent to the KPL (defaults to False) |
Examples
# Toggle the device
indigo.device.toggle(123)
SpeedControlDevice
Speed control devices are generally controllers for motors of some type. The first implementation was for the Insteon FanLinc, which is a ceiling fan motor controller. This device type provides two different methods of setting the speed of the motor: by level, which ranges from 0 (off) to 100 (full on), and by index. With a device like a FanLinc, for instance, you can't set an arbitrary speed - you can only set it to some number of fixed speeds and this is what index is for. The FanLinc will in fact respond to setting the level, but we normalize the level to the appropriate speed. Other speed control devices may not choose to do so.
Class Properties
| Property |
Type |
Writable |
Description |
*onState* |
boolean |
No |
indicates whether the device is on - shortcut to dev.states['onOffState'] |
*speedIndex* |
integer |
No |
indicates the current speed index for devices that support some fixed # of speeds - shortcut to dev.states['speedIndex'] |
*speedIndexCount* |
integer |
No |
indicates the number of indexes available for this device (defaults to 4) |
*speedLevel* |
integer |
No |
indicates the level the device is set to (0-100) - shortcut to dev.states['speedLevel'] |
Device States
These are the states provided by this device type and accessible through the dev.states dictionary. They are read-only, but if you're a plugin developer you can use the updateStateOnServer() class method to update the value for devices owned by your plugin.
| State ID |
Type |
Property Name |
Notes |
onOffState |
boolean |
onState |
indicates whether the device is on - use dev.onState property as a shortcut |
speedIndex |
boolean |
speedIndex |
indicates the current speed index for devices that support some fixed # of speeds - use dev.speedIndex property as a shortcut |
speedIndex.ui |
string |
n/a |
a more user friendly name for the current index (e.g. high, medium, low, off) |
speedLevel |
integer |
speedLevel |
indicates the level the device is set to (0-100) - use dev.speedLevel property as a shortcut |
Commands (indigo.speedcontrol.*)
Decrease Speed Index
Decreases the speed index.
| Command Syntax Examples |
indigo.speedcontrol.decreaseSpeedIndex(123) |
indigo.speedcontrol.decreaseSpeedIndex(123, by=2) |
indigo.speedcontrol.decreaseSpeedIndex(123, delay=10) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*by* |
No |
integer |
the number of index positions to decrease by. Defaults to 1 if not specified. |
*delay* |
No |
integer |
delays the command by the specified number of seconds. Defaults to no delay if not specified. |
Increase Speed Index
Increases the speed index.
| Command Syntax Examples |
indigo.speedcontrol.increaseSpeedIndex(123) |
indigo.speedcontrol.increaseSpeedIndex(123, by=2) |
indigo.speedcontrol.increaseSpeedIndex(123, delay=10) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*by* |
No |
integer |
the number of index positions to increase by. Defaults to 1 if not specified. |
*delay* |
No |
integer |
delays the command by the specified number of seconds. Defaults to no delay if not specified. |
Set Speed Index
Sets the speed index to the specified value.
| Command Syntax Examples |
indigo.speedcontrol.setSpeedIndex(123, value=2) |
indigo.speedcontrol.increaseSpeedIndex(123, value=2, delay=10) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*value* |
Yes |
integer |
index position to set the index to. |
*delay* |
No |
integer |
delays the command by the specified number of seconds. Defaults to no delay if not specified. |
Set Speed Level
Sets the speed index to the specified value.
| Command Syntax Examples |
indigo.speedcontrol.setSpeedLevel(123, value=50) |
indigo.speedcontrol.setSpeedLevel(123, value=75, delay=10) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*value* |
Yes |
integer |
level of the motor control, from 0-100. |
*delay* |
No |
integer |
delays the command by the specified number of seconds. Defaults to no delay if not specified. |
SprinklerDevice
Sprinkler devices generally have some number of sprinkler zones.
Class Properties
| Property |
Type |
Writable |
Min API |
Description |
activeZone |
integer |
No |
1.0 |
the 1-based index of the active zone (None=all zones off, 1=zone 1, 2=zone 2, ...). Note this property has undergone changes in name (previously called activeZoneIndex) as well as semantics (previously the index being 0-based). |
zoneCount |
integer |
No |
1.0 |
the number of zones available for this sprinkler |
zoneEnableList |
list of boolean |
No |
1.13 |
list of booleans, starting at zone 1 through zone [*zoneCount*], that specify if a given zone is enabled (has a maximum zone duration > 0). |
zoneNames |
list of string |
No |
1.0 |
list of zone names, starting at zone 1 through zone [*zoneCount*]. You must include *zoneCount* strings in the list. |
zoneMaxDurations |
list of floats |
No |
1.0 |
list of zone durations in minutes, starting at zone 1 through zone [*zoneCount*]. You must include *zoneCount* integers in the list. |
zoneScheduledDurations |
list of floats |
No |
1.0 |
list of currently active zone durations in minutes if a schedule is running (empty list if no schedule is running), starts at zone 1 through zone [*zoneCount*] |
pausedScheduleZone |
integer |
No |
1.16 |
the 1-based index of the paused sprinkler zone index (None=schedule not paused, 1=zone 1 paused, 2=zone 2 paused, ...). |
pausedScheduleRemainingZoneDuration |
float |
No |
1.16 |
the paused sprinkler zone duration in minutes (None if schedule not paused) |
Device States
These are the states provided by this device type and accessible through the dev.states dictionary. They are read-only.
| State ID |
Type |
Property Name |
Notes |
activeZone |
integer |
activeZone |
the number of the active zone, 0 if off (1=zone 1, 2=zone 2, etc) |
activeZone.ui |
string |
N/A |
the active zone as a human readable string |
zone# |
boolean |
N/A |
replace the # with the zone number (up to dev.zoneCount) to return whether the zone is running or not |
Commands (indigo.sprinkler.*)
Next Zone
Set the sprinkler to the next zone, and turn off if it’s the last defined zone.
| Command Syntax Examples |
indigo.sprinkler.nextZone(123) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
Pause Schedule
Pause the current sprinkler schedule but keep it active so it can be resumed.
| Command Syntax Examples |
indigo.sprinkler.pause(123) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
Previous Zone
Set the sprinkler to the previous zone, and turn off if it’s the first defined zone.
| Command Syntax Examples |
indigo.sprinkler.previousZone(123) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
Resume Schedule
Resume the current sprinkler schedule.
| Command Syntax Examples |
indigo.sprinkler.resume(123) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
Run Schedule
Run a sprinkler schedule.
| Command Syntax Examples |
indigo.sprinkler.run(123, schedule=[10,15,8, 0, 0, 0, 0, 0]) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
schedule |
Yes |
list of reals |
list of reals representing the number of minutes to run for each zone - the list must have [zoneCount] elements, with 0 for any zone that shouldn’t run |
Stop Schedule
Stop the current sprinkler schedule and clear it.
| Command Syntax Examples |
indigo.sprinkler.stop(123) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
Set Active Zone
API v1.12+ only: Turn on a specific zone.
| Command Syntax Examples |
indigo.sprinkler.setActiveZone(123, index=2) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*index* |
Yes |
integer |
1-based index of the zone to turn on |
Examples
# run schedule
indigo.sprinkler.run(123,
schedule=[10,15,8, 0, 0, 0, 0, 0])
ThermostatDevice
Thermostats have a wide variety of capabilities that we’ve tried to boil down to some specifics. They can have multiple temperature and humidity sensors and--depending on the device capabilities and region--may have a fan mode, an HVAC mode (heating, cooling, etc) and associated setpoints. Note: some thermostats don’t support getting the equipment state values: coolIsOn, fanIsOn, heatIsOn, dehumidifierIsOn, and humidifierIsOn. For those thermostats those properties will always be False.
Class Properties
| Property |
Type |
Writable |
Min API |
Description |
|
coolIsOn |
boolean |
No |
1.0 |
is the cooling system (compressor) currently running - shortcut for dev.states['hvacCoolerIsOn']. This property is always present and will be False if the corresponding state dev.states['hvacCoolerIsOn'] is not present. |
|
coolSetpoint |
float |
No |
1.0 |
current cool setpoint value - shortcut for dev.states['setpointCool'] |
|
dehumidifierIsOn |
boolean |
No |
1.7 |
is the dehumidifier currently turned ON - shortcut for dev.states['hvacDehumidifierIsOn'] |
|
fanMode |
kFanMode |
No |
1.0 |
the operating mode for the fan attached to the thermostat - shortcut for dev.states['hvacFanMode'] |
|
fanIsOn |
boolean |
No |
1.0 |
is the fan currently running - shortcut for dev.states['hvacFanIsOn'] |
|
heatIsOn |
boolean |
No |
1.0 |
is the heater currently running - shortcut for dev.states['hvacHeaterIsOn']. This property is always present and will be False if the corresponding state dev.states['hvacHeaterIsOn'] is not present. |
|
heatSetpoint |
float |
No |
1.0 |
current heat setpoint value - shortcut for dev.states['setpointHeat'] |
|
humidities |
list of float |
No |
1.0 |
a list of floating point values representing the current values of all humidity sensors connected to the thermostat |
|
humiditySensorCount |
integer |
No |
1.0 |
number of humidity sensors this thermostat supports |
|
humidifierIsOn |
boolean |
No |
1.7 |
is the humidifier currently turned ON - shortcut for dev.states['hvacHumidifierIsOn'] |
|
hvacMode |
kHvacMode |
No |
1.0 |
the operating mode for the HVAC system attached to the thermostat - shortcut for dev.states['hvacOperationMode'] |
|
temperatureSensorCount |
integer |
No |
1.0 |
number of temperature sensors this thermostat supports |
|
temperatures |
list of float |
No |
1.0 |
a list of floating point values representing the current values of all temperature sensors connected to the thermostat |
|
To check whether the thermostat device actually supports the coolIsOn and heatIsOn properties, one can check: support_heat_and_cool = dev.pluginProps.get("ShowCoolHeatEquipmentStateUI", False)
Plugin Capabilities
These pluginProps can be updated by a plugin to describe the capabilities for a particular thermostat instance. Some of these are useful to provide a higher-level abstraction for accessing/changing thermostat properties or states.
| Property | Type | Writeable | Description |
| --- | --- | --- | --- |
| NumTemperatureInputs | Integer | Yes | should range between 1 and 3 |
| NumHumidityInputs | Integer | Yes | should range between 0 and 3 |
| SupportsHeatSetpoint | Boolean | Yes | True or False |
| SupportsCoolSetpoint | Boolean | Yes | True or False |
| SupportsHvacOperationMode | Boolean | Yes | True or False |
| SupportsHvacFanMode | Boolean | Yes | True or False |
| ShowCoolHeatEquipmentStateUI | Boolean | Yes | True or False |
Some of these are reflected as attributes in the device instance as well:
| Attribute | Read-Only |
| --- | --- |
| dev.hvacMode | Yes |
| dev.fanMode | Yes |
| dev.coolSetpoint | Yes |
| dev.heatSetpoint | Yes |
| dev.temperatureSensorCount | Yes |
| dev.temperatures | Yes |
| dev.humiditySensorCount | Yes |
| dev.humidities | Yes |
| dev.coolIsOn | Yes |
| dev.heatIsOn | Yes |
| dev.fanIsOn | Yes |
| dev.dehumidifierIsOn | Yes |
| dev.humidifierIsOn | Yes |
| dev.supportsHvacFanMode | Yes |
| dev.supportsHvacOperationMode | Yes |
| dev.supportsCoolSetpoint | Yes |
| dev.supportsHeatSetpoint | Yes |
More information on how to use these Thermostat properties and attributes can be found in the Example Device - Thermostat.indigoPlugin in the Indigo Plugin SDK.
Fan Mode Enumeration
*indigo.kFanMode* |
|
| Value |
Description |
AlwaysOn |
signal the fan that it should be running continuously |
Auto |
signal the fan that it should only run when the HVAC system needs it to be running |
HVAC Mode Enumeration
*indigo.kHvacMode* |
|
| Value |
Description |
Cool |
the hvac system is only reacting to cool setpoints |
HeatCool |
the hvac system is reacting to both cool and heat setpoints |
Heat |
the hvac system is only reacting to and heat setpoints |
Off |
the hvac system is turned off |
ProgramHeatCool |
the hvac system is executing it’s built-in automatic program, which usually responds to both heat and cool setpoints |
ProgramCool |
the hvac system is executing it’s built-in cooling program |
ProgramHeat |
the hvac system is executing it’s built-in heating program |
Device States
These are the states provided by this device type and accessible through the dev.states dictionary. They are read-only, but if you're a plugin developer you can use the updateStateOnServer() class method to update most of these states for devices owned by your plugin (exceptions are noted below).
| State ID |
Type |
Property Name |
Notes |
|
humidityInput# |
float |
N/A |
replace the # with the humidity sensor # (up to humiditySensorCount) to directly access the humidity value for that input |
|
humidityInputsAll |
string |
N/A |
a comma separated list of all humidity values |
|
hvacCoolerIsOn |
boolean |
coolIsOn |
True if the cooling system currently running |
|
hvacDehumidifierIsOn |
boolean |
dehumidifierIsOn |
True if the dehumidifier is currently running |
|
hvacFanIsOn |
boolean |
fanIsOn |
True if the fan currently running |
|
hvacFanMode |
kFanMode |
fanMode |
operating mode for the fan attached to the thermostat |
|
hvacFanIsAlwaysOn |
boolean |
N/A |
True if the fan mode is set to AlwaysOn. Note: this state can't be directly updated but rather will be updated automatically when you update hvacFanMode. |
|
hvacFanIsAuto |
boolean |
N/A |
True if the fan mode is set to Auto. Note: this state can't be directly updated but rather will be updated automatically when you update hvacFanMode. |
|
hvacHeaterIsOn |
boolean |
heatIsOn |
True if the heating system currently running |
|
hvacHumidifierIsOn |
boolean |
humidifierIsOn |
True if the humidifier is currently running |
|
hvacOperationMode |
kHvacMode |
hvacMode |
operating mode for the HVAC system attached to the thermostat |
|
hvacOperationModeIsAuto |
boolean |
N/A |
True if the HVAC is set to HeatCool. Note: this state can't be directly updated but rather will be updated automatically when you update hvacOperationMode. |
|
hvacOperationModeIsCool |
boolean |
N/A |
True if the HVAC is set to Cool. Note: this state can't be directly updated but rather will be updated automatically when you update hvacOperationMode. |
|
hvacOperationModeIsHeat |
boolean |
N/A |
True if the HVAC is set to Heat. Note: this state can't be directly updated but rather will be updated automatically when you update hvacOperationMode. |
|
hvacOperationModeIsOff |
boolean |
N/A |
True if the HVAC is set to Off. Note: this state can't be directly updated but rather will be updated automatically when you update hvacOperationMode. |
|
hvacOperationModeIsProgramAuto |
boolean |
N/A |
True if the HVAC is set to ProgramHeatCool. Note: this state can't be directly updated but rather will be updated automatically when you update hvacOperationMode. |
|
hvacOperationModeIsProgramCool |
boolean |
N/A |
True if the HVAC is set to ProgramCool. Note: this state can't be directly updated but rather will be updated automatically when you update hvacOperationMode. |
|
hvacOperationModeIsProgramHeat |
boolean |
N/A |
True if the HVAC is set to ProgramHeat. Note: this state can't be directly updated but rather will be updated automatically when you update hvacOperationMode. |
|
setpointCool |
float |
coolSetpoint |
the cool setpoint |
|
setpointHeat |
float |
heatSetpoint |
the heat setpoint |
|
temperatureInput# |
float |
N/A |
replace the # with the temperature sensor # (up to temperatureSensorCount) to directly access the humidity value for that input |
|
temperatureInputsAll |
string |
N/A |
a comma separated list of all temperature values |
|
Commands (indigo.thermostat.*)
Decrease Cool Setpoint
Decrease the cool setpoint by a delta value.
| Command Syntax Examples |
| --- |
| python
indigo.thermostat.decreaseCoolSetpoint(123)
indigo.thermostat.decreaseCoolSetpoint(123, delta=5) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*delta* |
No |
float |
Number of degrees to decrease the cool setpoint. If unspecified, the change will be equal to one degree. |
Decrease Heat Setpoint
Decrease the heat setpoint by a delta value.
| Command Syntax Examples |
| --- |
| python
indigo.thermostat.decreaseHeatSetpoint(123)
indigo.thermostat.decreaseHeatSetpoint(123, delta=5) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*delta* |
No |
float |
Number of degrees to decrease the heat setpoint. If unspecified, the change will be equal to one degree. |
Increase Cool Setpoint
Increase the cool setpoint by a delta value.
| Command Syntax Examples |
| --- |
| python
indigo.thermostat.increaseCoolSetpoint(123)
indigo.thermostat.increaseCoolSetpoint(123, delta=5) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*delta* |
No |
float |
Number of degrees to increase the cool setpoint. If unspecified, the change will be equal to one degree. |
Increase Heat Setpoint
Increase the heat setpoint by a delta value.
| Command Syntax Examples |
| --- |
| python
indigo.thermostat.increaseHeatSetpoint(123)
indigo.thermostat.increaseHeatSetpoint(123, delta=5) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*delta* |
No |
float |
Number of degrees to increase the heat setpoint. If unspecified, the change will be equal to one degree. |
Set Cool Setpoint
Set the cool setpoint to an absolute temperature.
| Command Syntax Examples |
indigo.thermostat.setCoolSetpoint(123, value=78) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*value* |
Yes |
integer |
the absolute temperature of the setpoint |
Set Fan Mode
Adjust the fan mode.
| Command Syntax Examples |
indigo.thermostat.setFanMode(123, value=indigo.kFanMode.AlwaysOn) |
| Parameters |
|
|
|
|
| Parameter |
Required |
Type |
Description |
|
| direct parameter |
Yes |
integer |
id or instance of the device |
|
*value* |
Yes |
kFanMode |
the operating mode for the fan |
|
Set Heat Setpoint
Set the heat setpoint to an absolute temperature.
| Command Syntax Examples |
indigo.thermostat.setHeatSetpoint(123, value=78) |
| Parameters |
|
|
|
| Parameter |
Required |
Type |
Description |
| direct parameter |
Yes |
integer |
id or instance of the device |
*value* |
Yes |
integer |
the absolute temperature of the setpoint |
Set HVAC Mode
Adjust the HVAC mode.
| Command Syntax Examples |
indigo.thermostat.setHvacMode(123, value=indigo.kHvacMode.HeatCool) |
| Parameters |
|
|
|
|
| Parameter |
Required |
Type |
Description |
|
| direct parameter |
Yes |
integer |
id or instance of the device |
|
*value* |
Yes |
kHvacMode |
HVAC mode identifier |
|
Examples
# increase the cool setpoint by 5 degrees
indigo.thermostat.decreaseCoolSetpoint(123, delta=5)
# set the thermostat mode to auto
indigo.thermostat.setHvacMode(123,
value=indigo.kHvacMode.HeatCool)
# set the heat setpoint to 78
indigo.thermostat.setHeatSetpoint(123, value=78)