用途:OpenHue CLI 用于从终端控制 Philips Hue 灯具与场景,需通过本地网络中的 Hue Bridge 运行。
安装:Linux 可用预编译二进制:curl -sL https://github.com/openhue/openhue-cli/releases/latest/download/openhue-linux-amd64 -o ~/.local/bin/openhue && chmod +x ~/.local/bin/openhue;macOS 可用 brew install openhue/cli/openhue-cli。
配对:首次运行需在 Hue Bridge 上按下按钮完成授权,设备须与运行环境处于同一局域网。
主要能力:
- 列出资源:openhue get light、openhue get room、openhue get scene。
- 控制灯具:openhue set light "Bedroom Lamp" --on/--off,--brightness 0-100,--temperature 153-500 mirek,--color red 或 --rgb "#FF5500"。
- 控制房间:openhue set room "Bedroom" --off 或 --on --brightness 30。
- 场景:openhue set scene "Relax" --room "Bedroom"。
- 常见预设:睡前低亮暖光(20 亮度、450 色温)、工作高亮冷光(100 亮度、250 色温)、电影模式低亮(10 亮度)。
适用场景:语音或脚本方式开关灯、调节某个房间或单灯的亮度与颜色、调用 Hue 场景,以及通过 cron 定时实现就寝变暗、起床变亮等自动化。
限制:Bridge 必须在同一本地网络;首次必须物理按键授权;颜色仅支持彩色灯泡,纯白型号不可调色;灯与房间名称区分大小写,可用 openhue get light 查询准确名称。收费、价格与平台支持范围暂未提供。