Hue Lights - Free Philips Hue Plugin

Posted on
Fri Nov 16, 2012 4:17 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Hue Lights - Free Philips Hue Plugin

Hue Lights 1.8.7

(FREE Indigo plugin for Indigo 7 or later)

Download version 1.8.7 here.

NOTE: If you've upgraded to Indigo 7 from a previous version and are updating the Hue Lights plugin from a previous version as well, you may need to redefine some of your Hue Lights devices in Indigo to take advantage of all the new Indigo native color features. Each time the Hue Lights plugin is loaded (or reloaded) it will attempt to update old devices. However, you may see errors or unexpected behavior in some cases. If so, to redefine a device, double-click it in the Indigo device list. If the device is an Ambiance bulb (no color, just color temperature), change the "Model" menu to the new "Ambiance Lights" model. If the device is a LightStrip Plus light, it is now in the "Hue LightStrips" model list, so select that from the "Model" menu. Click the "Edit Device Settings" button. Make sure your Hue Device is selected, then click "Save" and close the Edit Device window.

(The Indigo Pro 5 and 6 compatible version of Hue Lights, version 1.3.30, can be downloaded here).

Hue Lights is a plugin for Indigo which allows you to control your Philips Hue lights and Friends of Hue lights through the Indigo system. It allows you to perform basic operations like turning bulbs on and off, setting brightness, and setting the default dimming ramp rate. It also keeps the status of each bulb updated in Indigo so Indigo always knows the condition of each bulb even when the bulbs are controlled by the Hue iOS or Android apps. Additionally, Hue Lights enables advanced control of the Philips Hue devices, allowing you to set custom colors (using RGB, HSB, or color temperature), and the ability to turn on or off alerts (blinking) and effects (color loop).

Hue Lights offers the following features:

  • Full Indigo Integration. Use standard Turn On, Turn Off, Set Brightness, Dim By, Brighten By, and Status Request actions in Indigo Pro to control each Philips Hue lighting device.
  • Start or Stop Brightening and Dimming. Use an Indigo action to start brightening or dimming a Hue device, then another action to stop. This can be useful if you want to press a button on a switch or remote to start dimming, then press another button to stop dimming when the light gets to the level you want. It can be even more useful when using the Dimmer Extender plugin to trigger brightening and dimming from INSTEON start brightening/dimming commands (something that can't currently be done with Indigo without a plugin).
  • Set Ramp Rates. Each Hue Lights action allows you to specify how quickly the light should change from it's current state to the settings you're specifying in the Indigo action using a "Ramp Rate" or transition time.
  • Set Colors. Use Indigo actions to set each Hue device to any color. There are 4 ways to set color. RGB levels (specify red, green, and blue levels similar to graphics editing software), HSB values (specify hue, saturation, and brightness similar to graphics editing software), and Color Temperature (set the white point of a bulb based on a Hue preset or your own color temperature, similar to digital camera white balance settings*). For advanced users, you can also specify the "xyY" chromaticity values. Each action can have a custom ramp rate (transition time) associated with it.
  • Use Virtual Dimmer Devices to Control Hue Device Settings. Use the Hue Device Attribute Controller device included with the Hue Lights plugin to control any aspect** of an existing Hue device, such as color saturation, hue, RGB level, or color temperature. These virtual dimmer devices can be especially useful when accessed from the Indigo Touch iOS app because they appear just like any other dimmer device within Indigo Touch. No need to create a control page or use the Hue app to adjust a device's hue or saturation.
  • Turn On and Off Alerts. You can turn on a short or long alert (1 blink for short, 15 blinks for long) for each device, and turn off the alert, also using Indigo actions.
  • Turn On and Off Effects. You can turn on Hue built-in special effects (currently, Hue only offers 1 effect: "color loop").
  • Save and Recall Your Own Presets. So, you've got your Hue bulb over the table set to just the right color, but now you want your LightStrips and LivingColors Bloom in the room to change to the same color. Either from the Plugins menu, or from within an Indigo action, you can save the current settings of your Hue bulb to one of 10 Presets then (in a separate menu selection/action) apply those settings to any other Hue device. From the Plugins menu, you can also print out the saved settings in each Preset to the Indigo log for reference or verification.
  • Extended Device Status Information. Each Hue device in Indigo also maintains all the status information provided by the Hue hub, including current hue and saturation levels, red, green, and blue levels, CIE 1931 xy chromaticity values, color temperature, color rendering mode, alert mode, effect mode, and whether the device is reachable by the hub. All this information can be viewed in the Mac OS X Indigo client (Indigo 6 beta 9 or newer), or on an Indigo control page you create with standard Indigo device state fields.
  • Hue Scene Recall Support. Hue scenes stored on the Hue hub are accessible from within Indigo and can be recalled using an Indigo action.
  • Motion Sensor Support. The Hue Motion Sensor is fully supported, including support for the motion, temperature and luminance sensors that are part of the Hue Motion Sensor.
  • Hue Tap and Hue Dimmer Switch Support. The Hue Tap and Hue Dimmer Switch are fully supported. They appear as sensors with various button states that can be used to trigger other Indigo actions.
  • Support for Multiple Hue Bridges If you have a large number of devices or a geographically large installation that requires multiple Hue bridges, the Hue Lights plugin can work with all of them.

Installation

Download the Hue Lights zip file (link above) to the computer running the Indigo server. If the file is not already unzipped, double-click the .zip file to unzip it. Double-click the Hue Lights.indigoPlugin file. The Indigo client will open and prompt to install the plugin. Click the option to install and enable the plugin.

Usage

Pairing the Hue Lights Plugin with Your Hue Hub

After installing the Hue Lights plugin for the first time, or if you open the Configuration dialog by going to the "Plugins" then "Hue Lights" then "Configure..." menu items in the Indigo Pro application, you'll be prompted to configure the plugin.

  1. Enter the IP address of your Hue hub. The IP address can be obtained by most consumer routers in their administrative interface. It can also be obtained from the http://www.meethue.com web site if you have registered your hub with that site.
  2. Press the center button on your Hue hub.
  3. Within 30 seconds of pressing the center button on the Hue hub, click the "Pair Now" button in the configuration window. The Hue Lights plugin will first validate the IP address to make sure it's associated with a Hue hub device, then it will pair with the hub. You can now control all the lights registered with your hub.
  4. Click "Save" to start creating devices.

Creating a Hue Bulb Device

There are 5 device types available once the Hue Lights plugin is installed. The first device is the "Hue Bulb" device. This is just what it sounds like, an Indigo device that represents one of your Philips Hue bulbs. There's also a "LightStrips" device, a "LivingColors Bloom" device, and a "LivingWhites (Experimental)" device. Use these to add Philips LED LightStrips, Philips Bloom devices, and Philips LIvingWhites devices, respectively. Other LivingColors devices should also work with the LivingColors Bloom device type. LivingWhites support is experimental for now. You can create an Indigo device for each bulb, LightStrip, LivingColors, and LivingWhites device connected to your Hue hub. The 5th device type is a "Hue Device Attribute Controller". This is a virtual dimmer which can be assigned to control any color attribute of an existing Hue Lights plugin device (as long as that device supports color). Hue Device Attribute Controllers are especially useful for quickly changing color attributes like hue or saturation, especially from Indigo Touch.

NOTE: Use these steps to create LightStrips, LivingColors Bloom, and LivingWhites devices as well.

  1. Create a new Indigo device (click "New..." in the Devices window). Select the "Hue LIghts" plugin as the device Type. Select "Hue Color/Ambiance" (or "Ambiance Lights", "Hue LightStrips", "Color Lights", "LivingWhites", or "Hue Group") as the device type.
  2. A "Configure Hue Color/Ambiance" (or similar) dialog will appear. Select the Hue Device you want to control. Enter an optional Default Brightness and optional "Ramp Rate" (transition time between brightness changes or color changes for color devices) and click "Save." If you don't see all your Hue devices in the list. Click "Cancel" and go to the "Plugins" menu, select "Hue Lights," then "Rebuild Hue Device List," then click the "Edit Device Settings" button in the "Edit Device" window. Select your device and click "Save." Done!

Use standard Indigo actions and controls to turn on and off the Hue device or to set the brightness. With Indigo 7 or newer, you can also use standard actions to change RGB or color temperature settings for Hue devices that support those features. To change colors using Hue Lights specific actions...

  1. Create a new trigger and select the "Actions" tab (or create a new Action Group).
  2. With Indigo 7, select "Device Actions" then "Hue Lights Controls" then the action that you'd like to execute from the sub-menu for the action type. In Indigo 6, select "Device Controls" then "Hue Lights Controls," then the action that you'd like to execute from that sub-menu. If you're still on Indigo 5, select "Plugin" for the action type, then select the "Action" from the menu beneath it.
  3. Select the existing Hue Lights device from the "Device" menu.
  4. If the Configure dialog doesn't automatically appear, click "Edit Action Settings." Each action settings dialog window has basic instructions on the meaning of each filed. Fill out the required information and click the "Save" button. Click "OK" on the trigger or action group to close it.

Creating a Hue Device Attribute Controller

  1. Create a new Indigo device (click "New..." in the Devices window). Select the "Hue LIghts" plugin as the device Type. Select "Hue Device Attribute Controller" as the device type.
  2. A "Configure Hue Device Attribute Controller" dialog will appear. Select the "Hue Color/Ambiance" Indigo device you want to control.
  3. Select the color "Attribute to Control".
  4. Optionally enter a default "Ramp Rate" (transition time between color changes).
  5. Optionally enter a "Default On Level" between 1 and 100 percent. This can be useful if you want to quickly set a Hue device's color to, say, magenta by simply sending an "on" command to the Hue Bulb Attribute Controller virtual device.
  6. Click "Save" then give your device a name before closing the Create New Device window.

You can now adjust the Hue Device Attribute Controller to change the color attributes of your Hue device.

Saving a Preset

  1. Click the Plugins menu, go to Hue Lights and select Save Preset.
  2. Follow the instructions below the fields in the Save Preset dialog that appears and click the Execute button.

You can also save a preset using an action within a trigger, action group, schedule, or control page.

Recalling a Preset

  1. Click the Plugins menu, go to Hue Lights and select Recall Preset.
  2. Follow the instructions below the fields in the Recall Preset dialog that appears and click the Execute button.

You can also recall a preset using an action within a trigger, action group, schedule, or control page.

Display a Preset's Data in the Indigo Log

This is useful if you'd like to know what device states are stored in a Hue Lights Preset before applying it to a Hue device or using it in an action.

  1. Click the Plugins menu, go to Hue Lights and select Display Preset in Log.
  2. Follow the instructions below the fields in the Recall Preset dialog that appears and click the Execute button.

Scripting Examples

Hue Lights (like most Indigo plugins) supports embedded scripts within Indigo actions. In addition to the standard device control methods such as indigo.device.turnOn("Device Name"), turnOff(), and toggle(), Hue Lights also supports Hue-sepcific actions. Below are some examples of how to execute Hue Lights actions from an embedded script within Indigo.

Set brightness of "Master Bed Dresser Lamp" to 50 percent at a ramp rate of 6.5 seconds.
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("setBrightness", indigo.devices["Master Bed Dresser Lamp"].id, props={"brightness":50, "rate":6.5})

Immediately set the hue to 290 degrees, saturation to 100% and brightness to 75% for the "Dining Room Light".
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("setHSB", indigo.devices["Dining Room Light"].id, props={"hue":290, "saturation":100, "brightness":76, "rate":0})

Set the "Nightstand Lamp" brightness to 60% and color temperature to 2800K.
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("setCT", indigo.devices["Nightstand Lamp"].id, props={"brightness":60, "temperature":2800})

Indigo 7 ONLY: Set the "Nightstand Lamp" color temperature to 2800K. Note the 5 values before the color temperature of 2800. These are the Red, Green, Blue, White, and White2 levels which are required by the setColorLevels function even when only changing color temperature. Use 100 for R, G, B and W which lets the Hue Lights plugin know you intend to only change color temperature. The White 2 value (zero) is just there as a place holder. The value is ignored.
Code: Select all
indigo.dimmer.setColorLevels(indigo.devices["Nightstand Lamp"], 100, 100, 100, 100, 0, 2800)

Set the "Nightstand Lamp" color temperature to the "Reading" preset.
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("setCT", indigo.devices["Nightstand Lamp"].id, props={"preset":"reading"})

Set the red, green, and blue color values of the "Table Lamp" to 245, 18, and 150 (respectively).
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("setRGB", indigo.devices["Table Lamp"].id, props={"red":245, "green":18, "blue":150})

Indigo 7 ONLY: Set the red, green, and blue color values of the "Table Lamp" to 96% red, 7% green, and 59% blue (a deep magenta color)
Code: Select all
indigo.dimmer.setColorLevels(indigo.devices["Table Lamp"], 96, 7, 59)

Set the x, y, and Y chromaticity and luminosity values of the "Bar Ambient Lights" to 0.5145, 0.3978, and 0.75 (respectively). (x, y and Y define the color and brightness in the CIE 1931 xyY color space). Note the capitalized "Y" in the 3rd property "xyy_Y". All property names are case sensitive.
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("setXYY", indigo.devices["Bar Ambient Lights"].id, props={"xyy_x":0.5145, "xyy_y":0.3978, "xyy_Y":0.75})

Enable the long alert for the "Hallway Light".
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("longAlert", indigo.devices["Hallway Light"].id)

Send a single alert pulse to the "Entryway Light".
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("alertOnce", indigo.devices["Entryway Light"].id)

Stop all active alerts on the "Hallway Light".
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("stopAlert", indigo.devices["Hallway Light"].id)

Enable the color loop effect on the "Master Bed Dresser Lamp".
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("effect", indigo.devices["Master Bed Dresser Lamp"].id, props={"effect":"colorloop"})

Disable the color loop effect on the "Master Bed Dresser Lamp".
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("effect", indigo.devices["Master Bed Dresser Lamp"].id, props={"effect":"none"})

Start or stop brightening the "Table Lamp".
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("startStopBrightening", indigo.devices["Table Lamp"].id)

Start or stop dimming the "Table Lamp".
Code: Select all
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plug.isEnabled():
   plug.executeAction("startStopDimming", indigo.devices["Table Lamp"].id)

When executing actions through Python scripts, the "rate" property is always optional. If a rate isn't specified, the device's default ramp rate (transition time) will be used (or 0.5 seconds will be used if no default is set). With the "setCT" color temperature action, if you include the "preset" property, the specified preset will override any temperature and brightness specified. If a "preset" property is not specified, the "temperature" and "brightness" properties are required. Possible preset values are "concentrate", "relax", "energize", and "reading". These presets are based on the default presets included in the Hue app for iOS and control both brightness and color temperature when selected.

Known Issues

  • Ramp Rate: When turning off a Hue device on older Hue hubs, Ramp Rates higher than 60 seconds result in the bulb fading at the expected rate but suddenly turning off about 60 seconds after the fade-out begins. This appears to be a bug in how the Hue hub handles slow transitions to "off" with Hue bulbs. This does not appear to affect LightStrips or Bloom devices. Currently, the only workaround is to set the brightness to 1 percent using the desired Ramp Rate, then create a second action in Indigo to turn off the Hue Bulb that's delayed by the same amount of time as the Ramp Rate.
  • Effect: If the "Color Loop" effect is enabled on a bulb using Indigo but then stopped by unplugging and plugging back in the bulb, the "effect" state of the device may not update properly to reflect the fact that the Color Loop effect is no longer active on the bulb. This is because the Hue hub does not always update this state internally when the bulb is unreachable.
  • RGB States: Because Philips Hue devices (especially the bulbs) are not true RGB light emitters (i.e. they don't have a true red, green, and blue LED), it's not possible for them to output every color represented by the RGB values that can be specified. Thus, while you can tell a Hue Color/Ambiance bulb to display a RGB color of 0 red, 255 green, and 255 blue, the Hue Bulb will only show the closest color it can display to the requested color.
  • Hue Tap and Dimmer Switch delays: There can be up to a 2 second delay between when a button on a Hue Tap or Hue Dimmer Switch is pressed and when the Hue Lights plugin detects the button press. This is because the only way the Hue Lights plugin can detect button presses is by constantly asking the Hue bridge for updates, and the plugin can only do that as often as every 2 seconds.
  • Multiple Hue Bridges: The Hue Lights plugin supports only 1 Hue bridge. However, it's possible to duplicate the Hue Lights plugin, make some edits to that duplicate, and use it to support a second bridge. Details on that process can be found here.

Changes from version 1.8.0

  • Fixed a bug where pre-version 1.8 Hue bridge preferences weren't migrated correctly to the new 1.8 version.
  • Fixed a bug that caused the plugin to crash when using the XYY color setting action.
  • Added option to switch logging on/off for events and light changes such as "Hue Lights received 'dimmer dining' ON button press with short release" and "Updated 'dining room ceiling' on to 11".
  • Fixed an error in doColorTemperature where not all arguments were converted during string formatting.
  • Fixed "This Hue connected device is already being controlled by..." error.
  • Fixed "unicode" object has no attribute "formate".

Special thanks to forum user kw123 for providing the code to support these new features.

Note that this plugin is in no way associated with the similarly named "Hue Lights" iOS app by LapApps, LLC.

Posted on
Mon Dec 24, 2012 5:16 pm
arobase offline
Posts: 34
Joined: Oct 06, 2011

Re: Hue Lights - Free Philips Hue Plugin

This plugin is damn close to perfect! Thank you so much. Makes the HUE bulbs much more useful. Any donation I can make for your efforts?

Great work!

:P

Posted on
Mon Dec 24, 2012 6:10 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Hue Lights - Free Philips Hue Plugin

arobase wrote:
This plugin is damn close to perfect! Thank you so much. Makes the HUE bulbs much more useful. Any donation I can make for your efforts?

Great work!

:P

Thanks for the compliments! I'm glad the plugin is working well for you. As for donations, I certainly wouldn't ask for or expect any. If you feel compelled to donate, you're welcome to do so for any amount you wish via PayPal to nathan AT nathansheldon.com. But again, please don't feel the need to donate as I'm happy just to have helped people make cool things happen with their technology. :D

Posted on
Sun Dec 30, 2012 11:27 pm
keifer1 offline
Posts: 87
Joined: Oct 21, 2012

Re: Hue Lights - Free Philips Hue Plugin

Upgraded to 95 and started getting this error this evening, any ideas. Love the plugin.

Hue Lights Loaded 9 bulb(s)
Hue Lights Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 234, in runConcurrentThread
File "plugin.py", line 775, in getBulbStatus
<type 'exceptions.ZeroDivisionError'>: float division

Hue Lights Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


Thankx as always.

Computer Keith
Mt Pleasant SC - Charleston
Indi-Go -Go-Go

Posted on
Mon Dec 31, 2012 4:09 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Hue Lights - Free Philips Hue Plugin

Hi. Glad you like the plugin.

Though that error is not likely due to the changes I made in version 0.9.5, it is certainly a bug. Version 0.9.6 is now available which should fix that problem.

Posted on
Mon Dec 31, 2012 11:25 am
gg2 offline
Posts: 29
Joined: Apr 16, 2008

Re: Hue Lights - Free Philips Hue Plugin

Great plugin - works really well.

Is it possible to use your plugin to control the lights in an Applescript?

Rick

Posted on
Mon Dec 31, 2012 12:02 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Hue Lights - Free Philips Hue Plugin

gg2 wrote:
Great plugin - works really well.

Is it possible to use your plugin to control the lights in an Applescript?

Rick

Thanks!

Because each Hue bulb appears as a standard dimmer device in Indigo (with a number of extended features), you can use standard AppleScript terms to turn bulbs on and off as well as set their brightness. However, because AppleScript in Indigo is not extensible, it's not possible to controle the extended features (color, ramp rate, etc) with AppleScript.

Posted on
Mon Dec 31, 2012 12:36 pm
gg2 offline
Posts: 29
Joined: Apr 16, 2008

Re: Hue Lights - Free Philips Hue Plugin

I wanted to use a couple of buttons on a KPL to alter the color of all the Philips bulbs by simply rotating the hue value (in H,S,B) in short steps each time a button action occurs.

If I understand correctly, in order to do this will I need to use a Python script rather than an Applescript (since the latter cannot access the advanced settings)?

Have you written any Python demos of this type of scripting interaction?

Posted on
Mon Dec 31, 2012 2:23 pm
gg2 offline
Posts: 29
Joined: Apr 16, 2008

Re: Hue Lights - Free Philips Hue Plugin

Nathan, I'm completely new to Python. I got this far (see below) using generic examples on pa website, but can't figure out how to read or modify the hue property in python. Is there some help text I should be reading, or can you make a suggestion for how I can achieve this? Many thanks, Rick


Code: Select all
indigo.server.log("Green Room - Test")

# ALTER THE BRIGHTNESS VALUE OF LAMP2
# Simple test to make sure all is connected
indigo.device.turnOff("Green Room - Lamp 2")
# THIS WORKS!!

# NOW ATTEMPT TO ALTER THE HUE VALUE OF LAMP1

# Technique for cycling a hue value variable
# Common variable for Hue already created with id 896503384
grh=float(indigo.variables[896503384].value) ## current hue
# Increment by 0.1 modulo 1
indigo.variable.updateValue(896503384, value=str((grh+0.1)%1))
# How do I control the rate at which this routine is triggered again - e.g. if it is linked to "Brighten" action - may have to tune empirically?

plugin = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
if plugin.isEnabled():
   indigo.server.log("Plugin is active")
   # Lamp 1 is id 870956388
   #
   # Want to change the hue value but don't know how
   plugin.executeAction("setHSB", deviceId=870956388 …??? what goes here…??? )
   #

   # How do I read the hue value for a given device?

indigo.server.log("Green Room - End Test")

Posted on
Mon Dec 31, 2012 2:56 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Hue Lights - Free Philips Hue Plugin

Hey Rick.

Yes, you'd need to use Python to accomplish what you're wanting. No, I haven't yet published any Python scripts to execute actions provided by the plugin. Below is some code that will increase the current hue value (in degrees) of a Hue bulb by 10 degrees. Note, however, that while testing this, I found another bug in the Hue Lights plugin and had to make a small change to the code which is now fixed in version 0.9.7 (link in original post from this thread).

Code: Select all
# Increase Hue bulb's hue by 10 degrees.
plug = indigo.server.getPlugin("com.nathansheldon.indigoplugin.HueLights")
dev = indigo.devices['(your lamp name in Indigo)']
if plug.isEnabled():
   hue = dev.states['hue']
   if (hue + 10) <= 350:
      plug.executeAction("setHSB", dev.id, props={'brightness':100, 'hue':hue + 10, 'saturation':100, 'rate':0})
   else:
      plug.executeAction("setHSB", dev.id, props={'brightness':100, 'hue':0, 'saturation':100, 'rate':0})

I believe the properties are pretty self-explanatory, but just to be thorough, "brightness" is the brightness of the bulb from 0 (off) to 100 percent (fully on). The "hue" property is the color of the bulb in degrees (0 to 360) where 0 (and 360) represent complete red. Note that the Hue bulbs aren't strait RGB bulbs and thus can't cover the full color gamut. For instance, you really can't get a true yellow or cyan color from these things, but you can get close. The "saturation" value is the percent of color saturation, 0 being none (white) and 100 being completely saturated at the hue selected. The "rate" value is the speed at which the transition from the bulb's current state to the new state takes place in seconds. The resolution of the "rate" parameter is 0.1 seconds, so you can specify a rate of, say, 10.8 seconds as the transition time. A rate of 0 (zero, as shown above) makes the change instantly.

Posted on
Tue Jan 01, 2013 3:36 pm
gg2 offline
Posts: 29
Joined: Apr 16, 2008

Re: Hue Lights - Free Philips Hue Plugin

Thank you so much - all is up and running. Happy New Year.

btw if you have an iOS device look at the new "hue disco" app - https://itunes.apple.com/us/app/hue-dis ... 58186?mt=8 . They are very entertaining.

Posted on
Tue Jan 01, 2013 7:05 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Hue Lights - Free Philips Hue Plugin

Thanks for the link. Wish I had that for New Year's eve!

Carl

Posted on
Tue Jan 01, 2013 9:54 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Hue Lights - Free Philips Hue Plugin

gg2 wrote:
Thank you so much - all is up and running. Happy New Year.

btw if you have an iOS device look at the new "hue disco" app - https://itunes.apple.com/us/app/hue-dis ... 58186?mt=8 . They are very entertaining.

Excellent! Thanks for sharing the app. It's fun to play with. :-)

Posted on
Wed Jan 02, 2013 12:16 am
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Hue Lights - Free Philips Hue Plugin

Hmm, that app giving you any ideas Nathan?

Carl

Posted on
Wed Jan 02, 2013 3:03 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Hue Lights - Free Philips Hue Plugin

Ha. No. Not really. You have something in mind Carl?

Who is online

Users browsing this forum: No registered users and 0 guests