A Go CLI tool that allows you to control the brightness of your Philips Hue light bulbs using a MIDI piano keyboard. The leftmost key corresponds to 0% brightness, and the rightmost key corresponds to 100% brightness.
- 🔍 Auto-discovery: Automatically discovers your local Hue bridge
- 🎯 Light Selection: Choose from available light bulbs using a fuzzy finder
- 🎹 MIDI Calibration: Calibrate your keyboard by pressing the leftmost and rightmost keys
- 🌈 Real-time Control: Control brightness in real-time by pressing keys on your MIDI keyboard
- Go 1.21 or later
- A Philips Hue bridge on your local network
- A MIDI keyboard connected to your computer
-
Clone this repository:
git clone <your-repo-url> cd huemidi
-
Install dependencies:
go mod tidy
-
Build the application:
make build # or manually: go build -o huemidi
-
Connect your MIDI keyboard to your computer
-
Ensure your Hue bridge is on the same network as your computer
-
Run the application:
./huemidi # or: make run
-
Follow the on-screen instructions:
- The app will auto-discover your Hue bridge
- Press the link button on your Hue bridge when prompted
- Select a light bulb from the list using arrow keys and Enter
- Calibrate your MIDI keyboard by pressing the leftmost and rightmost keys
- Start playing! Press keys to control the brightness
HUE_USERNAME
: Set this to skip the authentication step on subsequent runs
Example:
export HUE_USERNAME=your_username_here
./huemidi
- Discovery: Uses the official Hue discovery API to find your bridge
- Authentication: Creates a new user on the bridge (requires pressing the link button)
- Light Selection: Fetches available lights and presents them in a user-friendly list
- MIDI Calibration: Maps your keyboard range to 0-100% brightness
- Real-time Control: Listens for MIDI note-on events and maps key positions to brightness levels
github.com/manifoldco/promptui
- Interactive prompts and selectiongitlab.com/gomidi/midi/v2
- MIDI input handlinggithub.com/tidwall/gjson
- JSON parsing for Hue API responses
- No MIDI devices found: Ensure your MIDI keyboard is connected and recognized by your system
- Permission denied: On Linux, you may need to add your user to the
audio
group
- Bridge not found: Ensure the bridge is on the same network and accessible
- Authentication failed: Make sure to press the link button within 30 seconds of the prompt
- Build errors: Ensure you have Go 1.21+ and run
go mod tidy
- Network issues: Check firewall settings that might block bridge discovery
MIT License