com.eightydegreeswest.iristools.api
Class IrisApi

java.lang.Object
  extended by com.eightydegreeswest.iristools.api.IrisApi

public class IrisApi
extends java.lang.Object


Constructor Summary
IrisApi(java.util.Properties properties)
          
Initialize Iris API by setting cookie handler and the login credentials from the settings file
IrisApi(java.lang.String username, java.lang.String password)
          
Initialize Iris API by setting cookie handler and the login credentials from the settings file
 
Method Summary
 java.lang.String getAllDevices()
          
Get all devices on the account
Web Server example: http://localhost:8080?command=getAllDevices
 java.lang.String getAllGroups()
          
Get all groups on the account
Web Server example: http://localhost:8080?command=getAllGroups
 java.lang.String getAllLocks()
          
Get all locks on the account
Web Server example: http://localhost:8080?command=getAllLocks
 java.lang.String getAllSmartplugs()
          
Get all switches and smartplugs on the account
Web Server example: http://localhost:8080?command=getAllSmartplugs
 java.lang.String getAllThermostats()
          
Get all thermostats on the account
Web Server example: http://localhost:8080?command=getAllThermostats
 java.lang.String getCookie()
           
 java.lang.String getHomeStatus()
          
Get home status
Web Server example: http://localhost:8080?command=getHomeStatus
 java.lang.String getHubID()
           
 org.apache.log4j.Level getLogLevel()
           
 java.lang.String getSessionID()
           
 java.lang.String getUsername()
           
 void login()
          
Login to Iris
Sets session ID for subsequent commands
 void logout()
          
Logout of Iris
Clears session ID
 void setAlarmDisarm()
          
Set alarm to off (disarm)
Web Server example: http://localhost:8080?command=setAlarmDisarm
 void setAlarmOn()
          
Set alarm to on (armed)
Web Server example: http://localhost:8080?command=setAlarmOn
 void setAlarmPartial()
          
Set alarm to night (partial)
Web Server example: http://localhost:8080?command=setAlarmPartial
 void setCookie(java.lang.String cookie)
           
 void setDeviceOff(java.lang.String deviceID)
          
Set a specific device to off
Web Server example: http://localhost:8080?command=setDeviceOff&deviceId=XX
 void setDeviceOn(java.lang.String deviceID)
          
Set a specific device to on
Web Server example: http://localhost:8080?command=setDeviceOn&deviceId=XX
 void setGroupOff(java.lang.String groupID)
          
Set a specific group to off
Web Server example: http://localhost:8080?command=setGroupOff&groupId=XX
 void setGroupOn(java.lang.String groupID)
          
Set a specific group to on
Web Server example: http://localhost:8080?command=setGroupOn&groupId=XX
 void setHubID(java.lang.String hubID)
           
 void setLockBuzzin(java.lang.String lockID)
          
Set a specific lock to buzzin
Web Server example: http://localhost:8080?command=setLockBuzzin&lockId=XX
 void setLockLocked(java.lang.String lockID)
          
Set a specific lock to locked
Web Server example: http://localhost:8080?command=setLockLocked&lockId=XX
 void setLockUnlocked(java.lang.String lockID)
          
Set a specific lock to unlocked
Web Server example: http://localhost:8080?command=setLockUnlocked&lockId=XX
 void setLogLevel(org.apache.log4j.Level logLevel)
           
 void setPassword(java.lang.String password)
           
 void setProfileAway()
          
Set profile to away
Web Server example: http://localhost:8080?command=setProfileAway
 void setProfileHome()
          
Set profile to home
Web Server example: http://localhost:8080?command=setProfileHome
 void setProfileNight()
          
Set profile to night
Web Server example: http://localhost:8080?command=setProfileNight
 void setProfileVacation()
          
Set profile to vacation
Web Server example: http://localhost:8080?command=setProfileVacation
 void setSessionID(java.lang.String sessionID)
           
 void setTemperature(java.lang.String deviceID, java.lang.String temperature)
          
Set a specific temperature
Web Server example: http://localhost:8080?command=setTemperature&deviceId=XX&temp=72
 void setUsername(java.lang.String username)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IrisApi

public IrisApi(java.lang.String username,
               java.lang.String password)

Initialize Iris API by setting cookie handler and the login credentials from the settings file

Parameters:
username -
password -

IrisApi

public IrisApi(java.util.Properties properties)

Initialize Iris API by setting cookie handler and the login credentials from the settings file

Parameters:
properties -
Method Detail

login

public void login()
           throws java.lang.Exception

Login to Iris
Sets session ID for subsequent commands

Throws:
java.lang.Exception

logout

public void logout()

Logout of Iris
Clears session ID


setAlarmOn

public void setAlarmOn()

Set alarm to on (armed)
Web Server example: http://localhost:8080?command=setAlarmOn


setAlarmPartial

public void setAlarmPartial()

Set alarm to night (partial)
Web Server example: http://localhost:8080?command=setAlarmPartial


setAlarmDisarm

public void setAlarmDisarm()

Set alarm to off (disarm)
Web Server example: http://localhost:8080?command=setAlarmDisarm


setProfileHome

public void setProfileHome()

Set profile to home
Web Server example: http://localhost:8080?command=setProfileHome


setProfileAway

public void setProfileAway()

Set profile to away
Web Server example: http://localhost:8080?command=setProfileAway


setProfileNight

public void setProfileNight()

Set profile to night
Web Server example: http://localhost:8080?command=setProfileNight


setProfileVacation

public void setProfileVacation()

Set profile to vacation
Web Server example: http://localhost:8080?command=setProfileVacation


getAllDevices

public java.lang.String getAllDevices()

Get all devices on the account
Web Server example: http://localhost:8080?command=getAllDevices

Returns:
JSON representation of devices

setDeviceOn

public void setDeviceOn(java.lang.String deviceID)

Set a specific device to on
Web Server example: http://localhost:8080?command=setDeviceOn&deviceId=XX

Parameters:
deviceID -

setDeviceOff

public void setDeviceOff(java.lang.String deviceID)

Set a specific device to off
Web Server example: http://localhost:8080?command=setDeviceOff&deviceId=XX

Parameters:
deviceID -

getAllSmartplugs

public java.lang.String getAllSmartplugs()

Get all switches and smartplugs on the account
Web Server example: http://localhost:8080?command=getAllSmartplugs

Returns:
JSON representation of devices

getAllGroups

public java.lang.String getAllGroups()

Get all groups on the account
Web Server example: http://localhost:8080?command=getAllGroups

Returns:
JSON representation of devices

setGroupOn

public void setGroupOn(java.lang.String groupID)

Set a specific group to on
Web Server example: http://localhost:8080?command=setGroupOn&groupId=XX

Parameters:
groupID -

setGroupOff

public void setGroupOff(java.lang.String groupID)

Set a specific group to off
Web Server example: http://localhost:8080?command=setGroupOff&groupId=XX

Parameters:
groupID -

getHomeStatus

public java.lang.String getHomeStatus()

Get home status
Web Server example: http://localhost:8080?command=getHomeStatus

Returns:
JSON representation of devices

getAllLocks

public java.lang.String getAllLocks()

Get all locks on the account
Web Server example: http://localhost:8080?command=getAllLocks

Returns:
JSON representation of devices

setLockLocked

public void setLockLocked(java.lang.String lockID)

Set a specific lock to locked
Web Server example: http://localhost:8080?command=setLockLocked&lockId=XX

Parameters:
lockID -

setLockUnlocked

public void setLockUnlocked(java.lang.String lockID)

Set a specific lock to unlocked
Web Server example: http://localhost:8080?command=setLockUnlocked&lockId=XX

Parameters:
lockID -

setLockBuzzin

public void setLockBuzzin(java.lang.String lockID)

Set a specific lock to buzzin
Web Server example: http://localhost:8080?command=setLockBuzzin&lockId=XX

Parameters:
lockID -

getAllThermostats

public java.lang.String getAllThermostats()

Get all thermostats on the account
Web Server example: http://localhost:8080?command=getAllThermostats

Returns:
JSON representation of devices

setTemperature

public void setTemperature(java.lang.String deviceID,
                           java.lang.String temperature)

Set a specific temperature
Web Server example: http://localhost:8080?command=setTemperature&deviceId=XX&temp=72

Parameters:
deviceID -
temperature -

getSessionID

public java.lang.String getSessionID()

setSessionID

public void setSessionID(java.lang.String sessionID)

getUsername

public java.lang.String getUsername()

setUsername

public void setUsername(java.lang.String username)

setPassword

public void setPassword(java.lang.String password)

getLogLevel

public org.apache.log4j.Level getLogLevel()

setLogLevel

public void setLogLevel(org.apache.log4j.Level logLevel)

getCookie

public java.lang.String getCookie()

setCookie

public void setCookie(java.lang.String cookie)

getHubID

public java.lang.String getHubID()

setHubID

public void setHubID(java.lang.String hubID)