Hi Mark,
The documentation is not yet completed for scripting. It is on my ever lengthening to-do list.
Here is an example script to invoke boost in a script:
- Code: Select all
import logging
trvPluginId = "com.autologplugin.indigoplugin.trvcontroller"
trvPlugin = indigo.server.getPlugin(trvPluginId)
if trvPlugin.isEnabled():
boostMode = "1" # "1" = Delta T, "2" = Setpoint
boostDeltaT = "5.0" # Only needed if boostmode = "1" [Delta T]
boostSetpoint = "25.0" # Only needed if boostmode = "2" [Setpoint]
boostMinutes = "30"
# Turn on Boost: Change deviceId to the id number of he TRV Controller device you are wanting to boost
trvPlugin.executeAction("processBoost", deviceId= 12345678, props={"boostMode":boostMode, "boostDeltaT":boostDeltaT, "boostSetpoint":boostSetpoint, "boostMinutes":boostMinutes })
# Turn off Boost: Change deviceId to the id number of he TRV Controller device you are wanting to boost
trvPlugin.executeAction("processCancelBoost", deviceId= 12345678)
else:
indigo.server.log("Boost action ignored as TRV plugin not enabled", level=logging.WARNING) # log a failure message
As Joe has illustrated, all the custom state names are listed in custom states are in the Indigo devices UI.
To access the boost state in a script, you need something like:
- Code: Select all
trvDeviceId = 12345678
trvDevice = indigo.devices[trvDeviceId]
boostActive = bool(trvDevice.states["boostActive"])
# boostActive will be either True or False
There isn't (currently) a definitive list of methods and properties in the Wiki.
As Joe points out, you can see what is available by looking at the Actions.xml file in the plugin by using
Show Package Contents from the Finder.
Hope this gets you started.