Control Phillips Hue lights from your computer. No phone or Hue Bridge required!
Install uv and run the script with uvx huec.
Factory reset the lamp, then pair it using Bluetooth.
- Linux: pair with
bluetoothctl. Then usehuec - macOS: just run the power on command once and you get a prompt to pair with the light. Pair and then after that the app can connect to your light.
Then use the cli tool to control hue light.
Make sure to pass the name of your light when controlling it.
Turn on your light with:
uvx huec --device "Hue lightstrip" power onuvx huec --help
usage: main.py [-h] [--debug] [-d DEVICE] [--timeout TIMEOUT]
{interactive,power,color,brightness,alarms,dev} ...
Control Hue lightstrip over BLE.
positional arguments:
{interactive,power,color,brightness,alarms,dev}
interactive Start HTTP server and keep BLE connection open.
power Turn the light on or off.
color Control color and brightness
brightness Read or set brightness while preserving the current
color payload.
alarms Control alarms(routines) to turn the light on/off
automatically.
dev Developer utilities.
options:
-h, --help show this help message and exit
--debug Enable debug logging for BLE requests, responses, and
validation steps.
-d, --device DEVICE BLE device name. Default is read from
~/.config/huec.json
--timeout TIMEOUT BLE scan timeout.
Config file (~/.config/huec.json) format:
{
"default_device": "Hue lightstrip plus",
"device_addresses": {},
"device_name": "Hue lightstrip plus",
"timeout": 10.0
}
I tested it on my hue lightstrip and it works. If you have another hue light and it does not work file an issue.