Philips Hue Plugin

Here’s version 0.01 of the Philips Hue plugin (and my first ever plugin).

After linking the plugin to your Philips Hue hub, Vera will create a Dimmer, and Color Preset device for each of the Hue bulbs, allowing you to set brightness or turn the lights off. The Dimmer devices are standard ones so they will show up in any Vera app that you might be using on your smartphone.

You may have to manually enter the IP address of your Hue hub, and this might change after the hub or your router restarts. You’ll want to consult your router’s DHCP table to obtain the hub’s IP address and MAC address, then add the IP and MAC address to the router’s list of static IP addresses in the DHCP settings.

Installing: (install this app from the MiOS App Store)

Setting up:

  1. Open the settings for the new Philips Hue Controller device, and go to the Advanced tab

  2. Enter the IP address of your hub into the ip field

  3. Close the settings and Save them

  4. Hit the Reload button of the Vera GUI if Vera doesn’t perform a restart automatically

  5. Open the Philips Hue Controller device again.

  6. Hit the Link button on the Hue hub, then click Establish Link. You should get a message that the device is now linked

  7. Hit Reload again, in the Vera UI, then refresh your browser. There will be a new child device for each of your Hue lamps.

Controlling the colors using Lua:
(204 in these examples is the device ID, use the ID for the “color” device i.e. the one with the 6 preset buttons)

Setting Hue and Saturation:
luup.call_action (“urn:intvelt-com:serviceId:HueColors1”, “SetHueSaturation”, {newHue=40, newSaturation=100}, 204)

Setting Color temperature:
luup.call_action (“urn:intvelt-com:serviceId:HueColors1”, “SetColorTemperature”, {newColorTemperature=40}, 204)

Values for Hue, Saturation and Color Temperature are on a scale from 0 to 100

This info also on: www.intvelt.com/wordpress/philips-hue-plugin/

Great to see this plugin… I am getting my lights now!

Just wondering… Would it be better to keep the current standard dimmer devices and add a new device for each light to set the color, or better to make a single device for each light that handles both brightness and color?

The advantage of an integrated device is that you’ll have less devices cluttering up the UI (obviously). The drawback is that not all mobile Apps support arbitrary devices; having a separate dimmer will at least give basic control over the lamps in those apps.

great work on the plugin! Setup is straightforward and dimming works well (still testing)

[quote=“intveltr, post:3, topic:173293”]Just wondering… Would it be better to keep the current standard dimmer devices and add a new device for each light to set the color, or better to make a single device for each light that handles both brightness and color?
[…][/quote]

personally, I prefer the first option, so that most mobile apps would recognize the Hue bulbs as generic dimmers. a Hue bulb can be considered 2 devices in 1: a dimmer and an RGB LED. Just my .02

Struggling a bit with the color interface. I just discovered that Vera controls can have only 1 slider (seriously…)

Couple of things I can do:

  1. Don’t add anything extra, use the standard dimmer controls, and only allow color changes through Luup calls.
  • advantages: Easy to implement, retain 100% compatibility with mobile apps.
  • disadvantages: Sucks having to provide (guess) the right values to get the desired color. No way to set colors through scenes using the UI (luup only)
  1. Add an all singing all dancing Javascript interface to the control tab
  • advantages: Easy to get the desired color
  • disavantages: No way to set colors through scenes using the UI (luup only). The color controls won’t be shown in the dashboard view (correct?) Plus it’s a lot of work.
  1. Add a simple interface to the control to set / record color presets. The dashboard view would show 6 preset buttons which can be used in scenes, and the control tab would have a few extra buttons to (for example) capture the current color of a lamp and store it as a preset.
  • advantages: Easy to add color to scenes, easy to add support for mobile apps.
  • disadvantages: Limited control over colors (only presets), and the presets have to be stored somehow to survive a Vera reboot. Colors will have to be defined using a separate app, or values must typed in manually in the control tab.

Any other ideas?

Of course all of these can be combined. At the moment I’m leaning towards combining option 1 and 3: leave the standard dimmer device for 100% mobile app compatibility, and add another device (a small 1) to manage preset colors. At some point I could add a Javascript tab to allow easier setting of colors.

I vote for option-3 as a good trade-off between 1 & 2. maybe you can add a customize option, where the user can enter the hue, saturation, etc. values for a custom color. The preset colors is a good idea.

Kick a$$!
I was going to return the Philips set I received as a gift because it didn’t integrate into my Veralite.
Looking forward to integrated color via scene.
LMK if you need help testing.

Wish list:

Link two bulbs together so their dimming can be controlled from a single slider in the iPhone app (vs using a scene)

Make these bulbs work on my existing Zwave dimmer switches. Using these bulbs forces one to migrate to an on/off switch or use no switch at all.

Great job Intveltr, i can’t believe Apple are saying March 2013 for these to be delivered :frowning: But will look forward to trying the plugin around Easter time …

New version with basic color support :slight_smile:

Unzip and upload all 8 files, then restart Vera’s luup engine. If you already had the previous version installed and configured, you’ll automatically get the additional color control devices.

Usage is simple: change a bulb’s color by clicking one of the preset buttons on the control. Program the preset buttons by opening the color device (click the spanner), set the desired color for the bulb using the supplied smartphone app, and store the color by clicking the right “Set preset” button.

You can program color changes into your scenes as well!

Do not use luup calls to the color service to change colors yet, at least not in any application of a permanent nature. It seems there are more color changing lights out there, and I’ll define the preset service uPnP definition into something more generic so different lights can share it.

Shouldn’t be too hard to implement in the controller device; I’ll think about it.

Make these bulbs work on my existing Zwave dimmer switches. Using these bulbs forces one to migrate to an on/off switch or use no switch at all.

Better not use these on a dimmer, you could damage the dimmer or the bulb. I had a few lamps on an on/off switch, but I’ve simply removed those z-wave switches. Vera can control the Hue lights just fine, the only disadvantage is that you can’t associate Z-wave scene controllers or remotes with these lights.

Great - I have the new plugins installed and working. No notification once you click “set”, but it works.

The only problem I’m having is turning off the lights. It seems the two interfaces don’t communicate well.

If I use the iVera iPhone app (which I use all the time) to turn off the Philips lights the controller becomes stuck at the pinwheel and the lights stay on.

If I slide the controller dot to the right then back to the left it will turn off the light.

If I refresh the webpage controller it doesn’t report the correct percentage. Right now one is on and the page says it’s off. If I click “off” on the web page it does actually turn off.

If I use a scene to kill the lights they default on to about 37%. Weird.

All else is beautiful however.

More wish list:

Maybe combine the light’s color, brightness and on/off state into a single button for ease of use and integration into scenes. Say, each of the current 6 settings could be a color/brightness and default to on

Def looking for a setting that will cycle the color through the entire range (maybe just color and no white for any duration). Something that you could set during a party and forget - maybe over a 10 minute period.
That would be a cool tool that Philips surprisingly doesn’t even offer yet.

Hope this helps and please do not feel obligated - I’m happy with just the basic controls at this point! :slight_smile:

Actually, with custom scenes I have got almost everything working correctly.
The only issue now is when switching from scene to scene (blue to green, etc.) sometimes one light will lose all its color settings on the 6 presets. HAve to put them back one by one.

Again, hope the feedback helps.

The attached file should fix the issue with iVera, just upload it and restart. I haven’t noticed the problem with incorrect dim levels when controlling the lights via scenes, but perhaps that is fixed now as well. (Using the On function now explicitly sets the dim level to 100%). Please let me know how this version works. :slight_smile:

I’ll add something to allow the dim level to be (optionally) stored with the colors in a preset.

I’m not sure why a lamp would lose its presets when using scenes. Presets are stored as variables in the devices. When you set the presets, the Vera UI will not update automatically and the device there will be without presets. If you then save the device, the presets will be overwritten with blank values from the UI. This happened to me once when I set presets and then moved the lamp device to a different room.

Ronald,

Will Vera know if the lights are on or off (poll) if set with the ios app?

Im not at home at the moment, but I think that fixed the problem. The slider is VERY responsive now.
Last night I went ahead and set up scenes for red, blue and green - these scenes turn off all the non-Philips lights and allow me to control color changes with one click - pretty sweet.

Great job on this so far!

The plugin is able to poll the Philips lights. You can poll manually, and it should poll every minute if you have polling enabled on your Vera, but it doesn’t automatically poll yet.

Hi Intveltr -

Considering the Phillips Hue looks like it uses the Zigbee Light Link standard - I’d be interested to see/hear if your plugin could control other lights via either the Phillips Bridge/Hub, or any other providers Bridge/Hub?

http://www.zigbee.org/Products/ByStandard/ZigBeeLightLink.aspx

Thoughts ?

The protocol to talk to the hub is specific to the Philips Hue, so the plugin probably won’t talk to other hubs. But I suppose any compatible light that gets added to the Philips hub can be controlled from the plugin