com.udi.isy.jsdk.insteon
Class ISYInsteonClient

java.lang.Object
  extended by com.universaldevices.client.UDClient
      extended by com.udi.isy.jsdk.ISYClient
          extended by com.udi.isy.jsdk.insteon.ISYInsteonClient
All Implemented Interfaces:
IModelChangeListener
Direct Known Subclasses:
MyISYInsteonClient

public abstract class ISYInsteonClient
extends ISYClient

This class extends ISYClient to support all Insteon related communications and functionality

Author:
UD Architect

Field Summary
 
Fields inherited from interface com.universaldevices.device.model.IModelChangeListener
UD_BATCH_MODE_CHANGED_ACTION, UD_BATTERY_DEVICE_WRITE_MODE_CHANGED_ACTION, UD_CLIENT_HEART_BEAT_EVENT, UD_DEVICE_SPECIFIC_EVENT, UD_DISCOVERING_NODES_ACTION, UD_DISCOVERING_NODES_COMPLETE_ACTION, UD_FOLDER_ADDED_ACTION, UD_FOLDER_REMOVED_ACTION, UD_FOLDER_RENAMED_ACTION, UD_GROUP_ADDED_ACTION, UD_GROUP_REMOVED_ACTION, UD_GROUP_RENAMED_ACTION, UD_INTERNET_ACCESS_DISABLED_ACTION, UD_INTERNET_ACCESS_ENABLED_ACTION, UD_INTERNET_ACCESS_EVENT, UD_INTERNET_ACCESS_FAILED_ACTION, UD_NETWORK_RENAMED_ACTION, UD_NODE_ADDED_ACTION, UD_NODE_CHANGE_LINK_ACTION, UD_NODE_CLEAR_ERROR_ACTION, UD_NODE_DEVICE_ID_CHANGED, UD_NODE_DEVICE_PROPERTY_CHANGED, UD_NODE_ENABLED_ACTION, UD_NODE_HAS_PENDING_DEVICE_WRITES_ACTION, UD_NODE_IN_ERROR_ACTION, UD_NODE_MOVED_ACTION, UD_NODE_PARENT_CHANGED_ACTION, UD_NODE_POWER_INFO_CHANGED_ACTION, UD_NODE_REMOVED_ACTION, UD_NODE_REMOVED_FROM_GROUP_ACTION, UD_NODE_RENAMED_ACTION, UD_NODE_REVISED_ACTION, UD_NODE_WRITING_TO_DEVICE_ACTION, UD_NODES_UPDATED_EVENT, UD_NOTIFICATION_SETTINGS_UPDATED_ACTION, UD_NTP_COMM_FAILED_ACTION, UD_NTP_SETTINGS_UPDATED_ACTION, UD_PROGRESS_EVENT_UPDATE, UD_PROGRESS_UPDATED_EVENT, UD_SYS_CONFIG_UPDATED_EVENT, UD_SYSTEM_BUSY_EVENT, UD_SYSTEM_IS_BUSY_ACTION, UD_SYSTEM_IS_IDLE_ACTION, UD_SYSTEM_IS_IN_SAFE_MODE_ACTION, UD_SYSTEM_IS_NOT_BUSY_ACTION, UD_TIME_CHANGED_ACTION, UD_TIME_CONFIG_CHANGED_ACTION, UD_TRIGGER_EVENT_GET_STATUS, UD_TRIGGER_EVENT_INFO_STRING, UD_TRIGGER_EVENT_KEY_CHANGED, UD_TRIGGER_EVENT_LEARN_IR, UD_TRIGGER_EVENT_SCHEDULE, UD_TRIGGER_EVENT_STATUS, UD_TRIGGER_EVENT_VAR_INIT, UD_TRIGGER_EVENT_VAR_STATUS, UD_TRIGGER_UPDATED_EVENT
 
Constructor Summary
ISYInsteonClient()
           
 
Method Summary
 boolean addNewScene(java.lang.String name)
          Adds a new Scene (UDGroup to ISY.
 boolean brightenDevice(java.lang.String address)
          Brightens a light device one notch
 boolean brightenScene(java.lang.String address)
          Brightens all the devices, within the scene, one notch
 boolean dimDevice(java.lang.String address)
          Dims a light device one notch
 boolean dimScene(java.lang.String address)
          Dims all the devices, within a scene, one notch
 java.util.Hashtable<java.lang.String,SceneProfileAttributes> getDevicesSceneAttributesForAController(java.lang.String scene_address, java.lang.String controller_address)
          Returns a Hashtable of SceneProfileAttributes for a Controller
 java.util.Hashtable<java.lang.String,SceneProfileAttributes> getDevicesSceneAttributesForAScene(java.lang.String scene_address)
          Returns a Hashtable of SceneProfileAttributes.
 boolean isLinking()
           
 boolean moveNodeToSceneAsMaster(UDNode node, UDGroup scene)
          Moves the specified UDNode to the specified scene (UDGroup as a controller/master
 boolean moveNodeToSceneAsSlave(UDNode node, UDGroup scene)
          Moves the specified UDNode to the specified scene (UDGroup as a responder/slave
 boolean setDeviceOnLevel(java.lang.String address, int percent)
          Sets a light device's on level to the given percentage
 boolean setDeviceOnLevelForAScene(java.lang.String scene_address, java.lang.String node_address, int on_level_percent)
          Sets the onlevel for a given Insteon device within a scene.
 boolean setDeviceOnLevelForASceneController(java.lang.String controller_address, java.lang.String node_address, int on_level_percent)
          Sets the on-level for a given Insteon device within a scene which is controlled by another Insteon controller
 boolean setDeviceRampRate(java.lang.String address, int ramprate)
          Sets a light device's ramp-rate to the value
 boolean setDeviceRampRateForAScene(java.lang.String scene_address, java.lang.String node_address, int ramprate)
          Sets the ramp-rate for a given Insteon device within a scene.
 boolean setDeviceRampRateForASceneController(java.lang.String controller_address, java.lang.String node_address, int ramprate)
          Sets the ramp-rate for a given Insteon device within a scene which is controlled by another Insteon controller
 boolean setMasterLinkingMode()
          Puts the PLM in linking mode as master so, when the StartLinking method is called, PLM will act as a controller and not a responder
 boolean setSlaveLinkingMode()
          Puts the PLM in linking mode as slave so, when the StartLinking method is called, PLM will act as a responder and not a controller
 void start()
          Starts the client, looks for an ISY, and when found notifies the client by invoking onNewDeviceAnnounced
 boolean startDeviceManualChangeDown(java.lang.String address)
          Starts dimming a ligth device till stopManualChange is invoked
 boolean startDeviceManualChangeUp(java.lang.String address)
          Starts brightening a ligth device till stopManualChange is invoked
 boolean startLinking()
          Puts the PLM in the linking mode.
 boolean startSceneManualChangeDown(java.lang.String address)
          Starts dimming all devices, within a scene, till stopManualChange is invoked
 boolean startSceneManualChangeUp(java.lang.String address)
          Starts brightening all devices, within a scene, till stopManualChange is invoked
 boolean stopDeviceManualChange(java.lang.String address)
          Stops any previous invocation of startManualChangeUp/Down
 boolean stopLinking()
          Stops the linking session
 boolean stopSceneManualChange(java.lang.String address)
          Stops any previous invocation of startManualChangeUp/Down for a scene
 boolean turnDeviceFastOff(java.lang.String address)
          Turns off the device immediately
 boolean turnDeviceFastOn(java.lang.String address)
          Turns on the device to 100% immediately
 boolean turnDeviceOff(java.lang.String address)
          Turns off the device; if this device is a light device, then the device will turn off the stored ramp-rate
 boolean turnDeviceOn(java.lang.String address)
          Turns on the device; if this device is a light device, then the device will turn on to the stored on-level and at the stored ramp-rate
 boolean turnSceneFastOff(java.lang.String address)
          Turns off all the devices with in a scene immediately
 boolean turnSceneFastOn(java.lang.String address)
          Turns on all the devices within the scene to 100% immediately
 boolean turnSceneOff(java.lang.String address)
          Turns off the scene.
 boolean turnSceneOn(java.lang.String address)
          Turns on the scene.
 
Methods inherited from class com.udi.isy.jsdk.ISYClient
addFolder, addGroup, addNode, cancelNodesDiscovery, changeGroupState, changeNodeState, disableInternetAccess, discoverNodes, enableInternetAccess, getCurrValue, getLog, getNumPendingNotifications, getSystemDateTime, getSystemOptions, getSystemStatus, isISYReady, moveNode, onDeviceOffLine, onDeviceOffLine, onDeviceOnLine, onDeviceOnLine, onDeviceSpecific, onDeviceSpecific, onDiscoveringNodes, onDiscoveringNodes, onFolderRemoved, onFolderRemoved, onFolderRenamed, onFolderRenamed, onGroupRemoved, onGroupRemoved, onGroupRenamed, onGroupRenamed, onInternetAccessDisabled, onInternetAccessEnabled, onInternetAccessUpdated, onModelChanged, onModelChanged, onNetworkRenamed, onNetworkRenamed, onNewFolder, onNewFolder, onNewGroup, onNewGroup, onNewNode, onNewNode, onNodeDiscoveryStopped, onNodeDiscoveryStopped, onNodeEnabled, onNodeEnabled, onNodeError, onNodeError, onNodeHasPendingDeviceWrites, onNodeHasPendingDeviceWrites, onNodeIsWritingToDevice, onNodeIsWritingToDevice, onNodeMoved, onNodeMovedAsMaster, onNodeMovedAsSlave, onNodeParentChanged, onNodeParentChanged, onNodePowerInfoChanged, onNodePowerInfoChanged, onNodeRemoved, onNodeRemoved, onNodeRemovedFromGroup, onNodeRemovedFromGroup, onNodeRenamed, onNodeRenamed, onNodeToGroupRoleChanged, onNodeToGroupRoleChanged, onProgress, onProgress, onSystemConfigChanged, onSystemConfigChanged, onSystemStatus, onSystemStatus, onTriggerStatus, onTriggerStatus, queryGroup, queryNode, reboot, removeeFolder, removeFromGroup, removeGroup, removeNode, renameFolder, renameGroup, renameNetwork, renameNode, resetAllNotifications, resetLog, saveSystemDateTime, saveSystemOptions, setParent, start, updateUserCredentials
 
Methods inherited from class com.universaldevices.client.UDClient
addUDErrorListener, addUDModelChangeListener, authenticate, cleanUp, getControls, getDevice, getGroups, getNodes, isStarted, onNewDevice, onNewDeviceAnnounced, removeUDErrorListener, removeUDModelChangeListener, setStarted, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.universaldevices.device.model.IModelChangeListener
onNodeDeviceIdChanged, onNodeDevicePropertiesRefreshed, onNodeDevicePropertiesRefreshedComplete, onNodeDevicePropertyChanged, onNodeErrorCleared, onNodeRevised
 

Constructor Detail

ISYInsteonClient

public ISYInsteonClient()
Method Detail

start

public void start()
Starts the client, looks for an ISY, and when found notifies the client by invoking onNewDeviceAnnounced

See Also:
ISYClient, UDProxyDevice

setMasterLinkingMode

public boolean setMasterLinkingMode()
Puts the PLM in linking mode as master so, when the StartLinking method is called, PLM will act as a controller and not a responder

Returns:
- true if successful, false otherwise

setSlaveLinkingMode

public boolean setSlaveLinkingMode()
Puts the PLM in linking mode as slave so, when the StartLinking method is called, PLM will act as a responder and not a controller

Returns:
- true if successful, false otherwise

startLinking

public boolean startLinking()
Puts the PLM in the linking mode. The default linking mode for PLM is as master however this behavior may be altered by setSlaveLinkingMode.
Note
: ISY will revert back to the default linking mode as soon as the first link is made.

Returns:
- true if successful, false otherwise

stopLinking

public boolean stopLinking()
Stops the linking session

Returns:
- true if successful, false otherwise

isLinking

public boolean isLinking()
Returns:
- whether or not we are in a linking session

moveNodeToSceneAsMaster

public boolean moveNodeToSceneAsMaster(UDNode node,
                                       UDGroup scene)
Moves the specified UDNode to the specified scene (UDGroup as a controller/master

Parameters:
node - - the node to be moved
scene - - the scene the node is being moved to
Returns:
- true if successful, false otherwise

moveNodeToSceneAsSlave

public boolean moveNodeToSceneAsSlave(UDNode node,
                                      UDGroup scene)
Moves the specified UDNode to the specified scene (UDGroup as a responder/slave

Parameters:
node - - the node to be moved
scene - - the scene the node is being moved to
Returns:
- true if successful, false otherwise

addNewScene

public boolean addNewScene(java.lang.String name)
Adds a new Scene (UDGroup to ISY. This method guarantees unique address for each created scene

Parameters:
name - - the name for the newly created scene
Returns:
- true if successful, false otherwise

turnDeviceOn

public boolean turnDeviceOn(java.lang.String address)
Turns on the device; if this device is a light device, then the device will turn on to the stored on-level and at the stored ramp-rate

Parameters:
address - - the address of the device (UDNode) to be turned on

turnDeviceOff

public boolean turnDeviceOff(java.lang.String address)
Turns off the device; if this device is a light device, then the device will turn off the stored ramp-rate

Parameters:
address - - the address of the device (UDNode) to be turned off

turnDeviceFastOn

public boolean turnDeviceFastOn(java.lang.String address)
Turns on the device to 100% immediately

Parameters:
address - - the address of the device (UDNode) to be turned on

turnDeviceFastOff

public boolean turnDeviceFastOff(java.lang.String address)
Turns off the device immediately

Parameters:
address - - the address of the device (UDNode) to be turned off

dimDevice

public boolean dimDevice(java.lang.String address)
Dims a light device one notch

Parameters:
address - - the address of the UDNode to dim
Returns:
true if successful, false if failed or the address does not point to a light device

brightenDevice

public boolean brightenDevice(java.lang.String address)
Brightens a light device one notch

Parameters:
address - - the address of the UDNode to brighten
Returns:
true if successful, false if failed or the address does not point to a light device

setDeviceOnLevel

public boolean setDeviceOnLevel(java.lang.String address,
                                int percent)
Sets a light device's on level to the given percentage

Parameters:
address - - the address of the UDNode for which the on level is being set
percent - - the percentage to which the light device's on level should be set
Returns:
- true if successful, false if failed or if the address does not point to a light device

setDeviceRampRate

public boolean setDeviceRampRate(java.lang.String address,
                                 int ramprate)
Sets a light device's ramp-rate to the value

Parameters:
address - - the address of the UDNode for which the ramp-rate is being set
ramprate - - the value to which the light device's ramp-rate should be set the possible values of which are between 0 and 31 inclusive. The relationship between these values and the corresponding amount of time it takes to "ramp", is given in InsteonOps.rampRates
Returns:
- true if successful, false if failed or if the address does not point to a light device

startDeviceManualChangeUp

public boolean startDeviceManualChangeUp(java.lang.String address)
Starts brightening a ligth device till stopManualChange is invoked

Parameters:
address - - the address of the UDNode to brighten
Returns:
true if successful, false if failed or the address does not point to a light device

startDeviceManualChangeDown

public boolean startDeviceManualChangeDown(java.lang.String address)
Starts dimming a ligth device till stopManualChange is invoked

Parameters:
address - - the address of the UDNode to dim
Returns:
true if successful, false if failed or the address does not point to a light device

stopDeviceManualChange

public boolean stopDeviceManualChange(java.lang.String address)
Stops any previous invocation of startManualChangeUp/Down

Parameters:
address - - the address of the UDNode to stop manual change
Returns:
true if successful, false if failed or the address does not point to a light device

turnSceneOn

public boolean turnSceneOn(java.lang.String address)
Turns on the scene. Light devices, within the scene, are turned on to the scene's on-level and at the scene's ramp-rate

Parameters:
address - - the address of the scene (UDGroup) to be turned on
Returns:
- true if successful, false otherwise

turnSceneOff

public boolean turnSceneOff(java.lang.String address)
Turns off the scene. Light devices, within the scene, are turned off at the scene's ramp-rate

Parameters:
address - - the address of the device (UDNode) to be turned off
Returns:
- true if successful, false otherwise

turnSceneFastOn

public boolean turnSceneFastOn(java.lang.String address)
Turns on all the devices within the scene to 100% immediately

Parameters:
address - - the address of the scene (UDGroup) to be turned on
Returns:
- true if successful, false otherwise

turnSceneFastOff

public boolean turnSceneFastOff(java.lang.String address)
Turns off all the devices with in a scene immediately

Parameters:
address - - the address of the device (UDGroup) to be turned off
Returns:
- true if successful, false otherwise

dimScene

public boolean dimScene(java.lang.String address)
Dims all the devices, within a scene, one notch

Parameters:
address - - the address of the UDGroup to dim
Returns:
true if successful, false otherwise

brightenScene

public boolean brightenScene(java.lang.String address)
Brightens all the devices, within the scene, one notch

Parameters:
address - - the address of the UDGroup to brighten
Returns:
true if successful, false otherwise

startSceneManualChangeUp

public boolean startSceneManualChangeUp(java.lang.String address)
Starts brightening all devices, within a scene, till stopManualChange is invoked

Parameters:
address - - the address of the UDGroup to brighten
Returns:
true if successful, false otherwise

startSceneManualChangeDown

public boolean startSceneManualChangeDown(java.lang.String address)
Starts dimming all devices, within a scene, till stopManualChange is invoked

Parameters:
address - - the address of the UDGroup to dim
Returns:
true if successful, false otherwise

stopSceneManualChange

public boolean stopSceneManualChange(java.lang.String address)
Stops any previous invocation of startManualChangeUp/Down for a scene

Parameters:
address - - the address of the UDGroup to stop manual change
Returns:
true if successful, false otherwise

getDevicesSceneAttributesForAScene

public java.util.Hashtable<java.lang.String,SceneProfileAttributes> getDevicesSceneAttributesForAScene(java.lang.String scene_address)
Returns a Hashtable of SceneProfileAttributes.

i.e the on-level and ramp-rate for all the devices within a scene: UDGroup.
The result is indexed by the device's address

Parameters:
scene_address - - the address of the scene for which we are going to get all the devices' scene attributes
Returns:
- if successful, a Hashtable of SceneProfileAttributes for the given scene. Otherwise, null
See Also:
UDNode, UDGroup, SceneProfileAttributes

getDevicesSceneAttributesForAController

public java.util.Hashtable<java.lang.String,SceneProfileAttributes> getDevicesSceneAttributesForAController(java.lang.String scene_address,
                                                                                                            java.lang.String controller_address)
Returns a Hashtable of SceneProfileAttributes for a Controller

i.e the on-level and ramp-rate for all the devices within a scene UDGroup and associated to a controller/master.
The result is indexed by the device's address

Parameters:
scene_address - - the address of the scene for which we are going to get all the devices' scene attributes
controller_address - - the address of the master/controller Insteon device beloning to the scene in param 1
Returns:
- a Hashtable of SceneProfileAttributes for the given scene
See Also:
UDNode, UDGroup, SceneProfileAttributes

setDeviceOnLevelForAScene

public boolean setDeviceOnLevelForAScene(java.lang.String scene_address,
                                         java.lang.String node_address,
                                         int on_level_percent)
Sets the onlevel for a given Insteon device within a scene.

Parameters:
scene_address - - the address of the scene to which the Insteon device belongs
node_address - - the address of the Insteon device for which we are setting scene attributes
on_level_percent - - the on-level to be set
Returns:
- true if successful, false otherwise
See Also:
UDGroup

setDeviceRampRateForAScene

public boolean setDeviceRampRateForAScene(java.lang.String scene_address,
                                          java.lang.String node_address,
                                          int ramprate)
Sets the ramp-rate for a given Insteon device within a scene.

Parameters:
scene_address - - the address of the scene to which the Insteon device belongs
node_address - - the address of the Insteon device for which we are setting scene attributes
ramprate - - the value to which the device's ramp-rate, for the given scene, should be set the possible values of which are between 0 and 31 inclusive. The relationship between these values and the corresponding amount of time it takes to "ramp", is given in InsteonOps.rampRates
Returns:
- true if successful, false otherwise
See Also:
UDNode, UDGroup

setDeviceOnLevelForASceneController

public boolean setDeviceOnLevelForASceneController(java.lang.String controller_address,
                                                   java.lang.String node_address,
                                                   int on_level_percent)
Sets the on-level for a given Insteon device within a scene which is controlled by another Insteon controller

Parameters:
controller_address - - the address of the controller to which the Insteon device is linked (slave)
node_address - - the address of the Insteon device for which we are setting scene attributes
on_level_percent - - the on-level to be set
Returns:
- true if successful, false otherwise
See Also:
UDNode, UDGroup

setDeviceRampRateForASceneController

public boolean setDeviceRampRateForASceneController(java.lang.String controller_address,
                                                    java.lang.String node_address,
                                                    int ramprate)
Sets the ramp-rate for a given Insteon device within a scene which is controlled by another Insteon controller

Parameters:
controller_address - - the address of the controller to which the Insteon device is linked (slave)
node_address - - the address of the Insteon device for which we are setting scene attributes
ramprate - - the value to which the device's ramp-rate, for the given controller, should be set the possible values of which are between 0 and 31 inclusive. The relationship between these values and the corresponding amount of time it takes to "ramp", is given in InsteonOps.rampRates
Returns:
- true if successful, false otherwise
See Also:
UDNode, UDGroup