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