I am stuck on a simple python script to set RGB values for Hue bulbs using Indigo variables.
The following script works just fine:
- Code: Select all
redValue = 255
indigo.server.log("Red Value is set to " + str(redValue))
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
plug.executeAction("setRGB", indigo.devices[1438718908].id, props={"red":redValue, "green":0, "blue":0})
When I try to substitute an Indigo Variable (that is set to 255) it doesn't work anymore:
- Code: Select all
redValue = indigo.variables[1277411617] # "Red"
indigo.server.log("Red Value is set to " + str(redValue))
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
plug.executeAction("setRGB", indigo.devices[1438718908].id, props={"red":redValue, "green":0, "blue":0})
The error message I get is:
Action Group Hue IRIS1C Red Python Script
Script Red Value is set to description :
folderId : 1786084393
globalProps : MetaProps : (dict)
id : 1277411617
name : Red
pluginProps : emptyDict : (dict)
readOnly : False
remoteDisplay : True
value : 255
Script Error embedded script: No registered converter was able to produce a C++ rvalue of type CCString from this Python object of type Variable
Script Error Exception Traceback (most recent call shown last):
embedded script, line 7, at top level
TypeError: No registered converter was able to produce a C++ rvalue of type CCString from this Python object of type Variable
I tried using int(indigo.variables[1277411617]), but that didn't work either.
Any tips would be appreciated. Thanks