Setting hue colour temperature.

Posted on
Fri Jan 09, 2015 4:52 pm
forestfield offline
Posts: 83
Joined: Dec 29, 2014
Location: West Sussex

Setting hue colour temperature.

I'm trying to set the colour temperature of a bloom hue light.

If I use the following embedded script
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("setCT", indigo.devices["Other Bloom Lamp"].id, props={"brightness":60, "temperature":2800, "rate":0.0})

in an action group the colour of the lamp doesn't change, and I see
Hue Lights Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 5594, in setColorTemperature
File "plugin.py", line 3646, in doColorTemperature
File "plugin.py", line 2074, in updateDeviceState
<type 'exceptions.KeyError'>: key colorTemp not found in dict


in the log file.

Have I made a mistake?
-- Paul --

Posted on
Tue Jan 13, 2015 12:39 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Setting hue colour temperature.

Hi Paul.

Sorry for the delay in getting back to you.

The reason you're not seeing any changes and are seeting an error is because the Bloom (and all LivingColors devices) don't support the color temperature settings. You'll notice that even in the Hue app on your iOS or Android device, it won't allow you to set a color temperature for the Bloom like it does for standard Hue bulbs. In the Hue Lights plugin, you can only use the HSB and RGB color changing actions for any LivingColors devices such as the Bloom. I need to do better error checking in the plugin for instances such as yours when attempting to use an action that's not compatible with a particular device. Perhaps that will be addressed in the next plugin version. For now though, try using the HSB or RGB actions instead of Color Temperature. I realize it's not exactly easy to convert from color temperature to HSB or RGB. It'll probably take some experimentation. You might try using the Hue app on your iOS device to set the Bloom to your desired color then use Hue Lights in Indigo to save a Preset using the Bloom's settings. You could then either display the preset settings in the log (Plugins -> Hue Lights -> Display Preset in Log) and use those settings in the script, or use an action to apply the Preset to the Bloom.

Posted on
Sat Jan 17, 2015 3:44 pm
forestfield offline
Posts: 83
Joined: Dec 29, 2014
Location: West Sussex

Re: Setting hue colour temperature.

Hello Sheldon,
Similar apologies for the delay in replying... customers eh!

I realised (via acquiring a hue bulb) that set setCT does work - and also discovered the same day the 'hidden' extra status fields in the control/panel. I changed my code to do

if plug.isEnabled():
if 'colorTemp' in dev.status:
plug.executeAction("setCT", indigo.devices["Other Bloom Lamp"].id, props={"brightness":60, "temperature":2800, "rate":0.0})

which achieves exactly what I want. It is nice to get the confirmation of the problem though!

From the api point of view I think throwing an exception here is reasonable - I'd asked the hue plugin to do something unsupported for that particular bulb, and i got my wrists slapped!

Once again, thanks

-- Paul --

Posted on
Sat Jan 17, 2015 7:15 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Setting hue colour temperature.

Great! Glad to hear you got it working.

Happy automating. :-)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests

cron