Jump to content

Creating Actions for Philips Hue Lights and Getting Setup (Guide)

Recommended Posts

What You'll Need:
Philips Hue Bridge
Philips Hue lights (make sure they are already connected within the Philips Hue app)

 

Finding Your Bridge's IP Address

  1. Tap on "Settings" in the bottom right of your app

image.thumb.jpeg.cc5e2e742bb62914705d4239e47d9790.jpeg

 

      2. Tap on "My Hue System" at the top

image.thumb.jpeg.c88eefc2ecc0b700800b18fde1c945dc.jpeg

 

      3. Tap on the information icon to the right of the bridge

image.thumb.jpeg.e9fa7b0053085f970e75e15f90c1fd36.jpeg

 

      4. Your IP address will show at the bottom

image.thumb.jpeg.d0110796aeae714a2c38c95244cc7bef.jpeg

 

Using the CLIP API Debugger

      1. Now that we have the bridge's IP address you will need to make a new tab and input it into this URL:

https://<bridge ip address>/debug/clip.html

A Debugger interface will show up

image.thumb.jpeg.9879dd94b979a68b63a86a7384ac36af.jpeg

      2. We will not be able to do anything until we obtain our unique username (aka an authorized user) so input this into the debugger

URL:
/api
Message Body:
{"devicetype":"my_hue_app#iphone peter"}

 

      3. Click on "POST"

You will get back an error message which is completely normal. It's Philips Hue's way of security to prove that you have access to your bridge

 

       4. Press the button on your bridge and click on "POST" again

Congrats! You've just obtained your unique username!

image.png.5f314d6d0f46babc1b097b05b815c872.png

 

      5. Copy that username and paste it into Notepad (or a similar program). We'll be using it in everything we do from here on out

 

Changing the lights (ON/OFF, Color Loop, Change Color)

      1. In the debugger copy/paste this into the URL:

URL:
https://<bridge ip address>/api/<username>/lights

 

      2. Click on "GET"

This will show you the state of your lights. If they're on, their color (hue), their saturation (sat), their brightness level (bri) etc.

image.png.62e89f919fa0158b96393daff9c0268d.png

 

      3. Now let's have some fun. Look for the light you want to change (it has a number). In this case we'll choose the first one which is number 4. Copy/paste this into the URL:

URL:
https://<bridge ip address>/api/<username>/lights/<light number>/state

 

      4. Now copy/paste this into the Message Body:

Message Body:
{"on":true, "sat":255, "bri":255,"hue":22070,"transitiontime":20}

 

      5. Click on "PUT" and watch the magic happen!

Here are a few definitions to understand what you can change:

On

      true = The lights will turn on

      false = The lights will turn off

Saturation (sat)

      Determines how saturated you want the color you've chosen (255 is the most saturated (colored) and 0 is the least saturated (white))

Brightness (bri)

      Determines how bright you want your lights. You can choose from 0-255 (0 does NOT turn off the light, 255 is the brightest)

Hue

      The color your light will show (16 million colors to choose from according to Philips Hue)

Transition Time (transitiontime)

      This is how long it takes for the command to take place in seconds (10 = 1 second, 20 = 2 seconds etc.)

Effect

      You can only choose one effect which is color loop. If you want to add that effect just copy/paste

"effect":"colorloop"

If you want to stop the effect then replace "colorloop" with "none"

If you want to check out more definitions then go here. You will need to create a Philips Hue Developer account.

 

      6. Now that you know how to check the state of your lights, you can go into your Philips Hue app, change the lights to whatever you want, then use the URL https://<bridge ip address>/api/<username>/lights to figure out their hue, saturation, and brightness. You can then use the Message Body {"on":true, "sat":255, "bri":255,"hue":22070,"transitiontime":20, "effect":"none"} and change whatever you'd like. Feel free to remove the effect statement entirely, feel free to change the transition time. The worlds your oyster!

 

Saving Actions and Place Into PreShow Experience

Now that we have a handle on how to have the lights behave the way we want to, let's save them in a format PSE can understand

      1. Open Notepad (or a similar program) and copy/paste this into it:

http://<bridge ip address>/api/<username>/lights/<light number>/state
PUT:{"on":true, "sat":255, "bri":255,"hue":22070,"transitiontime":20}

http://<bridge ip address>/api/<username>/lights/<light number>/state
PUT:{"on":true, "sat":255, "bri":255,"hue":65186,"transitiontime":20}

 

SOMETHING VERY IMPORTANT TO UNDERSTAND:

Notice how the URL we are saving into Notepad DOES NOT contain an "s" in http. The debugger tool requires you have https in the URL, but PSE requires you remove the "s" from it. Keep that in mind.

 

      2. In this scenario we are having multiple lights change. You can add as many actions as you want, but remember to have a space in between each one like the example above. I'll show you how to change an entire group after this example.

 

      3. Change the sat, bri, hue, transitiontime and whatever else to whatever you'd like and then click Save As

 

      4. In your title type the name of the file (name it whatever you'd like) then add the extension .pseaction. Change the file type to "All Files"

image.thumb.png.de49f5eb1a7a91898479fa437b9b744e.png

 

     5. Place the new file you just saved into the "Actions" folder of the PSE file structure.

 

     6. Now you can insert an action in the Sequence Editor and you can also click "Test" to see if it works.

 

Adding Automatic Actions When You Press Pause, Resume, and Abort (Stop)

      1. When you are in the PreShow Experience Sequence Editor go to the Settings Menu

 

      2. Go to the left hand side menu and go to "Actions" at the bottom

 

      3. This is where you can choose what action you want for when you Pause, Resume or Abort

 

Hopefully this guide has helped to get you started. I know it's not completely comprehensive, but feel free to input your opinions, suggestions or questions! I'd love to hear what people have done, or are in need of.

Edited by ammonrose
  • Like 2
Link to comment
Share on other sites

I forgot to include how to create actions for groups instead of having to change each individual light. It's as simple as copying/pasting this:

http://<bridge ip address>/api/<username>/groups/<group name>/action
PUT:{"on":true,"bri":180,"hue":7831,"sat":255,"transitiontime":30}
  • Like 1
Link to comment
Share on other sites

  • ammonrose changed the title to Creating Actions for Philips Hue Lights and Getting Setup (Guide)

Here are some action files that I've created that you are free to download. I have kept them as a .txt file so that you can easily edit them (put your bridge ip address in there along with the username, and group/light number). Remember to remove the .txt and save it as a .pseaction file. Enjoy!

Effect Color Loop.pseaction.txt Feature Lights Off.pseaction.txt Sequence Abort (Yellow).pseaction.txt Sequence Pause (Yellow).pseaction.txt Stop Effect.pseaction.txt Trailer Lights.pseaction.txt Trivia Lights.pseaction.txt

  • Like 1
Link to comment
Share on other sites

  • PreShow Supporter

Great thread for Philips Hue users. For anyone who wants to call up scenes in your sequence, just first create the scene using the Philips Hue app and then use the action file to call up that specific scene during your sequence. I've attached a screenshot of mine, for example (I have Trivia and Trailers scenes).

Screenshot_20220812-221806_Hue.thumb.jpg.41b64246615b765f69e3e2318ea864e0.jpg.34f39552c96ce54ea01a43429068eedb.jpg

Here's the content of the action file that I use to activate the "Trailers" scene in the Philips Hue app just before the movie trailers:

#http://<hue-bridge-ip>/api/<hue-bridge-user>/groups/<hue-light-group>/action
#PUT:{"on":true,"scene":"<scene ID>","transitiontime":50}

http://192.168.1.11/api/28555ae631edc91926d069d5d87f165/groups/theater room/action
PUT:{"on":true,"scene":"MC2o4oftCOT2ng6","transitiontime":50}

You can set the transition time to any value you like. I prefer 50.

To find the "code" that identifies the Philips Hue scene you want to activate, use the debug tool. In a web browser enter:

http://<bridge IP address>/debug/clip.html

In the URL field of the CLIP API Debugger, enter:

/api/<username>

Click GET and then search (CTRL+F) for the scene you want to activate in your sequence. For example, to activate the "Trailers" scene I created in the Philips Hue app I searched for "Trailers" and the ID of the scene is "MC2o4oftCOT2ng6" (it'll be found in the Command Response window at the bottom).

Screenshot_20220814-002345_Chrome.thumb.jpg.ca292b9521ffdb0fe096a60754afa20e.jpg.fb8b695e7febf8538878591adb73a2ad.jpg

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

  • 2 months later...
  • 10 months later...

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.

 Share


 Share

×
×
  • Create New...