Scripting Support

Scripting Support

Each of the available Actions can be executed via Python scripts. The required Plugin ID is “com.swmetrics.indigoplugin.colortouch”. For each example below, it is assumed that the Device ID for the ColorTouch Device has been assigned to the Python variable devId and the Python variable ctPlugin is been assigned to the locally running instatnce of the ColorTouch Thermostat Plugin, e.g.:

# device ID for the ColorTouch Device
devId = 1599344418
 
# the ColorTouch Plugin instatnce
ctPlugin = indigo.server.getPlugin("com.swmetrics.indigoplugin.colortouch")

 
  • Warmer
    • Action ID: setpointsWarmer
    • No parameters.
    • Example:
      ctPlugin.executeAction("setpointsWarmer", devId)
       
  • Cooler
    • Action ID: setpointsCooler
    • No Parameters.
    • Example:
      ctPlugin.executeAction("setpointsCooler", devId)

       
  • Set Specific Operating Mode
    • Action ID: setSpecificMode
    • Six (6) parameters (to leave a parameter’s current value on the hardware unchanged, either pass -1, or nothing at all):
      • System Mode (newMode): -1=No change, 0=Off, 1=Heat, 2=Cool, 3=Auto
      • Fan Mode (newFanMode): -1=No change, 0=Auto On, 1=Always On
      • Heat To setpoint (newHeatTo): -1=No change, or the new Heat To setpoint value
      • Cool To setpoint (newCoolTo): -1=No change, else the new Cool To setpoint value
      • Humidify setpoint (newHumTo): -1=No change, else the new Humidify setpoint value
      • Dehumidify setpoint (newDehumTo): -1=No change, else the new Dehumidify setpoint value
    • Example:
      # switch to Auto Mode, and update the temperature setpoints
      # leave the Fan Mode and Humidify/Dehumidify setpoints unchanged.
      ctPlugin.executeAction("setSpecificMode", devId, props={'newMode': 3, 'newHeatTo': 70, 'newCoolTo': 73})

       
  • Set To Away
    • Action ID: setAwayModeToAway
    • No parameters.
    • Example:
      ctPlugin.executeAction("setAwayModeToAway", devId)

       
  • Set To Home
    • Action ID: setAwayModeToHome
    • No parameters.
    • Example:
      ctPlugin.executeAction("setAwayModeToHome", devId)

       
  • Change Schedule Mode
    • Action ID: changeScheduleMode
    • One (1) parameter: new Schedule Mode (scheduleMode).
    • Examples:
      # turn Schedule off
      ctPlugin.executeAction("changeScheduleMode", devId, props={'scheduleMode': 0})
       
      # run the onboard Schedule

      ctPlugin.executeAction("changeScheduleMode", devId, props={'scheduleMode': 1})
      # run Custom Schedule Folder #1

      ctPlugin.executeAction("changeScheduleMode", devId, props={'scheduleMode': 2})
      # run Custom Schedule Folder #2

      ctPlugin.executeAction("changeScheduleMode", devId, props={'scheduleMode': 3})
      # run Custom Schedule Folder #3

      ctPlugin.executeAction("changeScheduleMode", devId, props={'scheduleMode': 4})
      # etc.
       
       
  • Add Schedule Folder To List
    • Action ID: addScheduleFolder
    • One (1) parameter: Schedule Folder ID (schedFolderToAdd).
    • Example:
      # add the Schedule Folder whose ID is 771194871 to the Custom Schedule Folders List
      ctPlugin.executeAction("addScheduleFolder", devId, props={'schedFolderToAdd': 771194871})
       
       
  • Remove Schedule Folder From List
    • Action ID: removeScheduleFolder
    • One (1) parameter: Schedule Folder ID (schedFolderToRemove).
    • Example:
      # remove the Schedule Folder whose ID is 771194871 from the Custom Schedule Folders List
      ctPlugin.executeAction("removeScheduleFolder", devId, props={'schedFolderToRemove': 771194871})

       
  • Move Schedule Folder Within List
    • Action ID: moveScheduleFolder
    • One (2) parameters:
      • Schedule Folder ID (schedFolderToMove)
      • New Index (toIndex) the new list index (the first index is 0)
    • Example:
      # move the Schedule Folder whose ID is 771194871 to the beginning of the
      # Custom Schedule Folders List
      ctPlugin.executeAction("moveScheduleFolder", devId, props={'schedFolderToMove': 771194871, 'toIndex': 0})

       
  • Change Humidify Setpoint
    • Action ID: changeHumidifySetpoint
    • Three (3) parameters (one of the last two is optional, depending upon the value of the first)
      • change mode (changeMode): 0 = make a relative change (positive or negative), 1 = make an absolute change to a specific value
      • Humidify setpoint change (changeByAmount): if change mode is 0, the amount by which to change the Humidify setpoint (positive or negative). If change mode is 1, ignored
      • new Humidify setpoint (changeToAmount): if change mode is 1, the new Humidify setpoint. If change mode is 0, ignored
    • Examples:
      # reduce the Humidify setpoint by 3 percentage points
      ctPlugin.executeAction("changeHumidifySetpoint", devId, props={'changeMode': 0, 'changeByAmount': -3})
       
      # change the Humidify setpoint to 15%
      ctPlugin.executeAction("changeHumidifySetpoint", devId, props={'changeMode': 1, 'changeToAmount': 15})

       
  • Change Dehumidify Setpoint
    • Action ID: changeDehumidifySetpoint
    • Three (3) parameters (one of the last two is optional, depending upon the value of the first)
      • change mode (changeMode): 0 = make a relative change (positive or negative), 1 = make an absolute change to a specific value
      • Dehumidify setpoint change (changeByAmount): if change mode is 0, the amount by which to change the Dehumidify setpoint (positive or negative). If change mode is 1, ignored
      • new Dehumidify setpoint (changeToAmount): if change mode is 1, the new Dehumidify setpoint. If change mode is 0, ignored
    • Example:
      # reduce the Humidify setpoint by 3 percentage points
      ctPlugin.executeAction("changeHumidifySetpoint", devId, props={'changeMode': 0, 'changeByAmount': -3})
       
      # change the Humidify setpoint to 45%
      ctPlugin.executeAction("changeDehumidifySetpoint", devId, props={'changeMode': 1, 'changeToAmount': 45})
       
       
  • Set Temp Units to Fahrenheit
    • Action ID: setTempUnitsToF
    • No parameters.
    • Example:
      ctPlugin.executeAction("setTempUnitsToF", devId)

       
  • Set Temp Units to Celsius
    • Action ID: setTempUnitsToC
    • No parameters.
    • Example:
      ctPlugin.executeAction("setTempUnitsToC", devId)

       
  • Update Alerts
    • Action ID: updateAlerts
    • No parameters.
    • Example:
      ctPlugin.executeAction("updateAlerts", devId)

       
  • Update Runtimes
    • Action ID: updateRuntimes
    • No parameters.
    • Example:
      ctPlugin.executeAction("updateRuntimes", devId)

       
  • Update Runtimes Log
    • Action ID: updateRuntimesLog
    • No parameters.
    • Example:
      ctPlugin.executeAction("updateRuntimesLog", devId)

       
  • Update Sensors
    • Action ID: updateSensors
    • No parameters.
    • Example:
      ctPlugin.executeAction("updateSensors", devId)

       
  • Update Sensors Log
    • Action ID: updateSensorsLog
    • No parameters.
    • Example:
      ctPlugin.executeAction("updateSensorsLog", devId)