Jump to content
C4 Forums | Control4

Best way to trigger Philips Hue Lighting Scenes


Recommended Posts

The HUE App has the ability to trigger various color scenes ("Spring Blossom", "Relax", etc). Each of these scenes has a distinct (via the C4 Hue Driver) set of variables:

RELAX (Via LUA Console)

(Philips Hue system value) X:     0.5016
(Philips Hue system value) Y:     0.4151
(Philips Hue system value) Brightness:    144

Spring Blossom (via LUA Console)

(Philips Hue system value) X:     0.4359
(Philips Hue system value) Y:     0.2811
(Philips Hue system value) Brightness:    213

... and so on. 

What's the best way to Program these scenes into Control4? 

Here's what I've tried:

  • Using Driver Presets. The Hue Color Group has Actions ("Store Preset 1", "Store Preset 2"). Then using a Macro, I can call "Device Specific Command | Recall Preset | 1" and so forth. Unfortunately, this doesn't seem to work at all. 
  • Using Advanced Lighting Scenes. I create a scene ("Spring Blossom"), add in the load, and then have to set 4 values (RGB+Brightness). This is different from the X/Y/Brightness settings retrieved via the LUA Console. Doing the "Get Light Levels" doesn't seem to return the right values, as if I change the values via Hue, the values fetched here don't update, so I'm skeptical. I have seen some converters on the web, but it seems generally problematic. 
  • Macros. I've created a Macro for each scene ("Spring Blossom"). That Macro looks like this:

image.thumb.png.3c0085dee5bc9a7ef85dbc9be2a72a69.png

The two settings (Brightness / Set Color) seem to fight with each other resulting in weird lighting results. Do I need delays in here?

What's the best way to do this? I would love an exact match with the default Hue scenes. 

The end result of this is that I've keypad buttons bound to a "Cycle Philips Hue Scenes" macro, and each time the button is pressed it cycles to the next scene. 

 

Link to comment
Share on other sites


The Hue bridge doesn't work that way unfortunately.  They don't have direct scene calls in their API apparently.  In order to re-create the Hue scenes, you must set each bulb to the color you want.  The Group driver will only tell every bulb in the group to change to a single color.  That's why you're getting funky results.  Use the Hue app to select your scene, then use C4 to read each bulbs info and write it down.  Then when you program you put all the info in for what you want each bulb to do.  Prepare for the popcorn lighting effect.

 

Link to comment
Share on other sites

I've got all the "per bulb" settings for each scene. That's what this is:

(Philips Hue system value) X:     0.5016
(Philips Hue system value) Y:     0.4151
(Philips Hue system value) Brightness:    144

The *problem* is if I set that same data back to the group, the results are all over the map. 

I'm using the Driver's "Set XY Color" control point, and that's not doing what it should. Wondering if there's a better way. 

Link to comment
Share on other sites

so just

9 minutes ago, ChrisM said:

The "Spring Blossom" scene reports, via LUA, these three values:


(Philips Hue system value) X:     0.4359
(Philips Hue system value) Y:     0.2811
(Philips Hue system value) Brightness:    213

Setting them doesn't work as it it should (see my original post). 

So just before you fetched that you set the bulb color from the Hue mobile app, correct? This is an important test.

Link to comment
Share on other sites

Hah. Yes. I did that for each Hue scene, so I would know what they are. 

Then I created a Macro for each scent "Set MBR Hue to Spring Blossom" and so forth. That macro sets the values I discovered through the LUA Console. 

The problem is, the results are more-or-less random. 

I'm trying to figure out what people are doing, and what's most effective. 

Link to comment
Share on other sites

1 hour ago, ChrisM said:

Hah. Yes. I did that for each Hue scene, so I would know what they are. 

Then I created a Macro for each scent "Set MBR Hue to Spring Blossom" and so forth. That macro sets the values I discovered through the LUA Console. 

The problem is, the results are more-or-less random. 

I'm trying to figure out what people are doing, and what's most effective. 

Ok, just interesting they don't include saturation.

What does random mean? The color is wrong for the bulb? Is it really wrong like its green instead of one of the pinks?

Curious why you are setting the brightness the way you are.

Link to comment
Share on other sites

@Pounce By Random, I mean I'll see the colors set, then the brightness will adjust and the color settings are lost. This behavior seems to continue even if/when I remove the brightness setting from the API call. 

I can keep debugging this (I'm sure I'll get it), but was just wondering more if there is a standard way people are doing this. It doesn't sound like there is... 

Link to comment
Share on other sites

For anyone following along at home, I've gotten this working. Here's what I did:

  1. Created a Macro for each Hue Scene. ("MBR Hue Scene - Relax", "MBR Hue Scene - Spring Blossom") etc. 
  2. Created a User Variable "MBRHueScene"
  3. Created a Macro to Cycle Scenes. 
  4. Bound the Macro to a Button Press Event. 

Each Scene looks (more-or-less) exactly like this: 

image.thumb.png.beb24cd19a6aea75aaa9771767267c0f.png

 

The "Cycle" Scene couldn't be simpler, and looks like this:

image.thumb.png.b13e827587d0657056873f41ea8cd5ee.png

The problems I was having were twofold:

  1. The interaction of ramp rates with colors and brightness settings is very visually displeasing. Setting the ramp rates to zero helped quite a bit. 
  2. Add "Stop" commands into my macro. Given what I do for a living, this is pretty funny, but - hey - it's a weird programming model with drag/drop from the 90s. 
Link to comment
Share on other sites

  • 1 year later...
On 7/24/2020 at 7:19 AM, lippavisual said:

The Hue bridge doesn't work that way unfortunately.  They don't have direct scene calls in their API apparently.  In order to re-create the Hue scenes, you must set each bulb to the color you want.  The Group driver will only tell every bulb in the group to change to a single color.  That's why you're getting funky results.  Use the Hue app to select your scene, then use C4 to read each bulbs info and write it down.  Then when you program you put all the info in for what you want each bulb to do.  Prepare for the popcorn lighting effect.

 

Not true. The Hue API does have a single command to set a scene with a group of bulbs. That’s how it works when using the hue app. You can also send a direct HTTP PUT request to the hub via Postman or a web browser to accomplish this. Have a read through the Hue API and try it out on your own web browser with the built in REST API interface of the Hue bridge: Get Started - Philips Hue Developer Program (meethue.com)

This is another example of the need to update or just plain rewrite the C4 hue driver. One HTTP GET request gives a complete JSON database of all the scenes (and their sceneIDs) set up in the Hue hub that could be parsed and saved by the driver for later recall in Composer with perfect results just like from the Hue app. Simple as pie if the driver was improved to do this. 

It is tragic reading through all the Hue related posts here and seeing all the time spent figuring out subpar workarounds when it could all be avoided and result in a better user experience with a simple rewrite of the Hue driver. Even worse, there is no way to make the workaround code easily copied and pasted into Composer for other similar applications. Hence the need to update the driver software. I’m happy to work with C4 or anyone else who is interested in seeing a great implementation of Hue on C4.

Link to comment
Share on other sites

3 hours ago, lippavisual said:

What’s not true?  The Hue driver is crap.

Im well aware of how Hue works and their API.

 

What’s not true is what the quoted text says: that the hue bridge is not capable of direct scene calls via an API request. The Hue API does have that capability as I mentioned, and it works great. The issue is not the Hue bridge or the API but rather the C4 driver.
It would be a great benefit for the whole C4 community to have a driver that works well. Customers would benefit from a great user experience with Hue, and dealers would avoid hours of wasted time and weeks of frustration only to end up with a subpar outcome for their customers. 

Link to comment
Share on other sites

10 minutes ago, LollerAgent said:

I'm sure people would pay for a more capable driver (oh, hey there @alanchow!).  It would be nice if C4 just fixed the native driver though.

I would pay for a good driver, and if there were functionality like circadian scheduling even better. I agree it would be great if C4 would just fix the driver. Since the driver is the better part of 9 years old however, it seems like they have little interest in doing that. What about an open source project for a C4 Hue driver? If the C4 one is free anyway then why not share the source code for the community to improve and maintain?

Link to comment
Share on other sites

11 minutes ago, JEC said:

Yes I am using the Janus circadian driver right now. I am planning to post separately on my lighting set up and will include more detail on that driver's functionality. In short it works well, but is somewhat hindered by the poor quality of the C4 Hue driver.

Link to comment
Share on other sites

5 hours ago, ajmccaus said:

I would pay for a good driver, and if there were functionality like circadian scheduling even better. I agree it would be great if C4 would just fix the driver. Since the driver is the better part of 9 years old however, it seems like they have little interest in doing that. What about an open source project for a C4 Hue driver? If the C4 one is free anyway then why not share the source code for the community to improve and maintain?

Try this one https://www.unilogiq.com/en/control4-drivers

Let me know via PM if you would like to use the existing Hue scenes and we will provide you a demo.

All the best,

Bogdan

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.