How to control Philips Hue lights from a Mac terminal
MacHue pairs with a Philips Hue Bridge on your local network. After pairing you can list the lights, switch one on or off, or recall a scene from the terminal.
Discover and pair a local Hue Bridge
Install MacHue from its project instructions and connect the Mac and the Bridge to the same trusted network. Discovery contacts Philips Hue’s discovery service. If you already know the Bridge’s address, go straight to pairing. Press the physical link button on your Bridge and replace BRIDGE_IP with its address in the second command. MacHue installation.
machue discover
machue --bridge-ip BRIDGE_IP pair
MacHue stores the bridge address and API credential in a local config file. Keep the credential private. The bridge connection uses HTTPS. The default mode skips certificate verification. Where you've configured certificate trust for your Bridge, use --strict-tls before the command to verify its identity.
Test the connection with a single light
Run machue list and find the ID beside the lamp you want. The example uses light 1. Substitute the ID returned by your Bridge.
machue list
machue on 1
machue off 1
Recall a room scene
List the groups, then list scenes for the room you want. Replace 1 with the actual group ID and SCENE_ID with the returned scene ID. For interactive control, open machue tui and press Tab to switch between lights and scenes.
machue groups
machue scenes --group 1
machue scene SCENE_ID