Getting Started with CueServer's Phillips Hue Plugin
In version 3 of CueServer Studio plugins were introduced. One of the most popular (and requested) is the Phillips Hue plugin. While all plugins have documentation that can be found inside the "Information" tab (see below), this guide will go through the process in a step-by-step fashion.
Before you get started, make sure to have the following:
- Phillips Hue Bridge
- Phillips Hue Fixture/Lights
You'll also need to make sure you've set up lights and rooms via the Phillips Hue app, these will be referenced by CueServer to facilitate the lighting control.
If you're looking for the technical details, setup instructions, or methods of a plugin, you can find it in the "Information" tab of the plugin in CueServer Studio.
Adding the Plugin
The first step to set up the plugin is to add it to your show. If you haven't done this yet, you'll likely see a blank plugins column.
To add the Hue plugin, click on the button in the bottom left and in the resulting file-picker window, navigate to the Phillips plugin and click Open.
The file window should open directly to the plugins directory, however, if yours does not you can simply navigate there by going to one of the following locations, depending on your OS:
- OS X/Mac:
Once the plugin appears in the list of plugins within CueServer Studio, click on the Phillips Hue plugin, then at the top of the right-hand side, click on the "Instances" tab.
In this guide, we'll use the word "hue".
Setting Up the Plugin Instance
To set up our instance, we'll need some information from the Hue Bridge.
You can follow manual instructions below to get this information, or as a conveinence, if you'd like we can help you aquire it.
Now that we have an instance, we'll need to set it up with the proper parameters. This is important as it allows us to authenticate the plugin to communicate with the Hue Bridge as well as ensure we're controlling the right one (if multiple exist).
The first step is to head to the URL https://discovery.meethue.com/ in a browser. This will return a JSON object that looks like this:
The key "internalipaddress" in the resulting object is your Hue Bridge's IP. We need to add that to the "IP Address" field of our instance like so:
Once you've done this, hit Apply in the bottom right.
What if my browser only returned
If this is the case, your Hue Bridge isn't on the network or is not properly configured, try checking it's network settings.
if you're in the CueScript console, you'll need to wrap the command in brackets, like so:
[ hue.getUserName() ]
Note: If you named your instance something other than "hue", you'll need to swap out hue for whatever you chose in any JS commands.
If successful, your CueServer system log should now show something similar to this:
That "username" value is the last piece we need to finish setting up our instance. Copy its contents from the log (excluding the quotations) and paste it into the "Bridge User Name" field of your instance. Once you've done so, click Apply in the lower-right.
Using the Plugin (Basics)
Now that you've got your instance up and running, you can begin to take control. It's important to note that rooms and lights must be set up on your Hue system in order to control them via CueServer, you can set them up with the Hue app.
Turn on a Light:
hue.setLightOn("Lamp 1", true)
Turn off a Light:
hue.setLightOn("Lamp 1", true)
Turn on a Room:
hue.setRoomOn("Room 1", true)
Turn off a Room:
hue.setRoomOn("Room 1", false)
The plugin retrieves room and light data on its own, you can access this information via your instance variable. As an example, take a look at the following function:
When you execute the above function in the console, the rooms and lights on your Hue system will be logged to the console like so:
These are just the most basic examples to get you started, there are many more methods/functions available for use and you can always add your own! Check out the "Information" tab of the Hue Plugin to see all of the currently available methods.