Creative Lights
This is a small example application that connects Adobe I/O Events with Creative Cloud, Adobe I/O Runtime and Philips Hue.
Prerequisites
You need jq
, which is a command line JSON parser and all-around awesome.
brew install jq
Getting started
This script assumes macOS, with Safari as a default browser.
The first step in the process is to register a webhook with Adobe I/O Events. There is a small helper script that authenticates the app, gets the authentication token and registers the webhook.
./register-webhook.sh <SECRET-KEY>
The script accepts one parameter SECRET-KEY, which I won't hard code (hint: it's secret), but you can get it from the Adobe I/O Console when registering your application.
Hardware Setup
You will need:
- 1 Philips Hue Bridge (buy the newer square version, although the older round version works, too)
- 1 or more Philips Go Lights
- 1 TP Link TL-MR6400 Router
- 1 SIM card
- 1 iPhone with the Philips Hue app installed
You can order all of that from this Amazon List
Do this only once.
- Put the SIM card into the SIM card slot in the router and turn on the router
- Connect the iPhone to the router's wifi network (password at the bottom of the router)
- Connect the Hue bridge using an ethernet cable with the router
- Launch the Hue app on the iPhone
- Tap "Settings", "Hue bridges", "+", "Search"
- Press the button on the Hue bridge
- Wait and add the Hue bridge to the app
- Perform the update as prompted
- Tap "Light setup", "+"
- (optional) add the serial numbers of the Hue Go lights. Numbers can be found at the bottom of the light, look for "S/N". Adding the numbers will make the process more reliable when switching lights between bridges or re-using lights
- Tap "Search". Your lights should show up in the app.
- (optional) Go back to "Home" and create a room as promted. This will allow you to control the lights using the app, which can help with troubleshooting.
- Look up the bridge's IP address in the Hue app: "Settings", "Hue bridges", tap "i" next to your bridge, "Network settings", turn off "DHCP", note the IP address, save. The router will re-assign IP addresses after a short while, so we should reserve the address for the bridge.
- Open the router's admin interface in a web browser, the IP address should be 192.168.1.0. Username/password is admin/admin
- Click "Forwarding", "add new". Pick a "service port", e.g. 8080, use 80 for "internal port", and the bridge's IP address for "IP address". Click save.
- (optional) set up Dynamic DNS
- (if needed) change your APN to one that supports external IP addresses (no provider NAT)
Each time you set up the demo in a new environment:
- Press the button on the bridge
- Run this command on a computer that is on the same network as your Hue bridge:
sh get-hue-url.sh
and write down the username - The resulting address will be:
http://
+ your public IP address (from https://www.whatismyip.com) or Dynamic DNS name + your chosen port +/api/
+ the resulting user name. Copy this address - Go to GitHub's WebHook settings and update the
bridge
URL parameter to the new URL
(If you use dynamic DNS, you only need to do this once.)