Making an On Air Light with Philips Hue and Automation

Making an On Air Light with Philips Hue and Automation

Because I podcast and do live video from my home office while my wife, Melanie, is homeschooling our five kids in the other room, it's important that I let others know when it's safe to knock on my office door and when they have to be very quiet. In the past I looked into those fancy "on-air" lights that you see in TV and radio studios, but they're pricy and usually need to be hard-wired and so instead I've tried various workarounds like notes taped to the door and even a battery operated light that I screwed into the door itself. They never worked well and I eventually stopped using them.

Finally, I think I've got the solution, creating a virtual on-air light using a Philips Hue bulb; a cheap plug-in wall light; and some automation on my Mac.

The first step was to purchase the light. I chose this one because it's not too expensive, it plugs in to the wall, and it will fit a standard Hue bulb. Plus it looks okay. I also got a Philips Hue Color bulb. This was pricier than the regular plain white bulbs I usually get, but for once I had a use for a multi-colored light. When they arrived from Amazon, I hung the lamp, put the bulb in and set it up in the Philips Hue app on my iPhone as normal, naming it "On-Air Lamp".

The next step was to use the Hue API to identify the bulb and the settings I wanted to use. I detailed how to get your API key and use the browser-based CLIP API Debugger tool in my blog post about automating the Hue motion and temperature sensor. The light was found under the lights section of the GET command response. By setting the bulb to the color I wanted in the Hue app first, I'm also able to see the correct settings for the color and brightness I'd eventually want. It looked like this:

I already have a Keyboard Maestro automation that runs when I turn on my sound mixer. It starts my recording software, Audio Hijack, and turns on an app that prevents my computer from sleeping while I'm recording, called Amphetamine. It's triggered when KM detects the USB device connecting to the Mac. For me that was a perfect time to turn on the On-Air Lamp so I added the following to the macro in an "Execute Shell Script" action:

curl http://192.168.4.32/api/[YOUR_API_KEY]/lights/25/state -X PUT -d \{"on": true,"bri": 122,"hue": 64738,"sat": 254,"effect": "none"\} ' -H "Content-Type: application/json"

You should replace [YOUR_API_KEY] with your actual Hue API key. You should also set the action to "ignore results" so it doesn't pop up a notice every time it runs. Also the IP address ("192.168.4.32") should be replaced with whatever the IP address is for the Hue hub on your network.

Of course, I want the light to be off when I'm done, so I set up another KM macro that detects when the mixer is detached from the Mac and executes the same shell script (and only the shell script), but changes the "on" parameter from "true" to "false" and deletes the other parameters because they're unnecessary.

I also set up some macros for my Elgato [easyazon_link identifier="B06XKNZT1P" locale="US" tag="bettnetlinks-20"]Streamdeck[/easyazon_link] so that I could set the light to yellow for when I'm working, but not recording, so they can knock if necessary. Finally, I'm going to set up a Geektool notification for my Mac's desktop to remind me how the light is set right now so I can be sure it's on when it needs to be and off when it doesn't.

Update: I never set up t he Geektool notification because it was easier to set up another Elgato Streamdeck button. The Streamdeck has built-in Hue support so I have the On-Air lamp as an on/off button and so I can see at a glance whether the light is on or not.

Image Credit

  • On-Air-Light.322d3fe37d884746b025483531a52dc2: Own photo
Share:FacebookX

Archives

Categories