Since I recently got an Elgato Key Light Air for the Home Office of Isolation™, I’ve been playing around with how to automate it. I’ve seen a lot of people using Elgato Stream Decks for automating these lights, but I don’t really have the need for a dedicated device for this. At least not yet.
As it turns out, it’s actually pretty easy to automate these lights via other means. The light itself runs a http server on port 9123, and via
/elgato/lights it’s possible to connect to it’s internal API for remote control.
There is even a Postman Collection available, which makes it very easy to get started with connecting and changing settings around.
Since Postman also allows you to export your API calls as a curl command, building the query in Postman is very handy
Once I had two working commands, one for turning the light on with my preferred settings, and one for turning it off, I saved those as two different shell scripts:
This script turns the light on, sets the brightness to 10 and the temperature to 162. Pretty straight forward.
This script is even simpler, it just turns the light off.
If you decide to use these, be sure to replace <your lights ip> with your Elgato lights actual IP-address in your own network
All this is well and fine, and running these scripts does the job nicely. By using iCanHazShortcut, and have added keyboard shortcuts for triggering them:
But then it dawned on me, my MacBook has this pretty Touch Bar that seldom gets any love, or usage for that matter. There had to be a way of creating something for this there as well, right? Turns out, there is, and it’s actually pretty simple to add your own actions to the macOS Touch Bar.
Adding Custom Quick Actions to the macOS Touch Bar #
- First off, open System Preferences -> Keyboard -> Customize Control Strip and drag the Quick Actions button to your Touch Bar
- Create Quick Action in Automator
- Find Run Shell Script and double click it.
- Set Workflow receives to no input and put in the details for your script in the Run Shell Script window.
Set the color you want to have for your Touch Bar button and save the Quick Action with your preferred name, I used Key Light On and Key Light Off for mine.
Repeat steps 1-5 for the second script. Once saved, they should appear under the Quick Actions button on the Touch Bar (added in step 1)
Now I can control turning the light on and off, both from my Touch Bar and via keyboard shortcuts!
- Issues Connecting Elgato Key Light Air to Ubiquiti UniFi Wireless Networks —
- macOS: Aggregate Device for Teams - Fixing Auto-Adjusting Mic Level —
- macOS: Hiding Menu Bar Icons With Dozer —
- macOS: Split Tunnel L2TP VPN Routing —
- macOS Keeps Asking for SSH Passphrase —