control wireless Philips Hue lights

Philips Hue smart lights are intended to be used in homes / studios. The devices come in many varieties - individual lamps, outdoor lights, LED strip lights, etc. These are synchronized by communicating with an additional device called a Bridge. A single Bridge can control up to 50 lights. There are many stand alone applications to drive Hue Lights, and this repo aims to provide some additional control by exposing those controls through TouchDesigner. In order to do this, we use the phue library. There is some additional set-up required in order to use an external library, though hopefully much of this is now streamlined.

This TOX provides global control for all lights, or individual control for single lights.

clone or download from github
github.com/raganmd/touchdesigner-hueControl

2 Likes

Downloaded and everything is running smoothly, thanks for this!!

1 Like

So glad it’s still working out of the box :slight_smile:

+1 confirming that everything is running out of the box. Great work Matt!

I have a questions though. I have tried to modify the example you have provided so that I could change the color and brightness of the lights immediately, without having to press the “Update All” button.
By changing immediately I mean that I would love to see the color and brightness of the lights change as I move the All Color and the All Brightness settings, similarly to what happens when using the Philips Hue app.

I have tried with a simple script to pulse the Update All button when the colors and brightness were changed, but performance dropped to 4 FPS.

I have also tried to reverse engineer the hueControlEXT script. It seems that the Set_all_lights() function should be the one that I should be calling when a change happens, but I am having trouble understanding what’s happening in the script.

I am not sure that I am heading in the right direction, or what to change to achieve the result that I have in mind; any suggestions on how to approach this ?

PS: to provide a better example of what I am trying to achieve, for example I would like an LFO chop to control the lights brightness, and see that change happening smoothly as the LFO drives that parameter back and forth.

An interesting piece of this library is that some of the lerp happening in the lighting change is happening on the bridge - not in the updates. So, for example, that Transtime parameter is intended to be used for setting the amount of time from the current color to the color sent to the bridge.

For changes over time, I typically use a timer that sends commands to change color at a fixed interval, and that changes the transition time to be close to that same interval. For example, change the lights over the course of 5 seconds, with a timer that sends a new command every 5.5 seconds. The idea here is that commands are discrete instructions rather than a continuous flow of information.

I think this is more of a limitation in the phue library - since part of the commands to control initiates a handshake between Touch and the bridge, which can cause issues as they stack. I haven’t looked at the library for a bit… you could look at the hue-py library as an alternative (hue_api.lights API documentation), though you’d need to write your own extension for handling all of the controls and custom pars as the current extension wouldn’t work out of the box with this other library.

Gotcha.
Thank you Matt for taking the time to respond & explain.

I was aware of the philips hue lights update timing limitation (every 1/10 of a second, one light at the time, not ideal for sudden changes if dealing with several lights) but didn’t think about the operation or limitations involved with the phue library.

In any case, great work Matt, the tox works great, and thanks for sharing with the community!

Hi!

Thank you so much for this! I’m creating an interactive light installation and using Hue bulbs with TD has been great so far.

I’m trying to scale up in the number of lights I’m using. Apparently the Bridge can control up to 50 bulbs (well). I’ve tried to add an additional Bridge to control more bulbs.

In TD, I’m able to add the additional Bridge and I can control the lights associated with each Bridge. However, TD won’t let me control both sets of lights simultaneously. It requires me to push the centre button on each Bridge before I can use those sets of lights.

Is there anyway around this that you know of?

Thanks!

Hi @meghancheng - I haven’t tried controlling multiple bridges before, but that does sound very interesting. I’d probably approach this by adding 2 of the TouchDesigner Hue Control modules to your project, and then setting each one to connect to a different bridge. That seems like it should work, though without testing I couldn’t tell you for sure.

Are you comfortable using python? This component is built on the phue library, and there’s lots more you can extend the component to do if your comfortable with a little more complex python dev.

Hi Matthew,

Thanks so much! I’m definitely not a python expert but will try playing around with it.